Repository navigation
fix(secrets): exit non-zero when the vault rejects a secret - #618
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ibrajer
approved these changes
Oct 15, 2026
Merged
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.
Summary
cre secrets create,update,deleteandlistexited 0 even when the Vault rejected the request. The CLI only printed✗ Secret <op> failed: … error=…, so scripts and CI took the failure for success.Found by the CRE live E2E suite. In a production run, a
secrets createstalled on its allowlist tx and was killed, and the harness's fallbacksecrets updatethen printed✗ Secret update failed: … key does not existbut exited 0. The secret was never stored, and every following workflow execution failed onGetSecret.Change (
cmd/secrets/common/handler.go,ParseVaultGatewayResponse):1 of 1 secret(s) failed to update, so it exits 1.secret list failed: <error>.secrets execute. Gateway POSTs aren't retried, so returning the error has no side effects.Breaking Changes
cre secrets create|update|delete|listnow exit 1 when the Vault rejects any secret in the request, where they used to exit 0. Scripts that ignored these failures will now see them. This is the intended fix.Testing Verification
TestParseVaultGatewayResponse_RejectedSecretsReturnError: a rejected update ("key does not exist"), delete and create each return an error.TestParseVaultGatewayResponse_AllSucceededReturnsNil: an all-success response returns nil.go test ./cmd/... ./internal/...: all pass.go test ./test/ -run 'TestMultiCommandHappyPaths/Secrets': pass (end-to-end create → update → list → delete).golangci-lint run ./...: 0 issues..changeset/secrets-exit-code.md(patch).🤖 Generated with Claude Code