feat(nats-auth-callout): expose GET /info endpoint - #711
feat(nats-auth-callout): expose GET /info endpoint#711priyaselvaganesan wants to merge 1 commit into
Conversation
Signed-off-by: priyaselvaganesan <pselvaganesa@nvidia.com>
📝 WalkthroughWalkthroughThe NATS auth callout service now exposes a version-backed ChangesNATS auth callout service info endpoint
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant Router
participant golibversion
Client->>Router: Request /info
Router->>golibversion: Serve version metadata
golibversion-->>Router: JSON response or 405 with Allow: GET
Router-->>Client: HTTP response
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/control-plane-services/nats-auth-callout/internal/router/info_test.go (1)
44-50: 🗄️ Data Integrity & Integration | 🔵 Trivial | 🏗️ Heavy liftAssert the stamped metadata values.
The test accepts fallback values such as
"unknown". A missing or miswiredx_defsvalue can therefore pass. This does not verify the service name, semantic version, or full commit SHA returned by/info.Add a stamped test with controlled values or an injectable handler, then assert the exact
service,version, andcommitfields. Keep this test for fallback behavior only if that behavior is also required.🤖 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/control-plane-services/nats-auth-callout/internal/router/info_test.go` around lines 44 - 50, Update the /info test around the response unmarshalling to inject controlled metadata values and assert exact service, version, and commit values instead of only checking non-empty fields. Use the existing handler or configuration injection point visible in the router tests, and retain the fallback assertion only if fallback behavior is separately required.
🤖 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/control-plane-services/nats-auth-callout/go.mod`:
- Line 111: Align the google.golang.org/grpc v1.80.0 requirement with its
replacement: either change the required version to v1.79.3 and document why the
replacement is intentional, or remove the replacement so v1.80.0 is used
directly.
---
Nitpick comments:
In `@src/control-plane-services/nats-auth-callout/internal/router/info_test.go`:
- Around line 44-50: Update the /info test around the response unmarshalling to
inject controlled metadata values and assert exact service, version, and commit
values instead of only checking non-empty fields. Use the existing handler or
configuration injection point visible in the router tests, and retain the
fallback assertion only if fallback behavior is separately required.
🪄 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: 45aa28a4-ea93-435e-a10c-161224c073c5
⛔ Files ignored due to path filters (1)
src/control-plane-services/nats-auth-callout/go.sumis excluded by!**/*.sum
📒 Files selected for processing (5)
src/control-plane-services/nats-auth-callout/cmd/nvcf-nats-auth-callout-service/BUILD.bazelsrc/control-plane-services/nats-auth-callout/go.modsrc/control-plane-services/nats-auth-callout/internal/router/BUILD.bazelsrc/control-plane-services/nats-auth-callout/internal/router/info_test.gosrc/control-plane-services/nats-auth-callout/internal/router/router.go
| golang.org/x/tools v0.44.0 // indirect | ||
| google.golang.org/genproto/googleapis/api v0.0.0-20260401024825-9d38bb4040a9 // indirect | ||
| google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9 // indirect | ||
| google.golang.org/grpc v1.80.0 // indirect |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
cd src/control-plane-services/nats-auth-callout
rg -n 'google\.golang\.org/grpc|^replace ' go.mod
go list -m all | rg '^google\.golang\.org/grpc'Repository: NVIDIA/nvcf
Length of output: 384
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
printf '%s\n' '--- guidance files ---'
find .. -name AGENTS.md -print
printf '%s\n' '--- go.mod context ---'
sed -n '84,125p' src/control-plane-services/nats-auth-callout/go.mod
printf '%s\n' '--- replacement references ---'
rg -n -C 3 'google\.golang\.org/grpc|v1\.79\.3|v1\.80\.0' \
src/control-plane-services/nats-auth-callout \
--glob '!vendor/**' \
--glob '!go.sum'
printf '%s\n' '--- changed-file summary ---'
git diff --stat -- src/control-plane-services/nats-auth-callout/go.mod
git diff -- src/control-plane-services/nats-auth-callout/go.modRepository: NVIDIA/nvcf
Length of output: 5842
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
cat src/control-plane-services/nats-auth-callout/AGENTS.md
printf '%s\n' '--- repository status ---'
git status --short -- src/control-plane-services/nats-auth-callout/go.mod
printf '%s\n' '--- module and toolchain declarations ---'
sed -n '1,35p' src/control-plane-services/nats-auth-callout/go.mod
printf '%s\n' '--- replacement-related history summary ---'
git log -5 --oneline -- src/control-plane-services/nats-auth-callout/go.modRepository: NVIDIA/nvcf
Length of output: 3697
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
printf '%s\n' '--- commits that introduced or changed the replacement ---'
git log --oneline -S 'replace google.golang.org/grpc' -- src/control-plane-services/nats-auth-callout/go.mod
printf '%s\n' '--- dependency-change commit details ---'
for commit in $(git log --format='%H' -S 'replace google.golang.org/grpc' -- src/control-plane-services/nats-auth-callout/go.mod | head -3); do
git show --format=fuller --stat --no-renames "$commit" -- src/control-plane-services/nats-auth-callout/go.mod
git show --format= --no-ext-diff --unified=12 "$commit" -- src/control-plane-services/nats-auth-callout/go.mod
doneRepository: NVIDIA/nvcf
Length of output: 6642
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
printf '%s\n' '--- current commit ---'
git log -1 --format='%H%n%s'
printf '%s\n' '--- gRPC changes in the current commit ---'
git show --format= --no-ext-diff --unified=8 HEAD -- \
src/control-plane-services/nats-auth-callout/go.mod |
rg -n -C 8 'google\.golang\.org/grpc|^[-+].*grpc|^[-+]replace ' || trueRepository: NVIDIA/nvcf
Length of output: 3400
Align the gRPC requirement with the replacement.
This change selects google.golang.org/grpc v1.80.0 but still replaces it with v1.79.3. If v1.79.3 is intentional, align the requirement and document the reason. Otherwise, remove the replacement.
🤖 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/control-plane-services/nats-auth-callout/go.mod` at line 111, Align the
google.golang.org/grpc v1.80.0 requirement with its replacement: either change
the required version to v1.79.3 and document why the replacement is intentional,
or remove the replacement so v1.80.0 is used directly.
Why
DGXC Ops and QA need a reliable way to identify the exact build of each deployed NVCF service. This adds a GET /info endpoint to nats-auth-callout returning service name, semver, and commit SHA stamped at build time.
What changed
r.engine.Any("/info", gin.WrapH(golibversion.Handler()))in the existing gin router. The go-lib handler rejects non-GET with 405 and Allow: GET.Additional Details
/info returns:
service, version, and commit are injected via Bazel x_defs at build time. Unknown fallbacks apply for unstamped builds.
Customer Release Notes
Not customer visible.
Plan Summary
Not applicable.
Usage
Not applicable.
Testing
Built a stamped image from the repo root with
bazel build //src/control-plane-services/nats-auth-callout/cmd/nvcf-nats-auth-callout-service:image.tar --stampand verified the binary embeds the expected service name, version, and full commit SHA. Unit tests pass withgo test ./....Notes
This is one of several Phase 1 Go service /info PRs. Pattern follows merged go-lib handler (#270), helm-reval (#275), and grpc-proxy (#610). Each service PR is independent.
References
POR: https://docs.google.com/document/d/1XigTpFIMVfkR-RgwdF7urquq8YxGYDEVamsrJNJwC-U
Issues
Relates to #315
Related Pull Requests
GET /infoendpoint #275 (helm-reval, merged)GET /infoendpoint #591 (ratelimiter, open)Dependencies
Adds go-lib v0.0.0-20260728185909-afca4ec2fb26 (Apache-2.0, same module as this repo). Go MVS pulls otel and related transitive deps forward.
Summary by CodeRabbit
New Features
/infoendpoint that reports the service name, version, and commit information.Bug Fixes
/info, including the correctAllow: GETresponse header.Tests