Skip to content

[feature] Backend - Location-based Mass Firmware Upgrades #314

@youhaveme9

Description

@youhaveme9

Title

Implement Location-based Mass Firmware Upgrades

Context / Approach

Currently, mass firmware upgrades in OpenWISP can only target all devices or devices with specific firmware. We need to extend this functionality to allow targeting devices based on their physical location, similar to the group-based filtering feature.

My approach will be to:

  1. Add an optional location ForeignKey field to the BatchUpgradeOperation model
  2. Implement validation logic to ensure the location belongs to the same organization as the build
  3. Modify the device filtering logic in _find_related_device_firmwares and _find_firmwareless_devices methods to filter by location when specified
  4. Implement combined filtering logic when both group and location are specified (AND condition)
  5. Add comprehensive tests for all new filtering scenarios

This approach maintains consistency with OpenWISP's organization-based permission model while providing more granular control over firmware upgrades.

Reference: The implementation will follow a similar pattern to the group-based filtering, with location lookups using the GIS functionality in OpenWISP.

Dependencies

  • Depends on the implementation of group-based mass firmware upgrades
  • Requires OpenWISP's location management system to be properly set up

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions