feat/pkg-retention #89

Manually merged
heiko merged 13 commits from feat/pkg-retention into master 2026-10-17 12:57:01 +02:00
Owner
No description provided.
Decide() holds the keep-two-newest / full-release-supersedes-pre-releases rule, so releases and package registries can share it. The version being published is never touched.

Refs #88
SemverFromDeb and SemverFromRPM invert DebVersion and RPMVersion, including the packaging revision. Versions gogogo could not have produced are rejected, so a later cleanup leaves them alone.

Refs #88
One list call for both kinds instead of two filtered ones. Kind is taken from the tag's semver, drafts and non-semver tags are ignored, and the release being published is never stripped (new tests).

Refs #88
New publish.API methods plus the Forgejo implementation: paged list with exact name match, whole-version delete (404 counts as gone). Needed for registry retention.

Refs #88
publish.retention (default true) and publish.destinations.<name>.retention. Setting it on a dupload destination is a validation error: gogogo does not manage those repositories.

Refs #88
The migrator rendered publish.blob/deb/rpm and publish.destinations only as commented examples, so a migrated config silently lost the user's routing, dupload hosts and now retention opt-outs. User choices are kept, defaults stay commented.

Refs #88
After a successful publish, apply the retention policy to the package names just uploaded to forgejo-packages destinations (whole-version delete; dupload untouched). Registry cleanup runs before the release cleanup and only warns on failure. --dry-run shows the effective settings.

Refs #88
README, gogogo(7) RETENTION POLICY and gogogo.conf(5); regenerated man pages.

Refs #88
The commented destinations block of a migrated config now matches default.yml, including the per-destination retention hint.

Refs #88
Keep the newest full release and all pre-releases newer than it; delete
older releases and pre-releases, on forge releases and Forgejo deb/rpm
registries alike. Git tags stay, except those of old snapshots
(pseudo-versions made by gogogo). doctor shows the cleanup policy per
upload destination.

Refs #88
Author
Owner

Review of 2b692ed

Fixed and verified:

  • RPM cleanup no longer mistakes a version-shaped package-name part for another package (tool-1.3.0-addon).
  • Retention keeps distinct semver metadata tags such as v1.2.0 and v1.2.0+incompatible and deletes both when superseded.
  • Migration quotes destination aliases, keeping keys like "archive: stable" valid YAML.

Remaining (docs, P3):

  • man/gogogo.conf.5.md:422-423 says publish.retention: false keeps everything. publishRelease still calls cleanupStaleDrafts (internal/cmd/release/release.go:1622), which deletes drafts older than 3 days; doctor already reports this. Please document the exception and regenerate man/gogogo.conf.5.gz.

Verification: go test -short ./..., go vet ./..., go build ./..., focused -race, shuffle run, and golangci-lint run --new-from-rev=f779632 pass. Full lint has 20 issues in files this PR doesn't touch. IUS integration test not run.

Verdict: approve after the docs fix.

(co)authored by ai:claude-opus-5-5

Review of `2b692ed` Fixed and verified: - RPM cleanup no longer mistakes a version-shaped package-name part for another package (`tool-1.3.0-addon`). - Retention keeps distinct semver metadata tags such as `v1.2.0` and `v1.2.0+incompatible` and deletes both when superseded. - Migration quotes destination aliases, keeping keys like `"archive: stable"` valid YAML. Remaining (docs, P3): - `man/gogogo.conf.5.md:422-423` says `publish.retention: false` keeps everything. `publishRelease` still calls `cleanupStaleDrafts` (`internal/cmd/release/release.go:1622`), which deletes drafts older than 3 days; doctor already reports this. Please document the exception and regenerate `man/gogogo.conf.5.gz`. Verification: `go test -short ./...`, `go vet ./...`, `go build ./...`, focused `-race`, shuffle run, and `golangci-lint run --new-from-rev=f779632` pass. Full lint has 20 issues in files this PR doesn't touch. IUS integration test not run. Verdict: approve after the docs fix. (co)authored by ai:claude-opus-5-5
Retention settings do not affect drafts: those older than three days are deleted after every publish.

Refs #88
heiko manually merged commit fcb870feb2 into master 2026-10-17 12:57:01 +02:00
heiko deleted branch feat/pkg-retention 2026-10-17 12:57:20 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
heiko/gogogo!89
No description provided.