fix(cli): honor task secret opt-in - #461
Conversation
Always serialize the includeSecrets choice so the API default cannot override the CLI's false default. Update the client regression test to cover the explicit false query. Fixes NVIDIA#460 Signed-off-by: goingforstudying-ctrl <goingforstudying@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
ChangesTask secret selection
Estimated code review effort: 2 (Simple) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" Comment |
TL;DR
Make
nvcf-cli task gethonor its secret-name opt-in by sendingincludeSecrets=falsewhen the flag is not set.Additional Details
The CLI defaults
--include-secretsto false, butClient.GetTaskpreviouslyomitted the query parameter for that value. The NVCT controllers default an
omitted
includeSecretsparameter to true, so a normaltask getrequestcould include secret names without an opt-in.
This change always serializes the caller's boolean choice. The existing client
test now verifies both
includeSecrets=falseandincludeSecrets=trueat theHTTP request boundary.
The API returns secret names, not secret values. The command and flag surface
are unchanged, so no documentation migration or operator action is needed.
There are no dependency, license, or NOTICE changes.
For the Reviewer
Please review the query construction and the two table-driven cases in
internal/client. This PR does not change the server default or the responseshape.
PR #457 changes
cmd/task.go; this PR deliberately stays in the twointernal/clientfiles to avoid overlap.For QA
QA needed: No.
Local validation:
go test ./internal/client -run '^TestGetTaskWithSecrets$' -count=1go test ./internal/client -count=1go test -race ./internal/client -count=1go vet ./...bazel test --remote_cache= //src/clis/nvcf-cli/internal/client:client_test --test_output=errorsbazel test --remote_cache= --nocache_test_results //src/clis/nvcf-cli/... --test_output=errors(20/20 test targets passed)bazel build --remote_cache= //src/clis/nvcf-cli:nvcf-cligit diff --checkIssues
Fixes #460
Checklist
Summary by CodeRabbit