feat(remove-outputs): tag-scoped retention for limit and age #313
Open
timdegroot1996 wants to merge 1 commit into
Open
feat(remove-outputs): tag-scoped retention for limit and age #313timdegroot1996 wants to merge 1 commit into
timdegroot1996 wants to merge 1 commit into
Conversation
) Make `limit` and `age` respect a `tags` filter so housekeeping can be scoped to a subset of runs instead of acting globally: - limit + tags -> keep the N newest runs carrying any of the given tag(s), remove older matching runs, leave untagged runs untouched. - age + tags -> remove only tagged runs within the age range, leave untagged runs untouched (supports both older `10d` and younger `-10d`). CLI combination syntax uses the regular comma separator, e.g. `-r "limit=10,tag=nightly"` / `-r "age=10d,tag=nightly,tag=prod"`. arguments.py detects the combination, validates it, and rewrites it into the internal `limit=N;tag=...` / `age=X;tag=...` form (the legacy `;` form still works). Rules: - tags may combine with EITHER limit OR age, not both (error). - only one limit/age may be combined with tags (error). - a clear INFO line explains exactly what will be deleted; when independent options (index/alias/run_start) are also present the deletion order is printed. Server `/remove-outputs` scopes the same way when `tags` is sent with `limit` and/or `age`, and rejects the limit+age+tags combination before removing anything. Backward compatible: plain limit/age/tag (no partner) behave exactly as before; the elif dispatch in database.py is reordered so combined queries route to the scoped handler. Docs (CLI + server), OpenAPI examples, and the admin UI labels updated. Also documents the previously under-documented negative-age (`-10d`) behavior in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #309
Make
limitandagerespect atagsfilter so housekeeping can be scoped to a subset of runs instead of acting globally:10dand younger-10d).CLI combination syntax uses the regular comma separator, e.g.
-r "limit=10,tag=nightly"/-r "age=10d,tag=nightly,tag=prod". arguments.py detects the combination, validates it, and rewrites it into the internallimit=N;tag=.../age=X;tag=...form (the legacy;form still works). Rules:Server
/remove-outputsscopes the same way whentagsis sent withlimitand/orage, and rejects the limit+age+tags combination before removing anything.Backward compatible: plain limit/age/tag (no partner) behave exactly as before; the elif dispatch in database.py is reordered so combined queries route to the scoped handler.
Docs (CLI + server), OpenAPI examples, and the admin UI labels updated. Also documents the previously under-documented negative-age (
-10d) behavior in the docs.