Skip to content

feat(vanity-gateway): expose GET /info endpoint - #709

Merged
priyaselvaganesan merged 2 commits into
mainfrom
feat/version-endpoint-vanity-gateway
Aug 7, 2026
Merged

feat(vanity-gateway): expose GET /info endpoint#709
priyaselvaganesan merged 2 commits into
mainfrom
feat/version-endpoint-vanity-gateway

Conversation

@priyaselvaganesan

@priyaselvaganesan priyaselvaganesan commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

TL;DR

Adds GET /info to the vanity-gateway chi router (port 10081), serving service name, version, and commit SHA via the shared go-lib handler. The endpoint runs inside the existing serverTelemetry middleware group so it is metered, traced, and logged like all proxied traffic.

Additional Details

  • Registers golibversion.Handler() at GET /info via r.With(serverTelemetry).Get(...). Non-GET returns 405 (Allow: GET).
  • Service, Version, and GitHash x_defs are injected at build time (--stamp). GitHash uses {STABLE_GIT_COMMIT_FULL} so commit is the full 40-char SHA.
  • go.mod pins the merged go-lib (feat(go-lib/version): add Handler and HandlerFor http.Handler #270). Go MVS bumps otel core to v1.44 and grpc to v1.79.3 (both required by go-lib).
  • /info is on the same port as proxied traffic (10081), so it is externally reachable when the addon is enabled.

Testing

Built with Bazel, imported into ncp-local k3d, enabled the vanityGateway addon via helmfile, and verified via port-forward:

$ curl http://localhost:10081/info
{"service":"nvcf-ai-api-gateway-service","version":"mr-fdb8cff1","commit":"fdb8cff125dfc68ea603dd52a13bdf2fcafb0ed0"}

$ curl -X POST http://localhost:10081/info  ->  405 Method Not Allowed (Allow: GET)

References

Relates to #315

Summary by CodeRabbit

  • New Features

    • Added a GET /info endpoint that reports the service name, version, and commit identifier.
    • Added build metadata so deployed services can expose accurate release information.
  • Bug Fixes

    • Restricted the information endpoint to GET requests and return appropriate method-not-allowed responses for other methods.
  • Tests

    • Added coverage verifying successful responses, metadata fields, supported methods, and response behavior.

@coderabbitai

coderabbitai Bot commented Aug 6, 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: c8acc66a-b064-4845-95a4-4585c2ce7304

📥 Commits

Reviewing files that changed from the base of the PR and between 65d61b7 and 73bb0b4.

⛔ Files ignored due to path filters (1)
  • src/invocation-plane-services/vanity-gateway/go.sum is excluded by !**/*.sum
📒 Files selected for processing (5)
  • src/invocation-plane-services/vanity-gateway/BUILD.bazel
  • src/invocation-plane-services/vanity-gateway/gateway/BUILD.bazel
  • src/invocation-plane-services/vanity-gateway/gateway/h2.go
  • src/invocation-plane-services/vanity-gateway/gateway/info_test.go
  • src/invocation-plane-services/vanity-gateway/go.mod
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/invocation-plane-services/vanity-gateway/BUILD.bazel
  • src/invocation-plane-services/vanity-gateway/gateway/BUILD.bazel
  • src/invocation-plane-services/vanity-gateway/gateway/h2.go
  • src/invocation-plane-services/vanity-gateway/gateway/info_test.go
  • src/invocation-plane-services/vanity-gateway/go.mod

📝 Walkthrough

Walkthrough

The vanity gateway embeds service, version, and Git commit metadata and exposes it through a telemetry-wrapped GET /info endpoint. Tests verify JSON responses and reject non-GET methods.

Changes

Gateway version information

Layer / File(s) Summary
Build metadata and dependency wiring
src/invocation-plane-services/vanity-gateway/BUILD.bazel, src/invocation-plane-services/vanity-gateway/gateway/BUILD.bazel, src/invocation-plane-services/vanity-gateway/go.mod
The build embeds service, version, and commit values. The gateway adds the shared version library and updates module dependencies.
Version information route
src/invocation-plane-services/vanity-gateway/gateway/h2.go
The main router registers a telemetry-wrapped GET /info route using golibversion.Handler().
Endpoint validation
src/invocation-plane-services/vanity-gateway/gateway/info_test.go, src/invocation-plane-services/vanity-gateway/gateway/BUILD.bazel
Tests verify populated JSON metadata for GET /info and 405 Method Not Allowed responses for non-GET methods.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant GatewayRouter
  participant TelemetryMiddleware
  participant GolibversionHandler
  Client->>GatewayRouter: GET /info
  GatewayRouter->>TelemetryMiddleware: wrap request
  TelemetryMiddleware->>GolibversionHandler: serve version metadata
  GolibversionHandler-->>Client: JSON service, version, and commit
Loading

Possibly related PRs

  • NVIDIA/nvcf#591: Adds a shared version-library-backed /info endpoint with build metadata and tests in another service.

Suggested reviewers: balajinvda, sanjay-saxena

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title follows Conventional Commits and accurately describes the primary feature: exposing the vanity-gateway GET /info endpoint.
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.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/version-endpoint-vanity-gateway

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/invocation-plane-services/vanity-gateway/gateway/info_test.go (1)

50-68: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Strengthen the /info metadata assertion.

The test checks only that the fields exist and are non-empty. It will pass if service, version, and commit are swapped or incorrect. Use deterministic test metadata and compare the complete response map. Restore package-level test state with t.Cleanup.

The shared handler test in src/libraries/go/lib/pkg/version/handler_test.go (Lines 105-129) demonstrates exact-value assertions. Keep a separate stamped Bazel build check for the x_defs values.

As per coding guidelines, code changes must include tests, and the PR objective requires the complete service metadata contract.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/invocation-plane-services/vanity-gateway/gateway/info_test.go` around
lines 50 - 68, Strengthen TestBuildChiMux_Info by setting deterministic
package-level metadata before serving the request, registering t.Cleanup to
restore the original state, and asserting the complete decoded response map with
exact service, version, and commit values. Follow the exact-value pattern from
the shared handler test while preserving a separate stamped Bazel check for
x_defs-provided values.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/invocation-plane-services/vanity-gateway/gateway/info_test.go`:
- Around line 50-68: Strengthen TestBuildChiMux_Info by setting deterministic
package-level metadata before serving the request, registering t.Cleanup to
restore the original state, and asserting the complete decoded response map with
exact service, version, and commit values. Follow the exact-value pattern from
the shared handler test while preserving a separate stamped Bazel check for
x_defs-provided values.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 5cb74730-24f6-4184-9bed-2a32f38a6145

📥 Commits

Reviewing files that changed from the base of the PR and between 6bb0cde and 2ae6d17.

⛔ Files ignored due to path filters (1)
  • src/invocation-plane-services/vanity-gateway/go.sum is excluded by !**/*.sum
📒 Files selected for processing (5)
  • src/invocation-plane-services/vanity-gateway/BUILD.bazel
  • src/invocation-plane-services/vanity-gateway/gateway/BUILD.bazel
  • src/invocation-plane-services/vanity-gateway/gateway/h2.go
  • src/invocation-plane-services/vanity-gateway/gateway/info_test.go
  • src/invocation-plane-services/vanity-gateway/go.mod

Signed-off-by: priyaselvaganesan <pselvaganesa@nvidia.com>
…ssertions

Signed-off-by: priyaselvaganesan <pselvaganesa@nvidia.com>
@priyaselvaganesan
priyaselvaganesan force-pushed the feat/version-endpoint-vanity-gateway branch from fdb8cff to 73bb0b4 Compare August 7, 2026 18:54
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@priyaselvaganesan
priyaselvaganesan added this pull request to the merge queue Aug 7, 2026
Merged via the queue into main with commit c0f9ef8 Aug 7, 2026
18 checks passed
@priyaselvaganesan
priyaselvaganesan deleted the feat/version-endpoint-vanity-gateway branch August 7, 2026 20:39
@balajinvda

Copy link
Copy Markdown
Contributor

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

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