← Back to Pull requests

ROSAENG-60614 | feat: allow partial component route updates #3403

Closed
unknown closed this pull request without merging on Jul 24, 2026 20:09 UTC
View on GitHub
unknown unknown commented on Jul 20, 2026 21:56 UTC
Author

PR Summary

Allow partial component route updates via rosa edit ingress --component-routes — users can now set a single route (e.g. only console) without providing all routes.

Detailed Description of the Issue

The previous change (openshift/rosa#3376) followed the Classic CLI framework which required all routes to be set together (classic: oauth+console+downloads, HCP: console+downloads). The OCM API supports partial updates — setting only console leaves downloads unchanged — but the CLI rejected partial input with "the expected amount of component routes is N, but M have been supplied". After review feedback, the decision is to allow partial updates to match the API flexibility.

Related Issues and PRs


  • Jira: ROSAENG-60614

  • Related PR: openshift/rosa#3376 (merged — enabled componentRoutes for HCP)

  • Related PR: terraform-redhat/terraform-provider-rhcs#1187 (TF provider — also aligning to partial updates)
  • Type of Change


  • feat - adds a new user-facing capability.
  • Previous Behavior

    rosa edit ingress --component-routes required all routes for the platform — classic required oauth+console+downloads (3), HCP required console+downloads (2). Passing fewer routes returned:

    ERR: the expected amount of component routes is 2, but 1 have been supplied
    

    Behavior After This Change

    Users can pass any subset of valid routes. Name validation and duplicate detection are preserved.

    # Set only console (HCP)
    rosa edit ingress -c mycluster --component-routes 'console: hostname=console.example.com;tlsSecretRef=console-tls' <ingress-id>
    
    # Set only downloads (HCP)
    rosa edit ingress -c mycluster --component-routes 'downloads: hostname=downloads.example.com;tlsSecretRef=downloads-tls' <ingress-id>
    
    # Set both (still works)
    rosa edit ingress -c mycluster --component-routes 'console: hostname=console.example.com;tlsSecretRef=console-tls, downloads: hostname=downloads.example.com;tlsSecretRef=downloads-tls' <ingress-id>
    

    Invalid names and duplicates are still rejected:

    ERR: 'oauth' is not a valid component name. Expected include [console, downloads]
    ERR: component route "console" was supplied more than once
    

    How to Test (Step-by-Step)


    Preconditions


  • A running ROSA HCP cluster with hypershift-component-routes feature toggle enabled

  • HyperShift operator >= v0.1.79

  • TLS secret in openshift-config on the hosted cluster
  • Test Steps


    1. Set only console: rosa edit ingress -c <cluster> --component-routes 'console: hostname=console.example.com;tlsSecretRef=console-tls' <ingress-id>
    2. Verify console route updated, downloads unchanged
    3. Set only downloads: rosa edit ingress -c <cluster> --component-routes 'downloads: hostname=downloads.example.com;tlsSecretRef=downloads-tls' <ingress-id>
    4. Verify downloads route updated, console unchanged
    5. Verify invalid name still rejected: rosa edit ingress -c <cluster> --component-routes 'oauth: hostname=x;tlsSecretRef=y' <ingress-id>
    6. Verify duplicate still rejected: rosa edit ingress -c <cluster> --component-routes 'console: hostname=a;tlsSecretRef=b, console: hostname=c;tlsSecretRef=d' <ingress-id>

    Expected Results


  • Partial updates succeed

  • Invalid names and duplicates still rejected

  • Existing routes not included in the update remain unchanged on the cluster
  • Proof of the Fix

    $ go test ./cmd/edit/ingress/... -v
    Ran 14 of 14 Specs in 0.002 seconds
    SUCCESS! -- 14 Passed | 0 Failed | 0 Pending | 0 Skipped
    

    Live cluster — partial updates and clearing

    1. Set console only:

    $ rosa edit ingress -c creed-hcp --component-routes 'console: hostname=console.custom.example.com;tlsSecretRef=console-tls-secret' o5n4
    INFO: Updated ingress 'o5n4'
    

    API state: {"console": {"hostname": "console.custom.example.com", "tls_secret_ref": "console-tls-secret"}}

    2. Add downloads (console unchanged):

    $ rosa edit ingress -c creed-hcp --component-routes 'downloads: hostname=downloads.custom.example.com;tlsSecretRef=downloads-tls-secret' o5n4
    INFO: Updated ingress 'o5n4'
    

    API state: {"console": {...}, "downloads": {"hostname": "downloads.custom.example.com", "tls_secret_ref": "downloads-tls-secret"}}

    3. Clear downloads only (console unchanged):

    $ rosa edit ingress -c creed-hcp --component-routes 'downloads: hostname=;tlsSecretRef=' o5n4
    INFO: Updated ingress 'o5n4'
    

    API state: {"console": {"hostname": "console.custom.example.com", "tls_secret_ref": "console-tls-secret"}}

    Breaking Changes


  • No breaking changes
  • Developer Verification Checklist


  • Commit subject/title follows [JIRA-TICKET] | [TYPE]: <MESSAGE>.

  • PR description clearly explains both what changed and why.

  • Relevant Jira/GitHub issues and related PRs are linked.

  • make install-hooks has been run in this clone.

  • Tests were added/updated where appropriate.

  • I manually tested the change.

  • make test passes.

  • make lint passes.

  • make rosa passes.

  • Documentation or repo-local agent guidance was added/updated where appropriate.

  • Any risk, limitation, or follow-up work is documented.
  • [ROSAENG-60614]: https://redhat.atlassian.net/browse/ROSAENG-60614?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    Summary by CodeRabbit

    Documentation
    Updated the component-routes CLI flag help text to clarify HCP-supported components and the required hostname + tlsSecretRef pair per route.
    Bug Fixes
    Improved HCP component-route validation to avoid failing solely due to a component count mismatch, while still accepting valid partial configurations.
    Tests
    Expanded ingress component-route parsing tests to confirm correct output when only selected routes are provided and that empty parameter values are serialized as empty strings.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: reedcort Review duration: 5652m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    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
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #3403"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% 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: 52% (MEDIUM) · Higher = larger blast radius
    52%
    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: 60.5% · Lower = rushed or shallow review
    60.5%
    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: 20.5% · Safe to merge
    20.5%
    Repository