← Back to Pull requests

OCPCRT-678: Order release streams by version, not name #820

Merged
bradmwilliams merged 2 files (79 lines) on Sep 21, 2026 21:54 UTC
View on GitHub
bradmwilliams bradmwilliams commented on Sep 21, 2026 21:04 UTC
Author

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-stable above 5-stable, so as version 5 streams come online they land below the 4.x streams instead of at the top.

Root cause

preferredReleases.Less ranks streams by: not-hidden first, then stable/layered first, then descending semver, with the stream name as a tiebreak. The semver step called semver.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:

4-stable         -> 0.0.0  err=Short version cannot contain PreRelease/Build meta data
5-stable         -> 0.0.0  err=Short version cannot contain PreRelease/Build meta data
4-dev-preview    -> 0.0.0  err=Short version cannot contain PreRelease/Build meta data
4.21.0-0.nightly -> 4.21.0-0.nightly  err=<nil>

Both operands collapse to 0.0.0, the version comparison ties, and the sort falls through to the name tiebreak — which is ascending lexicographic. The 4.x.y-0.nightly streams parse correctly, which is why only the stable/dev-preview block is visibly wrong.

Fix

  • Add a releaseStreamVersion helper 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 in preferredReleases.Less.

  • Tighten the name tiebreak from <= to <. sort.Interface requires Less to 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, and httpDashboardOverview.

    Behavior change worth a look

    4-dev-preview (layered) now resolves to 4.0.0 instead of 0.0.0, so it ties with 4-stable and 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, Stable and Layered should 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_preferredReleases in http_helper_test.go pins 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

  • Bug Fixes

  • - 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 -->

    Diff: 79 lines (+74 / -5) across 2 files Reviewer: hoxhaeris Review duration: 50m
    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
    0.31
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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
    Reviewers
    Assignees
    bradmwilliams bradmwilliams
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 30.7% (LOW) · Higher = larger blast radius
    30.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 16.4% · Safe to merge
    16.4%