Skip to content

fix(cli): honor task secret opt-in - #461

Open
goingforstudying-ctrl wants to merge 1 commit into
NVIDIA:mainfrom
goingforstudying-ctrl:goingforstudying-ctrl/fix/task-secret-opt-in
Open

fix(cli): honor task secret opt-in#461
goingforstudying-ctrl wants to merge 1 commit into
NVIDIA:mainfrom
goingforstudying-ctrl:goingforstudying-ctrl/fix/task-secret-opt-in

Conversation

@goingforstudying-ctrl

@goingforstudying-ctrl goingforstudying-ctrl commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

TL;DR

Make nvcf-cli task get honor its secret-name opt-in by sending
includeSecrets=false when the flag is not set.

Additional Details

The CLI defaults --include-secrets to false, but Client.GetTask previously
omitted the query parameter for that value. The NVCT controllers default an
omitted includeSecrets parameter to true, so a normal task get request
could include secret names without an opt-in.

This change always serializes the caller's boolean choice. The existing client
test now verifies both includeSecrets=false and includeSecrets=true at the
HTTP 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 response
shape.

PR #457 changes cmd/task.go; this PR deliberately stays in the two
internal/client files to avoid overlap.

For QA

QA needed: No.

Local validation:

  • go test ./internal/client -run '^TestGetTaskWithSecrets$' -count=1
  • go test ./internal/client -count=1
  • go test -race ./internal/client -count=1
  • go vet ./...
  • bazel test --remote_cache= //src/clis/nvcf-cli/internal/client:client_test --test_output=errors
  • bazel 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-cli
  • git diff --check

Issues

Fixes #460

Checklist

  • I am familiar with the Contributing Guidelines.
  • I have signed off my commits for Developer Certificate of Origin (DCO) compliance.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

Summary by CodeRabbit

  • Bug Fixes
    • Updated task retrieval requests to explicitly indicate whether secrets should be included.
    • Improved consistency and reliability when fetching tasks without secret information.

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

coderabbitai Bot commented Jul 26, 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: ae868a2f-f56f-4abd-a6c8-6ab7aa6977e9

📥 Commits

Reviewing files that changed from the base of the PR and between 4216c8c and 10ef3e2.

📒 Files selected for processing (2)
  • src/clis/nvcf-cli/internal/client/tasks.go
  • src/clis/nvcf-cli/internal/client/tasks_test.go

📝 Walkthrough

Walkthrough

Client.GetTask now always sends the includeSecrets query parameter with its boolean value. The regression test updates the no-flag case to expect includeSecrets=false.

Changes

Task secret selection

Layer / File(s) Summary
Serialize and test includeSecrets
src/clis/nvcf-cli/internal/client/tasks.go, src/clis/nvcf-cli/internal/client/tasks_test.go
GetTask always includes the boolean query parameter, and the test verifies the explicit false value when secrets are not requested.

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

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The Conventional Commits title matches the bug fix and accurately describes the main change.
Linked Issues check ✅ Passed The changes satisfy issue #460 by always serializing includeSecrets and adding regression coverage for both values.
Out of Scope Changes check ✅ Passed The PR stays focused on the task secret query parameter behavior and its tests, with no unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 @coderabbitai help to get the list of available commands.

@goingforstudying-ctrl
goingforstudying-ctrl marked this pull request as ready for review July 26, 2026 05:18
@goingforstudying-ctrl
goingforstudying-ctrl requested a review from a team as a code owner July 26, 2026 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nvcf-cli task get includes secret names without opt-in

1 participant