Skip to content

Preserve Gateway route backend and parent identities in detail navigation - #2006

Open
nadaverell wants to merge 2 commits into
mainfrom
feature/relationship-gateway-identities
Open

nadaverell wants to merge 2 commits into
mainfrom
feature/relationship-gateway-identities

Conversation

@nadaverell

@nadaverell nadaverell commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Route detail drawers currently coerce every backend into a core Service and every parent into a Gateway. A custom backend or mesh Service parent therefore opens the wrong resource. Preserve declared kind, API group and namespace, with Gateway API defaults applied only when fields are omitted.

Two small pure converters replace the duplicated reference builders in HTTPRoute, GRPCRoute, TCPRoute and TLSRoute. HTTP RequestMirror targets use the same backend conversion. Parent labels and failure messages say Parent, so a Service parent is not described as a Gateway. The existing discovery/navigation and resource-read authorization paths remain in use.

Scope: declared reference navigation in shared route drawers, including SDK consumers after their normal package update. Clicking a target is not proof that the Route is accepted or that a ReferenceGrant permits traffic. Existing unresolved-reference findings stay visible. Custom backend graph enrollment, network trace/dataplane support and UDPRoute support are separate follow-ups.

Validation: two helper tests and actual DOM click tests for all four route families pass, including custom groups, explicit namespaces, core Service parents and HTTP mirrors. Type checking, full frontend/embed/backend build and the complete shared UI suite pass (4155 tests, one skipped). All 13 actual browser destinations pass against pinned official Gateway API v1.4 CRDs, with zero page errors; one settled capture was inspected. No Gateway controller was installed and no dataplane claim is made. Prior-art kind-aware links informed the baseline; the official Gateway reference contract supplies the defaults.

Declared custom backend, mirror and mesh parent identities


Note

Low Risk
UI-only navigation and labeling in route drawers; no changes to auth, APIs, or cluster mutation paths.

Overview
Route detail drawers no longer force every parent to a Gateway and every backend to a core Service. Shared helpers in gateway-references build ResourceRef values from Gateway API references—keeping declared kind, group, and namespace, with Gateway API defaults only when fields are omitted.

HTTPRoute, GRPCRoute, and TCP/TLS (SimpleRouteRenderer) now use those helpers for parent badges, backend badges, and (on HTTP) RequestMirror targets. Copy is generalized: Parents instead of Parent Gateways, and acceptance errors refer to Parent rather than Gateway.

Unit tests cover the converters; a jsdom test exercises click navigation for all four route kinds, including custom backends and non-Gateway parents.

Reviewed by Cursor Bugbot for commit f5a5fe7. Bugbot is set up for automated code reviews on this repo. Configure here.

@nadaverell
nadaverell requested a review from hisco as a code owner October 7, 2026 04:53
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Preserve Gateway route reference identities in detail navigation

🐞 Bug fix ✨ Enhancement 🧪 Tests 🕐 20-40 Minutes

Grey Divider

AI Description

• Preserve declared kind, API group, and namespace when navigating from route parents and backends.
• Make HTTP RequestMirror targets navigable and describe non-Gateway parents accurately.
• Test reference defaults and click navigation across HTTP, gRPC, TCP, and TLS routes.
Diagram

graph TD
  Routes["Route renderers"] -->|"backends and mirrors"| Backend["Backend converter"] --> Badge["Reference badge"] --> Navigate["Navigation callback"] --> Drawer["Resource drawer"]
  Routes -->|"parents"| Parent["Parent converter"] --> Badge
Loading
High-Level Assessment

Keep the two shared converters: backend and parent references have different API defaults, and the existing badge and navigation path already accepts the resulting ResourceRef. Retaining per-renderer builders would duplicate those rules; a configurable generic converter would make the distinction less clear.

Files changed (6) +101 / -70

Bug fix (4) +60 / -70
GRPCRouteRenderer.tsxNavigate using declared gRPC route reference identities +11/-24

Navigate using declared gRPC route reference identities

• Replaces hard-coded Gateway and Service references with shared parent and backend converters throughout the renderer. Renames the parent label and rejection messages so they do not imply every parent is a Gateway.

packages/k8s-ui/src/components/resources/renderers/GRPCRouteRenderer.tsx

HTTPRouteRenderer.tsxPreserve HTTP route targets and link mirror backends +12/-25

Preserve HTTP route targets and link mirror backends

• Uses shared converters for parent and rule-backend badges, and turns RequestMirror backend names into navigable reference badges. Changes parent labels and rejection messages to apply to non-Gateway parents.

packages/k8s-ui/src/components/resources/renderers/HTTPRouteRenderer.tsx

SimpleRouteRenderer.tsxPreserve TCP and TLS route reference identities +8/-21

Preserve TCP and TLS route reference identities

• Uses the shared converters for parent and backend badges in TCPRoute and TLSRoute details. Rewords parent labels and rejection messages without changing the existing status handling.

packages/k8s-ui/src/components/resources/renderers/SimpleRouteRenderer.tsx

gateway-references.tsCentralize backend and parent reference conversion +29/-0

Centralize backend and parent reference conversion

• Adds pure converters that retain declared identity fields and default omitted fields using the referring Route namespace and the appropriate backend or parent API defaults.

packages/k8s-ui/src/utils/gateway-references.ts

Tests (2) +41 / -0
GatewayRouteReferences.test.tsxTest route reference click destinations +29/-0

Test route reference click destinations

• Renders all four route families and clicks custom backends, default Services, and Service parents to verify the navigation references. Also checks HTTP mirror clicks and parent wording.

packages/k8s-ui/src/components/resources/renderers/GatewayRouteReferences.test.tsx

gateway-references.test.tsTest Gateway reference defaults and explicit identities +12/-0

Test Gateway reference defaults and explicit identities

• Verifies distinct backend and parent defaults, plus preservation of custom kinds, exact API groups, and explicit namespaces.

packages/k8s-ui/src/utils/gateway-references.test.ts

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can route each severity your way: inline, summary, both, or drop

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant