A quieter version list, and a Latest that means something (#157) #161
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!161
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/version-badge-colors"
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?
Closes #157.
Three commits, smallest to largest.
1. Nothing in the version list is red any more
Red meant "PDF" — a file type presented as a verdict — and expiry was red too, so both shouted at the same volume for very different things.
#dc2626#6b7280--color-danger--color-warning(orange)#7c3aed#db2777btn-secondaryThe six badges each carried their own copy of the same six chip properties; those move to the
.version-badgebase class the templates already apply, so a variant only names its colours.Also:
EXPIRES SOON→EXPIRES TODAY. The window has already closed by then; the next hourly pass takes it.NO EXPIRATIONon versions the pattern keeps, instead of leaving the reader to infer it from an absent badge. Shown only where it means something — with retention off nothing expires, so it would otherwise sit on every row of every project.A new test in
internal/templatescross-checks everyversion-badge-*class the templates name against a rule instyle.css. A class name in a template is only half a promise, and an unstyled chip renders fine and passes every handler test.2. A temporary pin protects its version while it is held
#141 exempted permanently pinned versions from retention and reasoned that temporary pins needed no protection, since the next upload clears them anyway. That reads the pin backwards, as you pointed out: a temp pin whose version gets collected while the pin still points at it is a pin that did nothing, and the reader lands somewhere else with no sign anything moved.
Any pin is now exempt for as long as it is held, and the protection ends with the pin rather than outliving it — both upload paths clear a temporary pin before
enforceRetentionPolicyruns, so a version already past its window goes on that same pass.TestTemporaryPinDoesNotSurviveRetentionis replaced by its opposite, plusTestUnpinningReturnsAVersionToRetentionto pin down that the protection really is temporary.3. Latest is the newest release, not the newest tag
The real bug in the issue. A prerelease outsorts every release below it, so a project publishing
v2.0.0-rc1alongsidev1.9.0had the candidate as its latest — on the frontpage card, at/project/{slug}/latest/, in search by default, badged on the project page — right up until retention deleted it for not being a release.The keep pattern is the project's own definition of a real release, so it decides.
latestVersionTagnow resolves, in order:One rule in one place: the project page was computing its own latest inline and could disagree with the permalink it prints two lines above the version list. It calls the shared helper now, and its unused
LatestVersiontemplate key goes with it (onlyEffectiveLatestwas ever rendered).Notes for review
/latest/permalink and search default down to the newest release. That is the point of the issue, but it is worth eyeballing on staging against real projects before it goes near prod.how-to/version-retention.md(new badge table, a new section on what the pattern decides beyond deletion, the pin rule) andhow-to/pin-versions.md.🤖 Written with Claude Code
A prerelease outsorts every release below it, so a project publishing v2.0.0-rc1 alongside v1.9.0 had the candidate as its latest: named on the frontpage card, served at /project/{slug}/latest/, searched by default, badged on the project page. Then retention deleted it, because the keep pattern does not call a candidate a release — and readers silently moved to a version nobody chose for them. The keep pattern is the project's own definition of a real release, so it is the thing that should decide. latestVersionTag now takes it: a pin still wins outright, then the newest tag the pattern matches, then — if the pattern describes none of a project's tags — the sorted newest, because a project with versions must have a latest. One rule, applied in one place. The project page was computing its own latest inline and could disagree with the permalink it prints two lines above the version list; it calls the shared helper now. Its unused "LatestVersion" template key goes with it — only EffectiveLatest was ever rendered. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Marcel M. Otte <marcel.otte@mmo.to>