Update delete_expired_artifacts to take collections into account
https://freexian-team.pages.debian.net/debusine/explanation/concepts.html documents the intended rules for the retention of artifacts referenced by collections, and for the retention of collection items. We should update delete_expired_artifacts for this.
https://freexian-team.pages.debian.net/debusine/reference/collections.html#collection-workflow-internal also requires that a workflow's internal_collection should not retain its contained artifacts. I suggest adding a retains_artifacts flag to the Collection model for this (or a better name if you can think of one).
I think it would make sense to implement expiry of collection items in the delete_expired_artifacts command. It should happen before running expiry on artifacts themselves.
-
add Collection.retains_artifacts -
set retains_artifactson workflowinternal_collections (may be moved to another issue if the relevant bits of workflows aren't ready yet) -
don't delete artifacts as long as they are referenced by a collection with retains_artifacts=True; this should be done somewhere withinDeleteExpiredArtifacts._mark_to_keep -
implement expiry of collection items
Edited by Jochen Sprickerhof