-
Notifications
You must be signed in to change notification settings - Fork 26
feat(migrations): add support for migrations #97
Conversation
Code Climate has analyzed commit a56f98d and detected 0 issues on this pull request. View more on Code Climate. |
@@ -19,7 +19,7 @@ export const schema = { | |||
properties: { | |||
name: { type: 'string', enum: supportedPages }, | |||
html: { type: 'string', default: '' }, | |||
url: { type: 'string', default: '' }, | |||
url: { type: 'string' }, |
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 was changed because the default was adding a url
property in dump that was not expected in deploy-cli
. Not related to the PR 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.
LGTM overall, some minor suggestions. The package-lock.json
I think needs fixing.
await stageFn.apply(handler, [ { | ||
migrations: { | ||
migration_flag: false | ||
} | ||
} ]); |
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'd use Function.call
to avoid the extra array.
await stageFn.apply(handler, [ { | |
migrations: { | |
migration_flag: false | |
} | |
} ]); | |
await stageFn.call(handler, { | |
migrations: { | |
migration_flag: false | |
} | |
}); |
What is preventing you from using handler.processChanges
? 🤔
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 don't think there is anything preventing it but instead the desire to mimic the actual call made by the main class https://github.com/auth0-extensions/auth0-source-control-extension-tools/blob/master/src/auth0/index.js#L36-L40
I can clean up to simplify but I was just following the convention of the repo instead of adding a new one.
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.
Fair enough, if that is the convention then let's not change it in this PR.
This reverts commit ad05088.
LGTM |
✏️ Changes
Adds support for the new migrations endpoint. This is expected to be passed in the
migrations
property as a set of properties of typeboolean
.When updating migrations the following checks are performed:
false
, meaning that the migration is being disabled, we will log a warning and ignore the flag.true
, meaning the migration is still enabled, it will be sent to the server.The goal of the logic is that the flag van be disabled via the deployment tools and avoid causing errors when the migration period ends.
Additionally a configuration parameter
AUTH0_IGNORE_UNAVAILABLE_MIGRATIONS
allows to ignore all migrations flags not available regardless of its value. In this case we will log an info message with the names of the flags ignored.🔗 References
auth0/node-auth0#503
🎯 Testing
🚫 This change has been tested in a Webtask
✅ This change has unit test coverage
🚫 This change has integration test coverage
🚫 This change has been tested for performance
🚀 Deployment
🚫 This can be deployed any time
node-auth0