fix(deploy): preflight CF Workers deploys — fail fast on missing forgejo repo / cloudflare integration #26

Merged
gmackie merged 1 commit from fix/deploy-preflight into main 2026-06-26 05:07:06 +00:00
Owner

Part 1 of fixing deploy confusion (linear-clone repro). Deploys were accepted and recorded as pending even when prerequisites were missing, then failed opaquely later in the agent — users saw nothing or a cryptic async failure.

Adds a preflight for cloudflare-workers deploys in POST /api/fg/deploy that returns 422 with actionable guidance when:

  • the app has no Forgejo repository (the keystone invariant — every ForgeGraph app needs one; CI/deploys build from it), or
  • there is no Cloudflare integration, or it is missing the API token / accountId.

The messages point at the exact fix (forge repo create, forge creds set cloudflare ...). Logic is a pure, unit-tested function (lib/deploy-preflight.ts, 6 tests).

Follow-ups (same investigation): monorepo working-dir support in the agent CF deploy, forge setup CF Workers scaffolding (+ ensure-forgejo-repo), and cleaning up linear-clone.

api + web typecheck; preflight tests pass.

🤖 Generated with Claude Code

Part 1 of fixing deploy confusion (linear-clone repro). Deploys were accepted and recorded as `pending` even when prerequisites were missing, then failed opaquely later in the agent — users saw nothing or a cryptic async failure. Adds a preflight for `cloudflare-workers` deploys in `POST /api/fg/deploy` that returns **422 with actionable guidance** when: - the app has **no Forgejo repository** (the keystone invariant — every ForgeGraph app needs one; CI/deploys build from it), or - there is **no Cloudflare integration**, or it is **missing the API token / accountId**. The messages point at the exact fix (`forge repo create`, `forge creds set cloudflare ...`). Logic is a pure, unit-tested function (`lib/deploy-preflight.ts`, 6 tests). Follow-ups (same investigation): monorepo working-dir support in the agent CF deploy, `forge setup` CF Workers scaffolding (+ ensure-forgejo-repo), and cleaning up linear-clone. api + web typecheck; preflight tests pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(deploy): preflight CF Workers deploys (forgejo repo + cloudflare integration)
Some checks failed
AI Code Review / review (pull_request) Failing after 8s
CI / ci (pull_request) Successful in 18m4s
158cbfb3cc
Deploys were accepted and recorded as pending even when prerequisites were
missing, then failed opaquely later in the agent. Validate up front: every app
must have a Forgejo repository (keystone invariant) and a configured Cloudflare
integration; return 422 with actionable guidance instead.
Sign in to join this conversation.
No description provided.