-
Notifications
You must be signed in to change notification settings - Fork 17
Make this SDK compatible with node6 again #446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This pull request fixes 1 alert when merging 579e51b into 15b77fe - view on LGTM.com fixed alerts:
|
Codecov Report
@@ Coverage Diff @@
## master #446 +/- ##
==========================================
+ Coverage 95.96% 95.97% +<.01%
==========================================
Files 33 33
Lines 1637 1641 +4
==========================================
+ Hits 1571 1575 +4
Misses 66 66
Continue to review full report at Codecov.
|
This pull request fixes 1 alert when merging 96125e3 into 15b77fe - view on LGTM.com fixed alerts:
|
This pull request fixes 1 alert when merging fc01ea9 into 15b77fe - view on LGTM.com fixed alerts:
|
} | ||
} | ||
} | ||
}' kuzzle:7512/roles/privileged/_create |
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 need to create the role beforehand because now kuzzle refuses to create a profile based on a non-existing role
template: default | ||
expected: ^(Kuzzle Server configuration:) {("dump":{.*}),("limits":{.*}),("plugins":{.*}),("queues":{.*}),("repositories":{.*}),("server":{.*}),("services":{.*}),("stats":{.*}),("validation":{.*}),("_":.*),("internal":{.*}),("version":"[0-9]\.[0-9]\.[0-9]")}$ | ||
|
||
expected: ^(Kuzzle Server configuration:) {("dump":{.*}),("limits":{.*}),("plugins":{.*}),("queues":{.*}),("repositories":{.*}),("server":{.*}),("services":{.*}),("stats":{.*}),("validation":{.*}),("_":.*),("internal":{.*}),("version":"[0-9]+\.[0-9]+\.[0-9]+")}$ |
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.
Because the change here is not immediately obvious: this fixes the erroneous version regex that fails now because, kuzzle being in 1.10, the minor version has 2 digits
|
||
for (const [controller, definition] of Object.entries(this.customRoutes)) { | ||
for (const [action, route] of Object.entries(definition)) { | ||
for (const controller of Object.keys(this.customRoutes)) { |
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.
Object.entries does not exist in node6
actions: { | ||
list: true | ||
} | ||
const response = await kuzzle.security.updateRole('read-only', { |
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.
Missing await
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.
Fix the missing await and 👍 for me
Description
More and more NPM modules are dropping support for Node.js 6, making it hazardous to not test this SDK against that version of node to guarantee that it stays compatible with Kuzzle v1.
Also,
Object.entries
have been added to this SDK, which does not exist in node6, making Kuzzle crash if an attempt is made to use this SDK with Node.js 6.So this PR forces Travis to run tests using Node.js 6, and all other changes are made to make that SDK fully-compatible, tests included.
Once Kuzzle v2 is out, we'll release a major version of this SDK dropping support for node 6, allowing us to once again use async/await and other new features.
Other changes