Skip to content

Reject negative volume transfer flags and fix default help text - #266

Open
vincent0426 wants to merge 1 commit into
basetenlabs:mainfrom
vincent0426:fix/volume-transfer-flags
Open

vincent0426 wants to merge 1 commit into
basetenlabs:mainfrom
vincent0426:fix/volume-transfer-flags

Conversation

@vincent0426

Copy link
Copy Markdown

🚀 What

  • volume push/pull/cat treated negative --file-jobs, --chunk-operations,--max-in-flight-mib as default -> now fail with a usage error.
  • --file-jobs help said defaults is 16. The real default is 256, or --chunk-operations when that is set.

💻 How

volumeConcurrency rejects negative values before the command starts. Zero still means default.

https://github.com/basetenlabs/baseten-go/blob/12644756ba3b66421524e1fcb0dd21d1136f254f/internal/volume/limiter.go#L232-L252

🔬 Testing

Added a test: volume push --file-jobs -1 exits 2 with the new message.

Copilot AI balanced review requested due to automatic review settings November 13, 2026 18:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Regression tests cover only --file-jobs on push, leaving negative-value rejection for --chunk-operations and --max-in-flight-mib and validation wiring into pull/cat untested.

1 open issue
What changed in this PR

This PR makes volume transfer commands reject negative concurrency limits with a usage error, while preserving zero as the default.

Changes:

  • Validate transfer limits before push, pull, and cat begin work.
  • Correct --file-jobs help to describe the default of 256 or the configured --chunk-operations value.
  • Add a regression test for negative --file-jobs, checking the error message and exit code 2.
File Description
internal/​cmd/​command.volume_transfer.go Validate negative limits and propagate usage errors.
internal/​cmd/​command.volume_test.go Test rejection of negative --file-jobs on push.
cmd/​command.volume.go Correct the documented file concurrency default.

Review effort: Balanced

Comment on lines +1956 to +1961
func Test_Volume_Push_RejectsNegativeTransferFlag(t *testing.T) {
h := NewCommandHarness(t)
err := h.Execute("volume", "push", t.TempDir(), "bdn:ns/vol", "--file-jobs", "-1")
h.Require.ErrorContains(err, "--file-jobs must not be negative")
h.Require.Equal(2, h.ExitCode)
}
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.

2 participants