← Back to Pull requests

fix(gatewayapi): honor listener routing type without sectionName #10059

Open
unknown opened this pull request with 460 lines diff across 5 files
View on GitHub
unknown unknown commented on Sep 20, 2026 09:59 UTC
Author

What this PR does / why we need it:

A listener-level BackendTrafficPolicy routingType was ignored for routes whose parentRef omits sectionName, because routing was resolved once per parentRef from its own sectionName. Listeners are now grouped by the routing type they inherit, and the rules are translated once per group: once when every listener inherits the parentRef's own routing, as on main, and twice at most otherwise. Request mirrors follow the listener too. Where a listener's policy changes a route's routing type, the route's inline clusters on that listener get a /routing/service or /routing/endpoint suffix; no existing golden changes.

New golden cases cover HTTP, GRPC, TCP, UDP, TLS, ListenerSet, hostname mismatch, errors from both groups, route-level pins and merged backends.

All commits carry a DCO sign-off. make lint, make go.testdata.complete (no diff) and make go.test.coverage pass. make generate gen-check stops at protos, where Buf's remote plugin call returns permission_denied: 403; the earlier steps leave no diff, and this PR changes no protos.

Known limitation, unchanged from main: if a route has two parentRefs whose listeners resolve different routing types, both still share one cluster name and only the first one's endpoints reach Envoy. That needs a separate fix.

Claude (Anthropic) helped prepare the code, tests and this description.

Which issue(s) this PR fixes:

Fixes #9696

---

PR Checklist

  • Authorship & ownership: Coding agents / AI assistants are welcome, but I have reviewed every change, understand how and why it works, can explain and maintain it, and take full responsibility for this PR. I have not submitted generated output I do not understand.

  • DCO: All commits are signed off (git commit -s). See DCO: Sign your work.

  • API agreed first: If this PR contains API changes (changes under /api), the API was discussed and agreed before the implementation. The API change can be in a separate PR, or in the same PR, but the API must be agreed before implementation. N/A if this PR does not contain API changes. N/A: no API changes.

  • Required checks pass: make generate gen-check, make lint, and the unit-test/coverage build pass. (Flaky e2e failures are not considered breakages, but gen-check, lint, and coverage MUST pass.)

  • Tests added/updated: New/changed code is covered by appropriate tests. N/A if this PR does not contain code changes.

  • Docs: User-facing changes update the docs, either in this PR or a follow-up PR. N/A if this PR does not contain user-facing changes. N/A: no new configuration; the behavior change is described in the release note.

  • Release notes: For any non-trivial change, added a release-note fragment under release-notes/current/<section>/<pr-number>-<slug>.md (see release-notes/current/README.md for sections and naming). N/A if this PR does not contain non-trivial changes.

  • Generated files committed: Ran make gen-check and committed the result if API/helm charts/modules changed. N/A: no API, Helm chart or module changes.

  • Scope & compatibility: The PR is reasonably scoped (no unrelated changes) and preserves backward compatibility, or any breaking change is called out above and documented in release-notes/current/breaking_changes/.

  • Codex review: Requested a Codex review and addressed all of its comments.

  • Copilot review: Requested a Copilot review and addressed all of its comments.
  • Diff: 460 lines (+345 / -115) across 5 files Reviewer: banlor Review duration: 103698m
    All Vouch review confidence checks passed
    Residual risk 0.29 = Change Risk (0.53) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.53 · 460 lines diff across 5 files
    0.53
    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%
    44%
    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.367
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #10059"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 44.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: 52.5% (MEDIUM) · Higher = larger blast radius
    52.5%
    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: 44.7% · Lower = rushed or shallow review
    44.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: 29.1% · Safe to merge
    29.1%