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
Release Resin-SDK v7.0.0 #420
Conversation
…length These were slightly convenient, but hacky and inconsistent with any data retrieved manually with $expands. One day we might bring these back, but for now it's much cleaner for everybody if we keep this simple. Change-Type: major
Both of these were generated from expanded data we'd like to remove, and somewhat messily at that. You can easily generate them by hand by expanding application yourself and looking at the name and id there by hand. Change-Type: major
….' } options to opt in instead. Change-Type: major
… types (not just Error) Change-Type: patch
…e types Connects-To: #358 Change-Type: major
Change-Type: major
Breaking: Don't allow creating devices with discontinued device types
Change-Type: major
Break everything we can pre-v3
Change-Type: major
Node 4 may well still work with the SDK for quite a while, but we'll no longer actively test against it, and it's quite possible that it may stop working entirely in any future release. Change-Type: major
Replace generateApiKey with generateProvisioningKey
*BREAKING*: Stop actively supporting node 4.
option) Change-Type: major
…& result properties now include verbs (e.g. device.application is now device.belongs_to__application). Change-Type: major
Move to API v3
Woohoo! I'm on it! |
@thgreasi I've been doing my own review of the codebase - I think I've actually found a couple of bugs in here in the untested device methods (things that do stuff with real devices, like shutdown/reboot) from the combination of changing the relationships and removing the expands. I'm going to do some quick testing to confirm, fix them, and then update this PR with the results soon. |
@pimterry, status checks have failed for this PR. Please make appropriate changes and recommit. |
lib/models/device.coffee
Outdated
@@ -421,7 +428,7 @@ getDeviceModel = (deps, opts) -> | |||
exports.getApplicationInfo = (uuidOrId, callback) -> | |||
exports.get(uuidOrId).then (device) -> | |||
ensureSupervisorCompatibility(device.supervisor_version, MIN_SUPERVISOR_APPS_API).then -> | |||
appId = device.application[0].id | |||
appId = device.belongs_to__application[0].id |
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 think that this needs to change since we are not expanding the belongs_to__application
.
I guess that we should either expand it or use device.belongs_to__application.__id
.
lib/models/device.coffee
Outdated
@@ -812,7 +819,7 @@ getDeviceModel = (deps, opts) -> | |||
exports.startApplication = (uuidOrId, callback) -> | |||
exports.get(uuidOrId).then (device) -> | |||
ensureSupervisorCompatibility(device.supervisor_version, MIN_SUPERVISOR_APPS_API).then -> | |||
appId = device.application[0].id | |||
appId = device.belongs_to__application[0].id |
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.
Like above
I think that this needs to change since we are not expanding the
belongs_to__application
.
I guess that we should either expand it or usedevice.belongs_to__application.__id
.
lib/models/device.coffee
Outdated
@@ -855,7 +862,7 @@ getDeviceModel = (deps, opts) -> | |||
exports.stopApplication = (uuidOrId, callback) -> | |||
exports.get(uuidOrId).then (device) -> | |||
ensureSupervisorCompatibility(device.supervisor_version, MIN_SUPERVISOR_APPS_API).then -> | |||
appId = device.application[0].id | |||
appId = device.belongs_to__application[0].id |
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.
Like above
I think that this needs to change since we are not expanding the
belongs_to__application
.
I guess that we should either expand it or usedevice.belongs_to__application.__id
.
@@ -982,7 +989,7 @@ getDeviceModel = (deps, opts) -> | |||
baseUrl: apiUrl | |||
body: | |||
deviceId: device.id | |||
appId: device.application[0].id | |||
appId: device.belongs_to__application[0].id |
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.
Like above
data: | ||
appId: device.application[0].id | ||
appId: device.belongs_to__application[0].id |
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.
Like above twice
@@ -1071,7 +1078,7 @@ getDeviceModel = (deps, opts) -> | |||
baseUrl: apiUrl | |||
body: | |||
deviceId: device.id | |||
appId: device.application[0].id | |||
appId: device.belongs_to__application[0].id |
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.
Like above and actually I think that's the same for the rest of the occurrences in this file.
Sorry for the noise.
Change-Type: patch
…directly instead Change-Type: major
@thgreasi See the last 4 commits - I've been through and manually tested every untested method in the devices file with a real pi. I've fixed the few that were broken by missing relationships, plus fixing a couple of preexisting bugs and mess in some of the others. I've also stopped exposing the weird Rereview please! |
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.
Have some questions but already LGTM 👍 🎊
return request.send | ||
method: 'DELETE' | ||
method: 'POST' |
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 guess that this changed at some point
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.
As far as I can tell, it's needed this since basically forever, so it's never worked... The API supervisor proxy requires a POST, plus the real method to use in the body.
Horia fixed the same issue in ping
recently. The problem is we just don't have automated tests for this stuff right now, so any useful but rarely used methods like this that require real devices can be silently broken 😢
@@ -1070,8 +1085,13 @@ getDeviceModel = (deps, opts) -> | |||
# if (error) throw error; | |||
# }); | |||
### | |||
exports.update = (uuidOrId, options, callback) -> | |||
exports.get(uuidOrId).then (device) -> | |||
exports.update = (uuidOrId, options = {}, callback) -> |
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.
What happens when updating with an empty object? Does it serve like a ping?
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.
Update options are actually only allowed to be force: true/false
(or nothing). All this method does is ping a device to get it to check for an update. I'm not 100% sure why that's useful, but it's a feature the supervisor supports, so I'm happy to leave it here for now.
@@ -101,7 +101,7 @@ getDeviceModel = (deps, opts) -> | |||
# console.log('Is compatible'); | |||
# }); | |||
### | |||
exports.ensureSupervisorCompatibility = ensureSupervisorCompatibility = Promise.method (version, minVersion) -> | |||
ensureSupervisorCompatibility = Promise.method (version, minVersion) -> |
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.
It seems that we don't use it in the dashboard, so 👍
VersionBot failed to carry out a status check for the above pull request here: #420. The reason for this is: |
This includes lots of breaking changes, notably including the upgrade to the new API v3.
All these changes have previously been reviewed, this PR is just merging them all together and using versionbot to actually ship them to npm.
For posterity, this PR includes:
---- Autogenerated Waffleboard Connection: Connects to Creating an application with a discontinued device type should fail #358