Skip to content

fix(secrets): wads-secrets add shouldn't short-circuit on an existing declaration#50

Merged
thorwhalen merged 1 commit into
masterfrom
fix/wads-secrets-add-no-short-circuit
Jun 2, 2026
Merged

fix(secrets): wads-secrets add shouldn't short-circuit on an existing declaration#50
thorwhalen merged 1 commit into
masterfrom
fix/wads-secrets-add-no-short-circuit

Conversation

@thorwhalen

Copy link
Copy Markdown
Member

Problem

wads-secrets add VAR configures three independent layers:

  1. pyproject [tool.wads.ci.env] declaration
  2. ci.yml transport (passing the secret to the reusable workflow)
  3. the GitHub secret value (gh secret set)

When the var was already declared in pyproject, add printed "already configured … nothing to add" and returned early, skipping layers 2 and 3. So a half-configured secret (declared but not passed in ci.yml, or value never set on GitHub) could never be completed by re-running the command — which is exactly what you'd expect to fix it.

Hit in practice on thorwhalen/aix: OPENAI_API_KEY was already declared, so wads-secrets add refused to set the GitHub secret value, and it had to be set by hand.

Fix

Report the existing pyproject declaration and continue to the transport + GitHub layers (each already idempotent). Also warn when the existing bucket differs from the requested --kind.

Tests

  • test_add_does_not_short_circuit_when_already_declared — pre-declared var still gets the ci.yml transport.
  • test_add_is_idempotent_when_fully_configured — running twice is a clean no-op.

All 8 test_secrets_cli.py tests pass.

`wads-secrets add` configures three independent layers: the pyproject
declaration, the ci.yml transport, and the GitHub secret value. When the env
var was already declared in [tool.wads.ci.env], `add` returned early with
'nothing to add' — skipping BOTH the transport edit and the gh secret set. A
half-configured secret (declared but not passed in ci.yml, or value not set on
GitHub) could therefore never be completed by re-running the command.

Report the existing pyproject declaration and continue to the transport + GitHub
layers (each already idempotent). Add regression tests covering the
pre-declared-but-not-transported case and full idempotency.
@thorwhalen thorwhalen merged commit c9cc531 into master Jun 2, 2026
12 checks passed
@thorwhalen thorwhalen deleted the fix/wads-secrets-add-no-short-circuit branch June 2, 2026 16:24
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.

1 participant