Skip to content

Let delete-activities target an exact list of process ids - #213

Merged
ccomb merged 5 commits into
mainfrom
delete-by-ids
Jul 15, 2026
Merged

Let delete-activities target an exact list of process ids#213
ccomb merged 5 commits into
mainfrom
delete-by-ids

Conversation

@ccomb

@ccomb ccomb commented Jul 14, 2026

Copy link
Copy Markdown
Owner

The only selection mode was a filter that resolves to its whole matching set — an empty filter matches everything. Deleting a known list of processes therefore required a deliberately unsatisfiable filter (e.g. product="ZZZ_no_match_ZZZ") plus the extra list, a hack even pyvolca's client documents.

The request now carries an optional ids list naming the selection verbatim; keep and extra compose with it unchanged. ids combined with filter fields is refused — an ambiguous request must never be guessed at. The field is additive on the wire (a spec pins that a request without the key still decodes), and reaches the CLI as a repeatable --id.

Delete's arguments moved into a DeleteRequest record on the way: the nine-positional-argument signature was already a smell, and a tenth would have made every call site unreadable.

ccomb added 4 commits July 14, 2026 23:49
The only selection mode was a filter that resolves to its whole matching
set — an empty filter matches everything. Deleting a known list of
processes therefore required a deliberately unsatisfiable filter (e.g.
product="ZZZ_no_match_ZZZ") plus the extra list, a hack even pyvolca's
client documents.

The request now carries an optional ids list naming the selection
verbatim; keep and extra compose with it unchanged. ids combined with
filter fields is refused — an ambiguous request must never be guessed
at. The field is additive on the wire (old clients omit it) and reaches
the CLI as a repeatable --id.

Delete's arguments moved into a DeleteRequest record on the way: the
nine-positional-argument signature was already a smell, and a tenth
would have made every call site unreadable.
The client builds the delete body by hand and never carried the new ids
field, so 'volca database delete-activities --id PID' against a server
fell back to filter mode — whose empty filter selects the whole
database. Wire-contract specs now pin both directions: --id values reach
the server as the ids selection, and filter mode still omits ids so old
servers keep working. Also pins the documented ids/keep/extra
composition at the Edit level.
exact only modifies name/classification matching, so alongside ids it
silently does nothing. Treat it like the other filter fields: refuse the
ambiguous request instead of guessing.
@ccomb

ccomb commented Jul 14, 2026

Copy link
Copy Markdown
Owner Author

Suite de revue — trois correctifs poussés :

  • Le client CLI n'envoyait jamais ids : volca database delete-activities --id PID en mode client HTTP retombait sur le mode filtre, dont le filtre vide sélectionne toute la base. Corrigé dans deleteSelectionBody, avec deux specs de contrat wire (les --id arrivent comme sélection ids ; le mode filtre continue d'omettre la clé pour les vieux serveurs).
  • --exact combiné à --id est maintenant refusé comme les autres champs de filtre (il ne modifiait silencieusement rien).
  • Tests de composition ids+keep/extra (promis par la description mais non couverts) et retouche README.

Reste hors de cette PR : le paramètre ids côté pyvolca (motivation citée dans la description). Attention en l'ajoutant : un vieux serveur ignore la clé inconnue et retombe sur le filtre vide — l'ajout devra être gardé par wireVersion.

@ccomb
ccomb merged commit d94f0f4 into main Jul 15, 2026
9 checks passed
@ccomb
ccomb deleted the delete-by-ids branch July 15, 2026 03:46
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.

1 participant