wishlist: retention cleanup for Forgejo package registries (deb/rpm) ai:claude-opus-5-5 #88
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
nagonag
nagonag/ignore
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
heiko/gogogo#88
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Wishlist: apply the release retention policy (
cleanupOldReleases, see gogogo(7) RETENTION POLICY) to the Forgejo package registries (Debian, optionally RPM), without duplicating the policy code.Idea
internal/retention:Decide(newest string, items []Item) Plan{Prune, Delete}— keep the 2 newest of the same kind (semver order), prune the rest; on a full release delete older pre-releases.DeleteAttachments, Delete =DeleteRelease+DeleteTag(refactor existing code ontoDecide)debUpstream: strip-Nrevision,~→-, prefixv(unambiguous; semver has no~). Group by upstream; also drop older revisions of the current upstream.Forgejo API (verified on 17.0.0+gitea-1.22.0)
GET /api/v1/packages/{owner}?type=debian&q=<name>(paginated;name,version,repository)DELETE /api/v1/packages/{owner}/{type}/{name}/{version}DELETE /api/packages/{owner}/debian/pool/{dist}/{comp}/{name}/{version}/{arch}.../{version}/filesdoes NOT expose distribution/component.Concerns / open points
--dry-run.publish.APIadditions minimal (ListPackages,DeletePackageVersion); share only the policy, not a generic "versioned thing" interface.^[0-9.]+-[0-9]+$, keep count, last-download age). Cannot express "full release supersedes older pre-releases" by semver. Evaluate first.(co)authored by ai:claude-opus-5-5
Decisions:
DELETE /api/v1/packages/{owner}/{type}/{name}/{version}). gogogo is treated as the manager of the registry. Losing reinstall/downgrade of pruned versions is accepted.internal/retention.Decide, andcleanupOldReleasesis refactored onto it. New guard: the version being published is never pruned.-Nis the revision, otherwise the version is native. Then~→-and prefixv.<Version>-<Release>(no epoch, since gogogo uses NoEpoch).ReleaseisNfor full releases and0.N.<pre>for pre-releases.forgejo-packagesdestinations; the dupload path is untouched.publish.retention(defaulttrue), overridden bypublish.destinations.<name>.retention. Setting it on a dupload destination is a validation error.Verified on forgejo.schlittermann.de (17.0.0+gitea-1.22.0): debian versions look like
0.28.0-1and0.0.2~0.20261014125915~c4924cc3feb8. The RPM version format comes from Forgejo v17.0.0modules/packages/rpm/metadata.go; it has not been observed live because the RPM registry is still empty.Work happens on branch
feat/pkg-retention.(co)authored by ai:claude-opus-5-5