Skip to content

feat(provision): auto-stage + self-update fduty CLI in side mode (Phase 2)#73

Merged
ysyneu merged 1 commit into
feat/ai-srefrom
feat/fduty-side-provision
Jun 15, 2026
Merged

feat(provision): auto-stage + self-update fduty CLI in side mode (Phase 2)#73
ysyneu merged 1 commit into
feat/ai-srefrom
feat/fduty-side-provision

Conversation

@ysyneu

@ysyneu ysyneu commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

What

Phase 2 of the fduty-provisioning hardening (follow-up to #71 / v0.0.23).

Moves fduty provisioning and the CLI's own fduty update onto a detached background goroutine, fully OFF the runner's startup path ("side mode"):

  • StartFdutyProvisioningAsync()go ensureFdutyCLI(). The runner is usable immediately; fduty resolves a beat later.
  • fdutySelfUpdate() runs fduty update pinned to the bundled-tools dir and to the runner's own mirror (FLASHDUTY_UPDATE_BASE_URL derived from the configured install URL), so private/regional deploys upgrade from where they were provisioned. A runner self-update + re-exec carries the CLI forward "alongside" it on the next boot.
  • Every step is best-effort and non-fatal — a missing CLI only logs an actionable manual-install hint, never blocks startup.
  • Each leg (stage / verify / update) self-bounds its own timeout, so the earlier 3-min wrapper (which only ever parented the self-update's own 90s timeout and never fired) was removed as dead/misleading.

Testing

  • go build / go vet / go test ./cmd/... / gofumpt -l cmd/ — all green.
  • Live mac smoke, serve:
    • stub fduty presentenvd serve starting (boots first), then fduty CLI self-check passed + fduty self-update checked.
    • fduty absent (empty bin dir + scrubbed PATH) → envd serve starting + an Info hint; runner starts regardless (non-fatal).
  • Prior Phase-2 E2E (Mac A/B/C + Linux docker D1/D2) validated the integration.

Notes

  • Target: feat/ai-sre (per repo flow).

Move fduty provisioning AND the CLI's own `fduty update` onto a detached
background goroutine, fully OFF the runner's startup path. The runner is
usable immediately; fduty resolves a beat later and is upgraded in place
when a newer release exists — so a runner self-update + re-exec carries the
CLI forward "alongside" it on the next boot. Every step stays best-effort
and non-fatal: a missing CLI only logs an actionable manual-install hint,
never blocks startup.

- StartFdutyProvisioningAsync(): `go ensureFdutyCLI()` — never on the hot path
- fdutySelfUpdate(): runs `fduty update` pinned to the bundled-tools dir and
  to the runner's own mirror (FLASHDUTY_UPDATE_BASE_URL derived from the
  configured install URL), so private/regional deploys upgrade from where
  they were provisioned; env scrubbed via BashToolEnv with install vars re-added
- each leg (stage / verify / update) self-bounds its own timeout, so no
  overall wrapper is needed
@ysyneu ysyneu merged commit 2bfbbe5 into feat/ai-sre Jun 15, 2026
5 checks passed
@ysyneu ysyneu deleted the feat/fduty-side-provision branch June 15, 2026 10:19
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