[feature] Add firmware upgrader websocket routes #484#529
[feature] Add firmware upgrader websocket routes #484#529Adityashandilya555 wants to merge 9 commits intoopenwisp:masterfrom
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.
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.
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.