Skip to content

feat(llm-api-gateway): expose GET /info endpoint - #710

Merged
priyaselvaganesan merged 6 commits into
mainfrom
feat/version-endpoint-llm-api-gateway
Aug 7, 2026
Merged

feat(llm-api-gateway): expose GET /info endpoint#710
priyaselvaganesan merged 6 commits into
mainfrom
feat/version-endpoint-llm-api-gateway

Conversation

@priyaselvaganesan

@priyaselvaganesan priyaselvaganesan commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

TL;DR

Adds GET /info to the llm-api-gateway echo router, serving service name, version, and commit SHA via the shared go-lib handler. The endpoint is registered via echo.WrapHandler(golibversion.Handler()) and runs through echo's existing middleware stack. /info is on the same port (8080) as the proxied traffic, so it is externally reachable via the HTTPRoute at llm.<domain>/info.

Additional Details

  • Service, Version, and GitHash x_defs are injected at build time (--stamp) on the cmd/llm-api-gateway binary. GitHash uses {STABLE_GIT_COMMIT_FULL} so commit is the full 40-char SHA. Non-GET returns 405 (Allow: GET), covering all methods registered by e.Any.
  • go.mod pins the merged go-lib (feat(go-lib/version): add Handler and HandlerFor http.Handler #270). Go MVS pulls otel core to v1.44, grpc to v1.79.3, and aligns OTLP exporters from v1.42 to v1.44.

Testing

Built with Bazel, imported into ncp-local k3d, deployed via helmfile, and verified via port-forward:

$ curl http://localhost:8080/info
{"service":"nvcf-llm-api-gateway","version":"mr-c176d879","commit":"c176d879cc2dcf35d3599bdcd99bdac6fa9d321f"}

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

Unit tests pass under both go test and bazel test, covering stamped values, unstamped fallback to "unknown", and 405 on all non-GET methods (HEAD, POST, PUT, PATCH, DELETE, OPTIONS, CONNECT, TRACE).

References

Relates to #315

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

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The gateway adds a version-backed /info endpoint, embeds service and Git metadata at build time, adds endpoint tests, updates Bazel targets, and upgrades Go module dependencies.

Changes

Gateway info endpoint

Layer / File(s) Summary
Version metadata and build wiring
src/invocation-plane-services/llm-api-gateway/api/BUILD.bazel, src/invocation-plane-services/llm-api-gateway/cmd/llm-api-gateway/BUILD.bazel, src/invocation-plane-services/llm-api-gateway/go.mod
The API links the shared version package. The binary embeds the service name, stable version, and full Git commit hash. Go dependencies are updated.
Info route registration
src/invocation-plane-services/llm-api-gateway/api/routes.go
The API registers /info with the shared version handler for all HTTP methods.
Info endpoint validation
src/invocation-plane-services/llm-api-gateway/api/info_test.go, src/invocation-plane-services/llm-api-gateway/api/BUILD.bazel
Tests validate GET responses, fallback metadata, JSON fields, content type, and HTTP 405 responses for non-GET methods. Bazel includes the new test source and version dependency.

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

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant Echo
  participant golibversion
  Client->>Echo: Request /info
  Echo->>golibversion: Invoke Handler()
  golibversion-->>Echo: Return version metadata response
  Echo-->>Client: Return HTTP response
Loading

Possibly related PRs

  • NVIDIA/nvcf#591: Adds a similar version-backed /info endpoint with build metadata and tests.
  • NVIDIA/nvcf#709: Adds the same shared /info endpoint pattern, build metadata, and method-behavior tests.

Suggested reviewers: balajinvda

🚥 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 follows Conventional Commits and accurately describes the new customer-facing GET /info endpoint.
✨ Finishing Touches
📝 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-llm-api-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.

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@src/invocation-plane-services/llm-api-gateway/go.mod`:
- Around line 24-33: Update the stable OpenTelemetry exporter dependencies in
go.mod from v1.42.0 to v1.44.0, including the OTLP metric, OTLP trace HTTP/gRPC,
stdout trace, and indirect otlptrace modules. Then run go mod tidy to
synchronize go.mod and go.sum.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: e8a760dd-5b51-4f2e-b40f-ebb66e6c9d49

📥 Commits

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

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

Comment thread src/invocation-plane-services/llm-api-gateway/go.mod
…assertions

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

@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.

Actionable comments posted: 1

🧹 Nitpick comments (2)
src/invocation-plane-services/llm-api-gateway/api/info_test.go (2)

81-88: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Verify coverage for every method registered by e.Any.

The table omits http.MethodConnect and http.MethodTrace. If Echo registers those methods for /info, add them to verify the stated all-non-GET contract. Otherwise, document the intentional scope or register only the supported methods.

🤖 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/llm-api-gateway/api/info_test.go` around lines
81 - 88, Add http.MethodConnect and http.MethodTrace to the method table used by
the `/info` coverage test so it verifies every method registered through e.Any
and preserves the all-non-GET contract; if those methods are intentionally
unsupported, restrict the route registration instead and document that scope.

41-43: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Cover the unstamped metadata path.

This test only assigns non-empty values. Add a separate test with empty metadata and assert the documented "unknown" values for service, version, and commit. Verify the fallback literals in golibversion.Handler() before hard-coding the assertions.

🤖 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/llm-api-gateway/api/info_test.go` around lines
41 - 43, Extend the tests around golibversion.Handler() with a separate case
that clears Service, Version, and GitHash, then assert the handler returns the
documented “unknown” fallback for service, version, and commit. Confirm the
fallback literals in Handler() before hard-coding the expected values, while
preserving the existing stamped-metadata test.
🤖 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.

Inline comments:
In `@src/invocation-plane-services/llm-api-gateway/api/info_test.go`:
- Around line 44-48: Update the test cleanup around golibversion.Service,
golibversion.Version, and golibversion.GitHash to capture their original values
before modification, then restore those saved values in t.Cleanup instead of
assigning empty strings.

---

Nitpick comments:
In `@src/invocation-plane-services/llm-api-gateway/api/info_test.go`:
- Around line 81-88: Add http.MethodConnect and http.MethodTrace to the method
table used by the `/info` coverage test so it verifies every method registered
through e.Any and preserves the all-non-GET contract; if those methods are
intentionally unsupported, restrict the route registration instead and document
that scope.
- Around line 41-43: Extend the tests around golibversion.Handler() with a
separate case that clears Service, Version, and GitHash, then assert the handler
returns the documented “unknown” fallback for service, version, and commit.
Confirm the fallback literals in Handler() before hard-coding the expected
values, while preserving the existing stamped-metadata test.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: ef35f50f-231d-4c6c-9378-45867aa73445

📥 Commits

Reviewing files that changed from the base of the PR and between d11e60f and d24ab5f.

📒 Files selected for processing (2)
  • src/invocation-plane-services/llm-api-gateway/api/BUILD.bazel
  • src/invocation-plane-services/llm-api-gateway/api/info_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/invocation-plane-services/llm-api-gateway/api/BUILD.bazel

Comment thread src/invocation-plane-services/llm-api-gateway/api/info_test.go
Signed-off-by: priyaselvaganesan <pselvaganesa@nvidia.com>
…erage

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

@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.

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@src/invocation-plane-services/llm-api-gateway/api/info_test.go`:
- Around line 78-99: Update TestInfoEndpoint_GET_UnstampedFallback to save the
version metadata globals, clear them before calling newInfoEngine(), and restore
them via t.Cleanup. Strengthen the response assertions so service and version
equal "unknown", while keeping commit validation consistent with the handler’s
build-info fallback.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 12adb79e-3eb6-45f6-a614-119a7b63fe5e

📥 Commits

Reviewing files that changed from the base of the PR and between f751a86 and 247f353.

📒 Files selected for processing (1)
  • src/invocation-plane-services/llm-api-gateway/api/info_test.go

Comment thread src/invocation-plane-services/llm-api-gateway/api/info_test.go
Signed-off-by: priyaselvaganesan <pselvaganesa@nvidia.com>
@priyaselvaganesan
priyaselvaganesan force-pushed the feat/version-endpoint-llm-api-gateway branch from c176d87 to 2254e75 Compare August 7, 2026 20:58
@along-2017
along-2017 requested a review from Max-NV August 7, 2026 21:31
Comment thread src/invocation-plane-services/llm-api-gateway/api/routes.go Outdated
…for non-GET methods

Signed-off-by: priyaselvaganesan <pselvaganesa@nvidia.com>
@priyaselvaganesan
priyaselvaganesan force-pushed the feat/version-endpoint-llm-api-gateway branch from 2254e75 to 25c5971 Compare August 7, 2026 22:14
@priyaselvaganesan
priyaselvaganesan added this pull request to the merge queue Aug 7, 2026
@priyaselvaganesan priyaselvaganesan self-assigned this Aug 7, 2026
Merged via the queue into main with commit 9dbf12f Aug 7, 2026
18 checks passed
@priyaselvaganesan
priyaselvaganesan deleted the feat/version-endpoint-llm-api-gateway branch August 7, 2026 22:35
@balajinvda

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version nvcf-llm-api-gateway-v0.12.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.

4 participants