-
Notifications
You must be signed in to change notification settings - Fork 280
Upgrade Dredd Transactions and refactor how annotations are processed #1351
Conversation
20b9d7b
to
13c3393
Compare
Please see https://github.com/apiaryio/dredd-transactions/releases and https://github.com/apiaryio/api-elements.js/releases for more details Close #1338
13c3393
to
9513b9a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've only had minor comments. Otherwise approved!
const annotationsError = handleRuntimeProblems(apiDescriptions, this.logger); | ||
if (annotationsError) { callback(annotationsError, this.stats); return; } | ||
const loggerInfos = toLoggerInfos(apiDescriptions); | ||
// FIXME: Winston 3.x supports calling .log() directly with the loggerInfo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can reference #1225 here to keep track of the changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
if (origin.resourceGroupName) { segments.push(origin.resourceGroupName); } | ||
if (origin.resourceName) { segments.push(origin.resourceName); } | ||
if (origin.actionName) { segments.push(origin.actionName); } | ||
if (origin.exampleName) { segments.push(origin.exampleName); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand this is copy-pasted, but you can also do a slightly shorter syntax:
const segments = [
origin.apiName,
origin.resourceGroupName,
origin.resourceName,
origin.actionName,
origin.exampleName,
].filter(Boolean).join(' > ')
Apart from shorter declaration it also reduces the function's complexity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good suggestion. I'll file it as a DT issue and fix it there. This wile stays copy-pasted and then deleted once DT provides the name directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 This PR is included in version 11.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🚀 Why this change?
Dredd Transactions contain a lot of new fixes and features (not only) in OAS3 support. There's more and more issues on Dredd which are filed only because Dredd is behind in what has been already developed.
Dredd is behind because new versions of the parsing toolchain caught me off guard during refactoring rather larger portions of the Dredd codebase. This should be the last missing piece, which will address pending issues around annotation line/column numbers and will upgrade Dredd Transactions in the process to address outstanding OAS3 issues.
📝 Related issues and Pull Requests
✅ What didn't I forget?
npm run lint