Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[feature:gsoc26] Link Command execution history to MassCommand history and execution tracking

Aperta
#1,348 5 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@dee077 ci sta già lavorando.

Dal 6/5/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

enhancement gsoc

Is your feature request related to a problem? Please describe.

Currently, each command execution is stored independently in the Command model, but there is no relationship between individual command executions and the mass operation that triggered them.
With the introduction of mass command execution, multiple Command objects will be created as part of a single MassCommand operation. Without an explicit relationship between these models, it would not be possible to identify from the device command history whether a command was executed individually or as part of a mass operation.

Describe the solution I would implement

I would like to add a relationship between Command and MassCommand by introducing a nullable foreign key in AbstractCommand.

mass_command = models.ForeignKey(
    get_model_name("connection", "MassCommand"),
    null=True,
    blank=True,
    on_delete=models.SET_NULL,
)
  1. Add a nullable mass_command foreign key field to AbstractCommand so that commands created as part of a batch operation can reference their parent MassCommand.
  2. Commands executed individually through the existing single-device workflow will continue to have this field set to NULL.
  3. On the device detail page, the command history should indicate whether a command was executed as part of a mass operation.
  4. If a command belongs to a MassCommand, the UI should provide a link to the corresponding mass command execution result page, allowing administrators to navigate directly to the parent batch operation.

Details to preserve during implementation

The device detail page integration should explicitly cover the Recent Commands section mentioned in the proposal. Commands created by a MassCommand should be visible there with enough context to show they belong to a parent mass operation.

The deletion behavior should be coordinated with the REST API and lifecycle work in #1349. The currently proposed on_delete=models.SET_NULL preserves child Command records but removes the parent link if the MassCommand is deleted. Possible approaches to investigate include allowing deletion and losing the parent link, protecting MassCommand deletion while child commands exist, soft-deleting or archiving MassCommand records, or another lifecycle rule that preserves traceability.

Automated tests should cover the nullable mass_command relation, single-device commands keeping this field set to NULL, command history rendering, and navigation from a command history entry to the parent MassCommand when applicable.

Lingua principale
Python
Stelle
779
Fork
328
Merge medio
2g 19h
PR unite (30g)
7

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di openwisp/openwisp-controller

Tutte le issue di openwisp/openwisp-controller

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.