Skip to content

fix(vanity-gateway): register /info on per-host sub-routers - #789

Merged
priyaselvaganesan merged 1 commit into
mainfrom
fix/vanity-gateway-info-host-routing
Aug 12, 2026
Merged

fix(vanity-gateway): register /info on per-host sub-routers#789
priyaselvaganesan merged 1 commit into
mainfrom
fix/vanity-gateway-info-host-routing

Conversation

@priyaselvaganesan

@priyaselvaganesan priyaselvaganesan commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

TL;DR

Fixes GET /info returning 404 on vanity-gateway when the request carries a Host header matching a configured vanity or OpenAI domain. The hostRouter middleware routes matched-host requests to a per-host sub-router that had no /info route, so the handler on the main chi mux was never reached.

Additional Details

  • Adds r.Get("/info", golibversion.Handler().ServeHTTP) to the per-host sub-routers in registerVanity and registerOpenAI, matching the pattern already used for /health.
  • The root chi mux registration from feat(vanity-gateway): expose GET /info endpoint #709 is unchanged. Requests with no matched host still fall through to it.
  • Root cause of the gap: the test in feat(vanity-gateway): expose GET /info endpoint #709 used an empty GatewayConfig (no hosts registered), so the hostRouter never activated and every request reached the main mux. The fix adds two tests that build the mux with a vanity host and an OpenAI host configured and send requests with matching Host headers.

Testing

Confirmed 404 in staging before this fix:

$ curl https://stg.integrate.api.nvidia.com/info
404 page not found

New tests pass:

$ go test ./gateway/... -run TestBuildChiMux_Info -v
--- PASS: TestBuildChiMux_Info
--- PASS: TestBuildChiMux_Info_RejectsNonGET
--- PASS: TestBuildChiMux_Info_VanityHost
--- PASS: TestBuildChiMux_Info_OpenAIHost

References

Relates to #315

Summary by CodeRabbit

  • New Features

    • Added an /info endpoint to vanity-domain and OpenAI-specific gateways.
    • The endpoint provides service version information in JSON format.
    • The endpoint is available through configured vanity and OpenAI hosts.
  • Bug Fixes

    • Added coverage to ensure /info requests return successful responses with service metadata.

@priyaselvaganesan
priyaselvaganesan requested a review from a team as a code owner August 12, 2026 16:54
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 1cf3bcdf-791f-46ab-8ad9-dd83ee6dddd3

📥 Commits

Reviewing files that changed from the base of the PR and between 34f566c and 3dcf977.

📒 Files selected for processing (2)
  • src/invocation-plane-services/vanity-gateway/gateway/h2.go
  • src/invocation-plane-services/vanity-gateway/gateway/info_test.go

📝 Walkthrough

Walkthrough

The vanity gateway now serves version information at GET /info for configured vanity and OpenAI hosts. Tests verify successful host-based routing and JSON service metadata.

Changes

Vanity gateway info endpoint

Layer / File(s) Summary
Register host-specific info routes
src/invocation-plane-services/vanity-gateway/gateway/h2.go
The vanity-domain and OpenAI routers expose GET /info through golibversion.Handler().
Validate host-based responses
src/invocation-plane-services/vanity-gateway/gateway/info_test.go
Tests configure both hosts and verify that /info returns HTTP 200 with the expected JSON service metadata.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • NVIDIA/nvcf#661: Adds an unauthenticated GET /info endpoint with shared golibversion metadata in another service.
  • NVIDIA/nvcf#711: Adds and tests a GET /info route using golibversion.Handler().

Suggested reviewers: huaweic-nv

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title uses the required Conventional Commits format and accurately describes the /info routing fix for vanity-gateway.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/vanity-gateway-info-host-routing

Comment @coderabbitai help to get the list of available commands.

The hostRouter middleware routes requests by Host header to per-host
sub-routers before they reach the main chi mux. GET /info was registered
only on the main mux, so requests arriving with a vanity or OpenAI Host
header hit the sub-router (which had no /info route) and returned 404.

Add GET /info to the vanity and OpenAI sub-routers, matching the pattern
already used for GET /health. Add tests that send requests with Host
headers matching registered vanity and OpenAI domains to pin this.

Relates to #315

Signed-off-by: priyaselvaganesan <pselvaganesa@nvidia.com>
@priyaselvaganesan
priyaselvaganesan force-pushed the fix/vanity-gateway-info-host-routing branch from 3dcf977 to 5247811 Compare August 12, 2026 17:00
@priyaselvaganesan priyaselvaganesan self-assigned this Aug 12, 2026
@priyaselvaganesan
priyaselvaganesan added this pull request to the merge queue Aug 12, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 12, 2026
@priyaselvaganesan
priyaselvaganesan added this pull request to the merge queue Aug 12, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 12, 2026
@priyaselvaganesan
priyaselvaganesan added this pull request to the merge queue Aug 12, 2026
Merged via the queue into main with commit b17d641 Aug 12, 2026
18 checks passed
@priyaselvaganesan
priyaselvaganesan deleted the fix/vanity-gateway-info-host-routing branch August 12, 2026 17:53
@balajinvda

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version nvcf-ai-api-gateway-service-v1.32.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants