OCPCRT-678: Order release streams by version, not name #820
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.31) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.31 · 79 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.262
Real PR Conversation Timeline
1 item
"Review active on #820"
general
weight: 0.35
hoxhaeris
bradmwilliams
Fixes OCPCRT-678.
Problem
On the release status pages (e.g. https://amd64.ocp.releases.ci.openshift.org/), the "Stable" streams are ordered lexicographically by name rather than by version. Today that puts
4-stableabove5-stable, so as version 5 streams come online they land below the 4.x streams instead of at the top.Root cause
preferredReleases.Lessranks streams by: not-hidden first, then stable/layered first, then descending semver, with the stream name as a tiebreak. The semver step calledsemver.ParseTolerant(a.Release.Config.Name)and discarded the error.blang/semver rejects short versions that carry pre-release metadata, so any dash-named stream fails to parse and silently yields the zero value:
Both operands collapse to
0.0.0, the version comparison ties, and the sort falls through to the name tiebreak — which is ascending lexicographic. The4.x.y-0.nightlystreams parse correctly, which is why only the stable/dev-preview block is visibly wrong.Fix
releaseStreamVersionhelper that falls back to parsing the numeric prefix of the stream name when full semver parsing fails (4-stable→4.0.0), and use it inpreferredReleases.Less.<=to<.sort.InterfacerequiresLessto be a strict ordering;<=returns true for equal elements.The existing rank tiers (hidden last, stable/layered first) are unchanged. This affects all three handlers that call
sort.Sort(preferredReleases(page.Streams)):httpReleases,httpReleaseStreamTable, andhttpDashboardOverview.Behavior change worth a look
4-dev-preview(layered) now resolves to4.0.0instead of0.0.0, so it ties with4-stableand lands before it on the name tiebreak, where previously it sank to the bottom of the stable/layered block. If dev-preview should stay below the stable streams,StableandLayeredshould be split into separate rank tiers rather than treated as one group — happy to do that here if reviewers prefer.Testing
New table-driven
Test_preferredReleasesinhttp_helper_test.gopins both the stable-only ordering and a mixed stable/layered/nightly/hidden page.go test ./cmd/release-controller-api/...passes.🤖 Generated with Claude Code
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
- Improved release stream ordering for more consistent results.
- Stable and layered streams are prioritized ahead of other streams.
- Hidden streams now appear last.
- Release names with version suffixes, prerelease markers, or build metadata are handled more reliably.
- Streams that cannot be interpreted as versions now follow a predictable fallback order.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->