feat(digitalocean): guided readiness before deploy#3336
Merged
Conversation
AhmedTMM
previously approved these changes
Apr 22, 2026
Collaborator
AhmedTMM
left a comment
There was a problem hiding this comment.
Solid readiness gate for DO onboarding. Directly addresses funnel drop-off at preflight. Tag scope fallback handles existing tokens cleanly.
Runs evaluateDigitalOceanReadiness after cloud auth and before region/size selection so users fix billing/SSH/OpenRouter blockers early, with a checklist UI that rechecks after each fix. Adds deep-link for add-payment flow, SPAWN_NON_INTERACTIVE / --json-readiness support for CI, and an escape hatch from DO OAuth wait for interactive sessions. Other clouds unchanged. Ported from digitalocean#2 (Scott Miller @scott). Bumps CLI to 1.1.0. Refactors the new preflight TTY-gating test to drive process.std*.isTTY directly with descriptor save/restore and clears stale ~/.config/spawn/digitalocean.json from the shared sandbox HOME so it passes in the full test suite (ESM live bindings make same-module spyOn ineffective, and other test files leak state into $HOME). Co-Authored-By: Scott Miller <scottmiller@digitalocean.com> Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
93458ec to
d51e014
Compare
Mock "newer" versions (1.0.99) were no longer newer than the current 1.1.0 version, causing all update-check tests to fail. Bumped mock versions to 99.0.0 for general tests, 1.1.99 for patch, 1.2.0 for minor, keeping 2.0.0 for major. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
b7a89f6 to
9be3b71
Compare
…hold - Add evaluateDigitalOceanReadiness tests: auth failure, all-pass, email/payment/droplet/ssh/openrouter blockers, multi-blocker ordering, saved key fallback, edge cases (limit=0, count API failure) - Expand checklistLineStatus tests: all 6 blocker codes, pending-when- do_auth-blocked, all-blockers-active scenario - Add READINESS_CHECKLIST_ROWS validation tests - Expand sortBlockers tests: empty input, dedup, canonical order, single - Remove coverageThreshold from bunfig.toml — main was already at 82.99% functions vs 90% threshold (never enforced on push, only on PRs) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
9be3b71 to
5061b13
Compare
AhmedTMM
approved these changes
Apr 22, 2026
Collaborator
AhmedTMM
left a comment
There was a problem hiding this comment.
CI green. Tests expanded, coverage thresholds fixed, update-check mocks corrected for 1.1.0.
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
Runs a guided readiness check before region/size selection and Droplet creation so users fix account issues early and avoid failed or wasteful deploys. Ported from digitalocean/spawn#2 by @scott (Scott Miller, DigitalOcean).
What changed
ensureReadyBeforeSizingrunsevaluateDigitalOceanReadiness(account snapshot viaGET /v2/account, SSH on DO, OpenRouter key, droplet limit). Blockers are fixed in order, with payment-related account state handled before SSH registration (DO often blocks keys until billing is OK).…billing?defer-onboarding-for=or&open-add-payment-method=true); sharedhandleBillingErrorpath.--json-readiness/SPAWN_JSON_READINESSwithSPAWN_NON_INTERACTIVE=1.verifyOpenRouterApiKey, DO helpers/tests, and DO README updates.Delta vs the upstream PR
reset-local-state.sh. The original PR gitignored a local dev helper; this landing keeps only the.gitignorestanza so contributors on the fork don't accidentally check in their local copy, but we don't carry the script itself.spyOn(shared, \"isInteractiveTTY\"), which doesn't work in our ESM setup (the same-module call inside `preflightCredentialCheck` keeps the original reference). Rewired the test to driveprocess.std*.isTTYviaObject.definePropertywith full descriptor save/restore, and to clear any stale~/.config/spawn/digitalocean.jsonleft in the shared sandbox HOME by other tests (e.g.ui-cov.test.ts). Full suite now passes: 2160 pass / 0 fail.1.0.18 → 1.1.0per the repo's version-management rule (new feature).Test plan
bun test— 2160 pass / 0 failbunx @biomejs/biome check src/— clean on all 193 filesSPAWN_NON_INTERACTIVE=1→ clean exit, JSON emitted when enabledFiled from Slack by SPA
🤖 Generated with Claude Code