Skip to content

ci: typecheck/test/build + real-cloud e2e deploy - #11

Merged
wmadden merged 3 commits into
mainfrom
claude/cool-villani-cd10a9
Jul 7, 2026
Merged

ci: typecheck/test/build + real-cloud e2e deploy#11
wmadden merged 3 commits into
mainfrom
claude/cool-villani-cd10a9

Conversation

@wmadden-electric

@wmadden-electric wmadden-electric commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Layers DCO enforcement and a real-cloud e2e deploy on top of the CI that #12 introduced, and fills the one gap that CI left: example artifacts (including the storefront's next build) were never built by any job. Rebased onto current main.

Changes

  • .github/workflows/ci.yml — adds a build job to chore(quality): Biome + strict TypeScript scaffolding and CI #12's existing lint / typecheck / test jobs: pnpm install --frozen-lockfileturbo run build → clean-tree check. typecheck/test don't depend on ^build, so nothing else exercised the example builds. Runs with --concurrency=1 (see note below).
  • .github/workflows/dco.yml — enforces a Signed-off-by: trailer on every commit in the PR range (merge commits excluded, standard DCO-bot behavior; this history has GitHub-style merge commits without their own trailer). Echo-stub pass on merge_group.
  • .github/workflows/e2e-deploy.yml — deploys examples/makerkit-hello to real Prisma Cloud, verifies it serves, then destroys it. Push to main, same-repo PRs only (fork PRs excluded — secrets don't exist there), and workflow_dispatch. Own concurrency group, cancel-in-progress: false.
  • examples/makerkit-hello/alchemy.run.ts — stack name is process.env['HELLO_STACK_NAME'] ?? 'makerkit-hello'. lower() derives cloud resource ids from it, so e2e sets hello-ci-${{ github.run_id }} to keep concurrent runs collision-free. Default unchanged.

Reuses #12's ./.github/actions/setup (mise-based node + bun) as-is.

Why / e2e design notes

  • Destroy always runs (if: always()), same job/dir as deploy: alchemy state is runner-local and dies with the runner, so a failed run that skips destroy orphans cloud resources nobody can clean up later. A destroy failure fails the workflow loudly. Skips only when no state dir exists.
  • Scale-to-zero tolerance (PRO-200) — first hit can 502 ~15s, so verify curls with backoff up to ~90s until HTTP 200, then asserts the body contains "ok":1. A second deploy without rebuilding must report to noop (idempotence; string verified against alchemy's CLI source).
  • Deployed URL comes from alchemy's local state (.alchemy/state/**/__stack_output__.json.outputs.url), not deploy stdout.
  • bun — the alchemy CLI runs as bunx --bun alchemy ... (under node it fails on Cannot find package 'bun'), invoked directly rather than via the package's deploy script (which sources ../../.env, absent in CI).
  • Secrets discipline — least-privilege contents: read, no pull_request_target, secrets via env: only, ALCHEMY_PASSWORD generated per run and masked before it touches $GITHUB_ENV.
  • --concurrency=1 on the build job — the storefront is built by two turbo tasks (its own build and the parent storefront-auth's build:compute), which race on the shared .next dir under parallelism and flakily fail from a cold cache. Serializing sidesteps it; the underlying duplicate-build is a separate follow-up.

Setup required before the first e2e run

In Settings → Secrets and variables → Actions:

  • Secret PRISMA_SERVICE_TOKEN — a Prisma Console service token (a real credential).
  • Variable PRISMA_WORKSPACE_ID — the target workspace id (an identifier, not a credential, so it's a repo variable, read via vars.*).

The e2e workflow fails until both exist; ci.yml and dco.yml don't depend on them.

🤖 Generated with Claude Code

wmadden-electric and others added 3 commits July 7, 2026 20:13
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…le build

The workspace id is an identifier, not a credential, so e2e-deploy reads it
from vars.* rather than secrets.*. Also serialize the CI build job: the
storefront is built by two turbo tasks that race on .next under parallelism.

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@wmadden-electric
wmadden-electric force-pushed the claude/cool-villani-cd10a9 branch from 327d0f8 to 47535c5 Compare July 7, 2026 18:19
@wmadden
wmadden merged commit 8e0e3c5 into main Jul 7, 2026
6 checks passed
wmadden pushed a commit that referenced this pull request Jul 22, 2026
… requires

The deploy path runs the alchemy CLI, whose command tree imports the
Cloudflare provider namespace and platform services at load time —
requiring @effect/platform-node and @effect/platform-bun. alchemy
declares both as optional peerDependencies, so a package-manager install
of an app depending only on @prisma/composer-prisma-cloud never installs
them, and prisma-composer deploy dies before planning anything:

  Cannot find module "@effect/platform-node/NodeServices" from
  ".../node_modules/alchemy/src/Cloudflare/Workers/WorkerBridge.ts"

(then the @effect/platform-bun/BunRuntime twin from Util/PlatformServices).
This workspace never sees the failure because pnpm resolves the optional
peers into its own tree, and any app developed inside a checkout inherits
them through parent-directory module resolution — only a standalone
install hits it, which is exactly the consumer this package is for.
Surfaced by the open-chat port (its FRICTION.md #11), which had to declare
both packages as app devDependencies to deploy at all.

Declaring them as real dependencies here puts the knowledge where it
belongs: this package pins alchemy exactly and always drives its CLI, so
alchemy's "optional" peers are, for every consumer of this package,
mandatory. Versions are the ones the workspace already resolves.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
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.

2 participants