feat: support bulk KEY=VALUE pairs for secrets and variables#471
Merged
lukevmorris merged 1 commit intomainfrom Mar 27, 2026
Merged
feat: support bulk KEY=VALUE pairs for secrets and variables#471lukevmorris merged 1 commit intomainfrom
lukevmorris merged 1 commit intomainfrom
Conversation
β¦ands Add bulk mode to 'depot ci secrets add' and 'depot ci vars add' that accepts multiple KEY=VALUE arguments and uses the batch gRPC endpoints. The existing single-secret syntax with --value flag is preserved for backward compatibility.
Comment on lines
+129
to
+133
| parts := strings.SplitN(arg, "=", 2) | ||
| if len(parts) != 2 || parts[0] == "" { | ||
| return fmt.Errorf("invalid argument %q β expected KEY=VALUE format", arg) | ||
| } | ||
| secrets = append(secrets, &civ2.SecretInput{Name: parts[0], Value: parts[1]}) |
Contributor
There was a problem hiding this comment.
Validation allows empty secret values. The check len(parts) != 2 || parts[0] == "" only validates the key is non-empty, but parts[1] (the value) can be empty. A user entering FOO= would create a secret with an empty value, potentially causing production failures.
parts := strings.SplitN(arg, "=", 2)
if len(parts) != 2 || parts[0] == "" || parts[1] == "" {
return fmt.Errorf("invalid argument %q β expected KEY=VALUE format with non-empty key and value", arg)
}
Suggested change
| parts := strings.SplitN(arg, "=", 2) | |
| if len(parts) != 2 || parts[0] == "" { | |
| return fmt.Errorf("invalid argument %q β expected KEY=VALUE format", arg) | |
| } | |
| secrets = append(secrets, &civ2.SecretInput{Name: parts[0], Value: parts[1]}) | |
| parts := strings.SplitN(arg, "=", 2) | |
| if len(parts) != 2 || parts[0] == "" || parts[1] == "" { | |
| return fmt.Errorf("invalid argument %q β expected KEY=VALUE format with non-empty key and value", arg) | |
| } | |
| secrets = append(secrets, &civ2.SecretInput{Name: parts[0], Value: parts[1]}) | |
Spotted by Graphite
Is this helpful? React π or π to let us know.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Medium Risk
Adds new batch-write RPC usage and new CLI argument parsing paths for secret/variable creation; mistakes could create unintended org/repo-scoped values or reject valid input.
Overview
Adds batch APIs (
CIBatchAddSecrets,CIBatchAddVariables) to create multiple CI secrets/variables in a single org- or repo-scoped request.Updates
depot ci secrets addanddepot ci vars addto accept multipleKEY=VALUEarguments, validate incompatible flags (--value/--description), and route to the new batch endpoints while preserving the existing single-item interactive/flag flows.Written by Cursor Bugbot for commit ae1213d. This will update automatically on new commits. Configure here.