Skip to content

feat(cli): deploy config banner, eager secrets validation, health-wait beacons - #34

Merged
mhenrixon merged 3 commits into
dashfrom
issue-10-dash-integration
Jul 28, 2026
Merged

mhenrixon merged 3 commits into
dashfrom
issue-10-dash-integration

Conversation

@mhenrixon

Copy link
Copy Markdown
Collaborator

Summary

Implements issue #10 (R1 DX): make deploys explain themselves before, during, and while waiting.

  • Config banner — deploy/redeploy/setup open with the effective topology: service, destination, version, each role with host counts, proxy hosts, timeouts, and on dash the loadbalancer state — including loadbalancer: 1.1.1.1 (auto-enabled: primary role web has 2 hosts), the line that would have made the 2026-07-03 auto-LB surprise visible.
  • Eager secrets validation — new Kamal::Configuration#validate_secrets! resolves every secret the deploy needs (registry credentials, role env secrets, builder secrets, custom SSL PEMs; accessory secrets on setup) right after the banner. A missing secret now fails in seconds with the usual ConfigurationError, instead of minutes later after the image build. Secret adapters (1Password etc.) run at deploy start instead of mid-deploy — same work, earlier.
  • Health-wait progress beacons — the healthcheck Poller prints Container not ready yet, retrying in 2s (3s elapsed, 27s left) on each retry instead of sleeping silently; the proxy deploy path announces its bounded wait (Deploying web on 1.1.1.1 via kamal-proxy (waiting up to 30s for it to become healthy)...) before the blocking kamal-proxy deploy.

Branch structure: issue-10-boot-banner-eager-validation-beacons (rooted off main, upstream-compatible, all three features) merged into this integration branch, plus one dash-only commit adding the loadbalancer banner line.

Closes #10

Test plan

  • bundle exec ruby -Itest test/cli/main_test.rb — banner content/order, fail-fast on missing secrets
  • bundle exec ruby -Itest test/cli/healthcheck/poller_test.rb — beacons
  • Unit suite green (only the pre-existing Apple-Silicon/docker builder failures, identical on clean main)
  • bin/test in CI (deploy-path change)

Deviations & judgment calls

  • Upstream test deploy with missing secrets asserted deploy proceeds when secrets are unresolvable — the exact behavior this issue inverts. Rewrote that test to assert fail-fast (ConfigurationError before any invoke) rather than keeping a contradictory test plus a new duplicate; reused upstream's deploy_with_secrets.yml fixture.
  • The "loadbalancer auto-enabled" banner line requires dash-only code, so it lives in a single dash-side commit on this integration branch; the main-rooted feature branch stays upstream-PR-able.
  • Beacons are implemented in the Poller, where the local retry loop lives. The proxy path's wait happens inside remote kamal-proxy deploy; a true local ticker would need a background thread around a blocking SSHKit execute — descoped to a one-line bounded-wait notice. Full ticker is R2 territory if still wanted.
  • validate_secrets! includes accessory secrets only for setup (boot_accessories: true); deploy/redeploy never touch accessories.
  • Discovery, filed as Loadbalancer auto-activates for a proxy-less primary role #33: the banner exposed that auto-LB activates for a proxy: false primary role (nothing to balance). Not fixed here — behavior change beyond this issue's scope. Because of it, the negative banner test uses a new deploy_with_loadbalancer_false.yml fixture (explicit opt-out) instead of the workers-only fixture.
  • cli_test_case.rb globally stubs load_balancing? false for upstream-inherited tests; the banner tests unstub it locally to exercise the real predicate.

…t beacons

## Summary
Three DX improvements from issue #10 (R1):
- Deploy/redeploy/setup print a config banner (service, destination,
  version, roles with host counts, proxy hosts, timeouts) before any work
- Kamal::Configuration#validate_secrets! resolves every secret the deploy
  needs (registry, role env, builder, custom SSL PEMs; accessories on
  setup) so a missing secret fails in seconds, before build/registry/SSH
- Health-check waits print progress: the Poller emits a beacon per retry
  (elapsed/remaining) and the proxy deploy path announces its bounded wait

## Test Coverage
- test/cli/healthcheck/poller_test.rb: beacons per retry, quiet timeout path
- test/configuration_test.rb: validate_secrets! across registry, env,
  builder, SSL, and accessory scoping
- test/cli/main_test.rb: banner + validation ordering before build;
  missing secrets abort deploy before any invoke (upstream test inverted —
  it previously asserted deploy proceeds with unresolvable secrets)
- test/cli/app_test.rb: bounded-wait notice on the proxy deploy path

## Verification
- [x] bundle exec rubocop --parallel passes
- [x] unit tests pass (only pre-existing host-arch/docker builder failures,
      identical on clean main)

Refs #10
…ue-10-dash-integration

# Conflicts:
#	lib/kamal/cli/app/boot.rb
#	lib/kamal/cli/main.rb
Shows the effective loadbalancer host and whether it was auto-enabled
(primary role with >1 host) — the visibility issue #10 was opened for.
Banner tests unstub the global load_balancing? test stub to exercise the
real predicate; adds a loadbalancer: false fixture for the opt-out path.

Refs #10
@mhenrixon mhenrixon self-assigned this Jul 28, 2026
@mhenrixon
mhenrixon merged commit e1c0d37 into dash Jul 28, 2026
9 checks passed
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.

R1: Boot config banner + eager validation + health-wait progress beacons

1 participant