-
-
Notifications
You must be signed in to change notification settings - Fork 111
[feature] Add firmware upgrader websocket routes #484 #529
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
base: master
Are you sure you want to change the base?
[feature] Add firmware upgrader websocket routes #484 #529
Conversation
Adds websocket routes for the OpenWISP firmware upgrader module when USE_OPENWISP_FIRMWARE environment variable is enabled. This enables real-time upgrade progress tracking for: - Individual upgrade operations - Batch upgrade operations - Device-specific upgrade progress
nemesifier
left a comment
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.
Thanks @Adityashandilya555, but openwisp/openwisp-firmware-upgrader#320 is not merged in master yet, so this will have to wait.
Removed OPENWISP_MONITORING_API_BASEURL = API_BASEURL so that monitoring charts use relative URLs and load from the dashboard domain instead of the API domain. This fixes SSL certificate issues for users without trusted certs on the API domain. Closes openwisp#526
WalkthroughThe changes add conditional WebSocket route support for firmware upgrader functionality in the ASGI configuration when Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 2 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Comment |
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
images/common/openwisp/asgi.py (1)
32-37: Implementation follows the established pattern correctly.The conditional import and route extension for firmware upgrader websockets correctly mirrors the existing topology routes pattern (lines 25-30). The logic is sound and the import path aligns with the openwisp-firmware-upgrader routing module.
One minor formatting note: there's a blank line (line 31) separating the topology block from this new block, but no blank line between this block and the radius block (line 38). Consider adding a blank line after line 37 for visual consistency.
Regarding the static analysis hint about the unused
noqa: E402directive—keeping it is fine for consistency with the existing code style at lines 18 and 26.Optional: Add blank line for consistency
routes.extend(firmware_upgrader_routes) + if env_bool(os.environ["USE_OPENWISP_RADIUS"]):
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
images/common/openwisp/asgi.pyimages/openwisp_dashboard/module_settings.py
💤 Files with no reviewable changes (1)
- images/openwisp_dashboard/module_settings.py
🧰 Additional context used
🧬 Code graph analysis (1)
images/common/openwisp/asgi.py (1)
images/common/openwisp/utils.py (1)
env_bool(29-30)
🪛 Ruff (0.14.10)
images/common/openwisp/asgi.py
33-33: Unused noqa directive (non-enabled: E402)
Remove unused noqa directive
(RUF100)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: CI Build
Adds websocket routes for the OpenWISP firmware upgrader module when USE_OPENWISP_FIRMWARE environment variable is enabled.
This enables real-time upgrade progress tracking for:
Checklist
Reference to Existing Issue
Closes #484.
Description of Changes
Modified
images/common/openwisp/asgi.pyto include firmware upgrader websocket routesPlease describe these changes.
Screenshot
Please include any relevant screenshots.