openwisp / openwisp-firmware-upgrader

Firmware upgrade solution for OpenWRT with possibility to add support for other embedded OSes. Provides features like automatic retry for network failures, mass upgrades, REST API and more.
http://openwisp.org
Other
50 stars 58 forks source link

[feature] Allow to perform mass upgrade of devices by their group #213

Open nemesifier opened 1 year ago

nemesifier commented 1 year ago

OpenWISP Controller has recently introduced the concept of Groups. It would be great to allow to upgrade all the devices related to a group with a mass upgrade operation. We could add an optional group field on the mass upgrade model which if filled would cause the upgrade operation to work only on the devices related to that group.

There would be a few things to change to make sure the dry run method works consistently. In the admin we have to show the group field as an autocomplete field and add a filter by group (also autocomplete) in the admin list.

The internal logic of models and methods shall also take into account this change and if the group is defined only devices of that group must be upgraded.

We will add to add validation logic in the model to ensure that the group of a mass upgrade operation matches its organization, there's already plenty of similar logic in different openwisp modules, see also: https://github.com/openwisp/openwisp-users/blob/master/openwisp_users/mixins.py#L11 .

We must remember to not forget to add mention of this feature in the README (intro and mass upgrade explanation section).