Repository navigation
feat(api): Report the dweOS version in the API - #581
Merged
Merged
Conversation
The backend reads the dweOS version from frontend/package.json, which bump_version.sh and the preview workflow already set. The OpenAPI spec and the BlueOS extension registration report it in place of the hard-coded 0.1.0 and 1.0.0, and the new GET /api/system/version returns it so clients can check which dweOS they are talking to. Release builds ship only the frontend build, so create_release.sh now writes a package.json with just the version into release/frontend. If the file is missing, the version is "unknown".
|
|
Member
Author
|
This could be used to possibly ensure that the frontend state is not out of date after an update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The API reported a hard-coded version:
0.1.0in the OpenAPI spec and1.0.0in the BlueOS extension registration. Now the backend reports the real dweOS version.backend_py/src/version.pyreads the version fromfrontend/package.json, whichbump_version.shand the preview workflow already set. Preview builds therefore reportvX.Y.Z-prN.<sha>. If the file can't be read, the backend logs a warning and the version isunknown.info.version) and BlueOS/register_servicereport this version. Theopenapi.jsonattached to each GitHub release now carries the real version.GET /api/system/versionreturns{"version": "v0.7.7"}, so the SDK and other clients can check which dweOS they are talking to.create_release.shnow writes arelease/frontend/package.jsonthat contains only the version.frontend/src/schemas/dwe_os_2.d.tsis not regenerated, because the frontend doesn't use the new endpoint and #579 also regenerates that file.Fixes #517
Type of change
Quick Checklist
Tested
ruff,ruff formatandtypass.create_release.shfrom a clean checkout.release.tar.gzcontainsfrontend/package.jsonwith only{"version": "v0.7.7"}. From the extracted release, the backend,/api/system/version, the OpenAPI spec and/register_serviceall reportv0.7.7.package.jsonmissing, the version falls back tounknown.Not yet tested