Skip to content

Conversation

@Adityashandilya555
Copy link
Contributor

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

Checklist

  • I have read the OpenWISP Contributing Guidelines.
  • I have manually tested the changes proposed in this pull request.
  • I have written new test cases for new code and/or updated existing tests for changes to existing code.
  • I have updated the documentation.

Reference to Existing Issue

Closes #484.

Description of Changes

Modified images/common/openwisp/asgi.py to include firmware upgrader websocket routes
Please describe these changes.

Screenshot

Screenshot 2025-10-26 at 12 23 40 PM

Please include any relevant screenshots.

Adityashandilya555 and others added 3 commits October 26, 2025 12:13
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
Copy link
Member

@nemesifier nemesifier left a 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.

Adityashandilya555 and others added 5 commits November 5, 2025 20:24
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
@coderabbitai
Copy link

coderabbitai bot commented Jan 13, 2026

Walkthrough

The changes add conditional WebSocket route support for firmware upgrader functionality in the ASGI configuration when USE_OPENWISP_FIRMWARE is enabled. Additionally, an unused monitoring API base URL constant is removed from the dashboard module settings. These are configuration-level changes with no modifications to core business logic or control flow.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related issues

  • Issue 484: Directly implements the requested addition of firmware upgrader WebSocket routes by conditionally importing and extending websocket_urlpatterns from openwisp_firmware_upgrader.routing when the feature flag is enabled.
🚥 Pre-merge checks | ✅ 2 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The removal of OPENWISP_MONITORING_API_BASEURL from module_settings.py appears unrelated to the websocket routes feature and may be out of scope. Clarify why OPENWISP_MONITORING_API_BASEURL was removed from module_settings.py, or move that change to a separate pull request focused on that specific modification.
Description check ❓ Inconclusive The description provides context about the changes and references issue #484, but all checklist items are unchecked, indicating testing, tests, and documentation were not completed. Complete the checklist items: confirm manual testing was done, add test cases if needed, and update documentation accordingly.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main feature addition: adding firmware upgrader websocket routes when the feature is enabled.
Linked Issues check ✅ Passed The changes add websocket route imports and extensions to asgi.py when USE_OPENWISP_FIRMWARE is enabled, meeting the objective in #484 to integrate firmware upgrader websocket routes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a 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: E402 directive—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

📥 Commits

Reviewing files that changed from the base of the PR and between 85f3ce1 and 0c13154.

📒 Files selected for processing (2)
  • images/common/openwisp/asgi.py
  • images/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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature] Add firmware upgrader websocket routes

2 participants