Keep permanently pinned versions out of retention (fixes #141) #143
No reviewers
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
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
qwc-open/asiakirjat!143
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/retention-protects-pins"
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?
Fixes #141. Stacked on #140 — base branch is
feature/version-keep-pattern, so this diff shows only the pin fix. Merge #140 first and this retargets tomaincleanly.The bug
enforceRetentionPolicydecided what to delete from the keep rule and the version's age alone — it never looked atprojects.pinned_version, and nothing else guarded the delete path. A pinned build that aged out and didn't match the keep rule was deleted like any other, leaving the project pinned to a version that no longer existed.The dangling pin didn't even surface as an error:
project.go:102falls through to the newest version when the pinned tag is missing, so readers were quietly moved somewhere else.The fix
A permanent pin now outranks the keep pattern. Pinning permanently is a statement that this is the version people should land on, which is the same claim the keep pattern makes — the two disagreeing is the surprise.
Temporary pins stay unprotected, per your call. That also matches what a temporary pin means:
upload.go:221clears it on the next upload, so it doesn't assert the version is worth keeping long-term — it just says "show this one for now".Tests
Two cases in
internal/handler/version_keep_pattern_test.go: a permanently pinned version surviving retention while a sibling of the same shape expires (so it's the pin doing the work, not the pattern), and a temporarily pinned version expiring like any other.Docs
how-to/version-retention.mdreplaces the warning I wrote in #140 with the new behaviour, andhow-to/pin-versions.mdmentions the exemption under Permanent Pin — that's where someone deciding between pin types will be looking.Assisted by Claude Opus 5.