Skip to content

Warn after fly secrets push when staged secrets are not live on running machines - #20

Merged
ReganBell merged 1 commit into
mainfrom
fix/fly-secrets-staged-clarity
Jul 30, 2026
Merged

Warn after fly secrets push when staged secrets are not live on running machines#20
ReganBell merged 1 commit into
mainfrom
fix/fly-secrets-staged-clarity

Conversation

@ReganBell

@ReganBell ReganBell commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Why

In a real deployment, an operator ran qm secrets push and then restarted the Fly machines expecting the new secrets to take effect. On Fly, secrets set --stage only stages values — they are applied by the next deploy/machine update, not by flyctl machine restart. The result was the auth service running with no SMTP credentials at all until a full qm up was run. The command's existing output mentioned staging, but not strongly or actionably enough to prevent the mistake.

What

  • flySecretsPush now tracks every app that received staged secrets and checks each for running machines (fly status --json). If any have machines, the command ends with an explicit warning:
    • staged secrets are NOT live yet on <apps>: running machines keep their old values
    • run \qm up` to apply them — a plain machine restart does not`
  • Fresh installs (no machines yet) see no warning, so first-time setup output stays clean.
  • No new flags or behavior changes — staging semantics are untouched; this only closes the messaging gap at the single layer all Fly secret pushes flow through.

Tests

  • New test: warning is printed when a staged app has running machines.
  • New test: no warning when no machines are running.
  • cli suite (node --test test/fly-sandbox.test.ts): 33/33 pass. npm run typecheck and eslint clean.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

…ng machines

In a real deployment an operator ran qm secrets push, then restarted the
Fly machines expecting the new secrets to apply. Fly staged secrets are
only applied by a deploy or machine update, not a restart, so the auth
service ran without SMTP credentials until a full qm up. The existing
staging output did not make this failure mode obvious.

flySecretsPush now checks each app that received staged secrets and, when
any of them has running machines, ends with an explicit warning that the
staged secrets are not live and that qm up (not a machine restart) applies
them. Fresh installs with no machines see no warning.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ReganBell
ReganBell merged commit 771e660 into main Jul 30, 2026
15 checks passed
@ReganBell
ReganBell deleted the fix/fly-secrets-staged-clarity branch July 30, 2026 00:23
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