From 57d833a4303af3ae05caab9fcfb6962120adc764 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 29 Oct 2026 09:47:16 +0000 Subject: [PATCH] fix(ci): the on-demand deploy deploys A workflow_dispatch of CI (component, environment) planned the named component, but no component's profileRules named github-dispatch, so each stage and prod subscription fell back to its default profile: verify for Workers (build, typecheck, wrangler --dry-run) and plan-only for Terraform. The dispatch went green and deployed nothing. Every subscription that deploys or applies on github-push-main now does the same on github-dispatch: 42 rules across 21 components. Pull requests keep their verify and plan-only profiles. Checked with orun plan on simulated events: a dispatch of cms to stage plans the 13-step deploy (wire-live, deploy, secrets-live, smoke), supabase to prod plans Apply, and a pull request still plans the dry run and the plan. The intent's dispatch comment and the CMS runbook and operations guide say so (the setup token reaches the Worker by a dispatch of cms). Orun-Task: DSP-1 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013JuHbkZCjDrGgHdzCrCRqG --- ai/context/operations.md | 2 +- apps/admin-worker/component.yaml | 6 ++++++ apps/api-edge/component.yaml | 6 ++++++ apps/billing-worker/component.yaml | 6 ++++++ apps/cms/component.yaml | 6 ++++++ apps/cms/docs/runbook.md | 8 ++++++-- apps/config-worker/component.yaml | 6 ++++++ apps/events-worker/component.yaml | 6 ++++++ apps/identity-worker/component.yaml | 6 ++++++ apps/integrations-worker/component.yaml | 6 ++++++ apps/membership-worker/component.yaml | 6 ++++++ apps/metering-worker/component.yaml | 6 ++++++ apps/notifications-worker/component.yaml | 6 ++++++ apps/policy-worker/component.yaml | 6 ++++++ apps/projects-worker/component.yaml | 6 ++++++ apps/web-console-next/component.yaml | 6 ++++++ apps/webhooks-worker/component.yaml | 6 ++++++ infra/db-migrate/component.yaml | 6 ++++++ .../cloudflare-hyperdrive-cms/component.yaml | 6 ++++++ .../cloudflare-hyperdrive/component.yaml | 6 ++++++ infra/terraform/cloudflare-kv/component.yaml | 6 ++++++ .../terraform/cloudflare-r2-cms/component.yaml | 6 ++++++ infra/terraform/supabase/component.yaml | 6 ++++++ intent.yaml | 10 +++++++++- tasks/DSP-1.TaskContract.yaml | 18 ++++++++++++++++++ 25 files changed, 160 insertions(+), 4 deletions(-) create mode 100644 tasks/DSP-1.TaskContract.yaml diff --git a/ai/context/operations.md b/ai/context/operations.md index 90460b1..669249a 100644 --- a/ai/context/operations.md +++ b/ai/context/operations.md @@ -198,7 +198,7 @@ token the owner chooses. The full steps are in ```bash orun secrets set CMS_SETUP_TOKEN --org --env stage # a token of 16+ characters; it prompts -# merge any change to apps/cms (or re-run its lane) so the deploy pushes it, or: +# dispatch CI (component cms, environment stage) or merge a change under apps/cms so the next deploy pushes it (a re-run does not deploy), or: # pnpm --filter @saas/cms exec wrangler secret put CMS_SETUP_TOKEN --name lumen-payload-cms-stage # then visit https://lumen-payload-cms-stage..workers.dev/setup?token= ``` diff --git a/apps/admin-worker/component.yaml b/apps/admin-worker/component.yaml index 493cd7b..800583d 100644 --- a/apps/admin-worker/component.yaml +++ b/apps/admin-worker/component.yaml @@ -50,6 +50,9 @@ spec: - profile: deploy when: triggerRef: github-push-main + - profile: deploy + when: + triggerRef: github-dispatch - name: prod profile: verify # wire-live (deploy profile) is the only reader, and dev never @@ -62,6 +65,9 @@ spec: - profile: deploy when: triggerRef: github-push-main + - profile: deploy + when: + triggerRef: github-dispatch parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/apps/api-edge/component.yaml b/apps/api-edge/component.yaml index dc20404..9954c63 100644 --- a/apps/api-edge/component.yaml +++ b/apps/api-edge/component.yaml @@ -80,6 +80,9 @@ spec: - profile: deploy when: triggerRef: github-push-main + - profile: deploy + when: + triggerRef: github-dispatch - name: prod # Peer edges are runtime calls, not deploy order: every binding # target exists before this deploys (policy-worker's pre-deploy @@ -100,6 +103,9 @@ spec: - profile: deploy when: triggerRef: github-push-main + - profile: deploy + when: + triggerRef: github-dispatch parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/apps/billing-worker/component.yaml b/apps/billing-worker/component.yaml index 1e6cee3..642bbad 100644 --- a/apps/billing-worker/component.yaml +++ b/apps/billing-worker/component.yaml @@ -63,6 +63,9 @@ spec: - profile: deploy when: triggerRef: github-push-main + - profile: deploy + when: + triggerRef: github-dispatch - name: prod # Peer edges are runtime calls, not deploy order: every binding # target exists before this deploys (policy-worker's pre-deploy @@ -81,6 +84,9 @@ spec: - profile: deploy when: triggerRef: github-push-main + - profile: deploy + when: + triggerRef: github-dispatch parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/apps/cms/component.yaml b/apps/cms/component.yaml index 39b4044..9b7545b 100644 --- a/apps/cms/component.yaml +++ b/apps/cms/component.yaml @@ -87,6 +87,9 @@ spec: - profile: deploy when: triggerRef: github-push-main + - profile: deploy + when: + triggerRef: github-dispatch - name: prod profile: verify env: @@ -95,6 +98,9 @@ spec: - profile: deploy when: triggerRef: github-push-main + - profile: deploy + when: + triggerRef: github-dispatch parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/apps/cms/docs/runbook.md b/apps/cms/docs/runbook.md index 00a52a6..228b2ca 100644 --- a/apps/cms/docs/runbook.md +++ b/apps/cms/docs/runbook.md @@ -59,8 +59,12 @@ opens. Once per environment: 1. Choose a token of at least 16 characters, and keep it to yourself. 2. Give it to the Worker, either way: - - in the workspace's secrets for that environment, as `CMS_SETUP_TOKEN`; the - next CMS deploy pushes it; or + - in the workspace's secrets as `CMS_SETUP_TOKEN`, for that environment or + on the workspace-shared rung (both environments read it). The CMS's next + deploy pushes it to the Worker: run the on-demand deploy (Actions → CI → + Run workflow, component `cms`, environment `stage` or `prod`), or merge any + change under `apps/cms`. Re-running an earlier run does not deploy: the + lane's recorded result is reused; or - directly: `pnpm exec wrangler secret put CMS_SETUP_TOKEN --name lumen-payload-cms-` (it prompts for the value). 3. Visit `https://lumen-payload-cms-.nexo-7be.workers.dev/setup?token=`. diff --git a/apps/config-worker/component.yaml b/apps/config-worker/component.yaml index 1fa394c..0c0a92c 100644 --- a/apps/config-worker/component.yaml +++ b/apps/config-worker/component.yaml @@ -63,6 +63,9 @@ spec: - profile: deploy when: triggerRef: github-push-main + - profile: deploy + when: + triggerRef: github-dispatch - name: prod # Peer edges are runtime calls, not deploy order: every binding # target exists before this deploys (policy-worker's pre-deploy @@ -81,6 +84,9 @@ spec: - profile: deploy when: triggerRef: github-push-main + - profile: deploy + when: + triggerRef: github-dispatch parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/apps/events-worker/component.yaml b/apps/events-worker/component.yaml index f69cfd8..a89fd94 100644 --- a/apps/events-worker/component.yaml +++ b/apps/events-worker/component.yaml @@ -57,6 +57,9 @@ spec: - profile: deploy when: triggerRef: github-push-main + - profile: deploy + when: + triggerRef: github-dispatch - name: prod # Peer edges are runtime calls, not deploy order: every binding # target exists before this deploys (policy-worker's pre-deploy @@ -75,6 +78,9 @@ spec: - profile: deploy when: triggerRef: github-push-main + - profile: deploy + when: + triggerRef: github-dispatch parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/apps/identity-worker/component.yaml b/apps/identity-worker/component.yaml index 4f1f209..581393d 100644 --- a/apps/identity-worker/component.yaml +++ b/apps/identity-worker/component.yaml @@ -73,6 +73,9 @@ spec: - profile: deploy when: triggerRef: github-push-main + - profile: deploy + when: + triggerRef: github-dispatch - name: prod # Peer edges are runtime calls, not deploy order: every binding # target exists before this deploys (policy-worker's pre-deploy @@ -91,6 +94,9 @@ spec: - profile: deploy when: triggerRef: github-push-main + - profile: deploy + when: + triggerRef: github-dispatch parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/apps/integrations-worker/component.yaml b/apps/integrations-worker/component.yaml index 33c7fe2..6a5db53 100644 --- a/apps/integrations-worker/component.yaml +++ b/apps/integrations-worker/component.yaml @@ -69,6 +69,9 @@ spec: - profile: deploy when: triggerRef: github-push-main + - profile: deploy + when: + triggerRef: github-dispatch - name: prod # Peer edges are runtime calls, not deploy order: every binding # target exists before this deploys (policy-worker's pre-deploy @@ -87,6 +90,9 @@ spec: - profile: deploy when: triggerRef: github-push-main + - profile: deploy + when: + triggerRef: github-dispatch parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/apps/membership-worker/component.yaml b/apps/membership-worker/component.yaml index 527f42b..a719582 100644 --- a/apps/membership-worker/component.yaml +++ b/apps/membership-worker/component.yaml @@ -58,6 +58,9 @@ spec: - profile: deploy when: triggerRef: github-push-main + - profile: deploy + when: + triggerRef: github-dispatch - name: prod # Peer edges are runtime calls, not deploy order: every binding # target exists before this deploys (policy-worker's pre-deploy @@ -76,6 +79,9 @@ spec: - profile: deploy when: triggerRef: github-push-main + - profile: deploy + when: + triggerRef: github-dispatch parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/apps/metering-worker/component.yaml b/apps/metering-worker/component.yaml index a908ff4..c22e18d 100644 --- a/apps/metering-worker/component.yaml +++ b/apps/metering-worker/component.yaml @@ -57,6 +57,9 @@ spec: - profile: deploy when: triggerRef: github-push-main + - profile: deploy + when: + triggerRef: github-dispatch - name: prod # Peer edges are runtime calls, not deploy order: every binding # target exists before this deploys (policy-worker's pre-deploy @@ -75,6 +78,9 @@ spec: - profile: deploy when: triggerRef: github-push-main + - profile: deploy + when: + triggerRef: github-dispatch parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/apps/notifications-worker/component.yaml b/apps/notifications-worker/component.yaml index e48b6a6..77ccc20 100644 --- a/apps/notifications-worker/component.yaml +++ b/apps/notifications-worker/component.yaml @@ -52,6 +52,9 @@ spec: - profile: deploy when: triggerRef: github-push-main + - profile: deploy + when: + triggerRef: github-dispatch - name: prod profile: verify # wire-live (deploy profile) is the only reader, and dev never @@ -64,6 +67,9 @@ spec: - profile: deploy when: triggerRef: github-push-main + - profile: deploy + when: + triggerRef: github-dispatch parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/apps/policy-worker/component.yaml b/apps/policy-worker/component.yaml index f76345d..cd5e5f4 100644 --- a/apps/policy-worker/component.yaml +++ b/apps/policy-worker/component.yaml @@ -31,12 +31,18 @@ spec: - profile: deploy when: triggerRef: github-push-main + - profile: deploy + when: + triggerRef: github-dispatch - name: prod profile: verify profileRules: - profile: deploy when: triggerRef: github-push-main + - profile: deploy + when: + triggerRef: github-dispatch parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/apps/projects-worker/component.yaml b/apps/projects-worker/component.yaml index 09979a7..cde69ae 100644 --- a/apps/projects-worker/component.yaml +++ b/apps/projects-worker/component.yaml @@ -58,6 +58,9 @@ spec: - profile: deploy when: triggerRef: github-push-main + - profile: deploy + when: + triggerRef: github-dispatch - name: prod # Peer edges are runtime calls, not deploy order: every binding # target exists before this deploys (policy-worker's pre-deploy @@ -76,6 +79,9 @@ spec: - profile: deploy when: triggerRef: github-push-main + - profile: deploy + when: + triggerRef: github-dispatch parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/apps/web-console-next/component.yaml b/apps/web-console-next/component.yaml index 2388112..11f6f54 100644 --- a/apps/web-console-next/component.yaml +++ b/apps/web-console-next/component.yaml @@ -31,12 +31,18 @@ spec: - profile: deploy when: triggerRef: github-push-main + - profile: deploy + when: + triggerRef: github-dispatch - name: prod profile: verify profileRules: - profile: deploy when: triggerRef: github-push-main + - profile: deploy + when: + triggerRef: github-dispatch parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/apps/webhooks-worker/component.yaml b/apps/webhooks-worker/component.yaml index e47227a..6058dd7 100644 --- a/apps/webhooks-worker/component.yaml +++ b/apps/webhooks-worker/component.yaml @@ -63,6 +63,9 @@ spec: - profile: deploy when: triggerRef: github-push-main + - profile: deploy + when: + triggerRef: github-dispatch - name: prod # Peer edges are runtime calls, not deploy order: every binding # target exists before this deploys (policy-worker's pre-deploy @@ -81,6 +84,9 @@ spec: - profile: deploy when: triggerRef: github-push-main + - profile: deploy + when: + triggerRef: github-dispatch parameters: nodeVersion: "22" pnpmVersion: "10.12.1" diff --git a/infra/db-migrate/component.yaml b/infra/db-migrate/component.yaml index 7f640f1..dcc3625 100644 --- a/infra/db-migrate/component.yaml +++ b/infra/db-migrate/component.yaml @@ -53,6 +53,9 @@ spec: - profile: apply when: triggerRef: github-push-main + - profile: apply + when: + triggerRef: github-dispatch - name: prod profile: plan @@ -60,6 +63,9 @@ spec: - profile: apply when: triggerRef: github-push-main + - profile: apply + when: + triggerRef: github-dispatch # ci: re-trigger deploy (batch A — runner-starvation recovery 20260622T115650Z) # ci: re-trigger deploy (batch A — runner-starvation recovery 20260622T115650Z) # ci: re-apply migrations onto the recreated Supabase database (20260821T062704Z) diff --git a/infra/terraform/cloudflare-hyperdrive-cms/component.yaml b/infra/terraform/cloudflare-hyperdrive-cms/component.yaml index 55c0c27..dbcee6e 100644 --- a/infra/terraform/cloudflare-hyperdrive-cms/component.yaml +++ b/infra/terraform/cloudflare-hyperdrive-cms/component.yaml @@ -53,6 +53,9 @@ spec: - profile: apply when: triggerRef: github-push-main + - profile: apply + when: + triggerRef: github-dispatch - name: prod profile: plan-only @@ -60,3 +63,6 @@ spec: - profile: apply when: triggerRef: github-push-main + - profile: apply + when: + triggerRef: github-dispatch diff --git a/infra/terraform/cloudflare-hyperdrive/component.yaml b/infra/terraform/cloudflare-hyperdrive/component.yaml index 57e9ee4..ef10427 100644 --- a/infra/terraform/cloudflare-hyperdrive/component.yaml +++ b/infra/terraform/cloudflare-hyperdrive/component.yaml @@ -56,6 +56,9 @@ spec: - profile: apply when: triggerRef: github-push-main + - profile: apply + when: + triggerRef: github-dispatch - name: prod profile: plan-only @@ -63,6 +66,9 @@ spec: - profile: apply when: triggerRef: github-push-main + - profile: apply + when: + triggerRef: github-dispatch # ci: trigger convergence — first-boot infra bring-up (hyperdrive stage/prod) # ci: re-apply hyperdrive against the recreated Supabase origin (20260821T061640Z) # orun: redeploy 03-infrastructure-database as_fea059d4bc454b39ae15 diff --git a/infra/terraform/cloudflare-kv/component.yaml b/infra/terraform/cloudflare-kv/component.yaml index f09b234..a5c8f44 100644 --- a/infra/terraform/cloudflare-kv/component.yaml +++ b/infra/terraform/cloudflare-kv/component.yaml @@ -47,6 +47,9 @@ spec: - profile: apply when: triggerRef: github-push-main + - profile: apply + when: + triggerRef: github-dispatch - name: prod profile: plan-only @@ -54,5 +57,8 @@ spec: - profile: apply when: triggerRef: github-push-main + - profile: apply + when: + triggerRef: github-dispatch # ci: re-trigger kv apply with brand-namespaced title (baseline collision fix) # orun: redeploy 03-infrastructure as_fea059d4bc454b39ae15 diff --git a/infra/terraform/cloudflare-r2-cms/component.yaml b/infra/terraform/cloudflare-r2-cms/component.yaml index 7021223..5ddcddc 100644 --- a/infra/terraform/cloudflare-r2-cms/component.yaml +++ b/infra/terraform/cloudflare-r2-cms/component.yaml @@ -45,6 +45,9 @@ spec: - profile: apply when: triggerRef: github-push-main + - profile: apply + when: + triggerRef: github-dispatch - name: prod profile: plan-only @@ -52,3 +55,6 @@ spec: - profile: apply when: triggerRef: github-push-main + - profile: apply + when: + triggerRef: github-dispatch diff --git a/infra/terraform/supabase/component.yaml b/infra/terraform/supabase/component.yaml index 08326ff..5c95ca6 100644 --- a/infra/terraform/supabase/component.yaml +++ b/infra/terraform/supabase/component.yaml @@ -52,6 +52,9 @@ spec: - profile: apply when: triggerRef: github-push-main + - profile: apply + when: + triggerRef: github-dispatch - name: prod profile: plan-only @@ -59,6 +62,9 @@ spec: - profile: apply when: triggerRef: github-push-main + - profile: apply + when: + triggerRef: github-dispatch # ci: re-trigger supabase apply with org id sourced from SUPABASE_ORG_ID secret # ci: re-trigger supabase apply — fresh integration connection int_dd34bb26 (20260821T055915Z) # orun: redeploy 03-infrastructure as_fea059d4bc454b39ae15 diff --git a/intent.yaml b/intent.yaml index 1468bd0..3b5f210 100644 --- a/intent.yaml +++ b/intent.yaml @@ -117,9 +117,17 @@ automation: # that pushed a partial snapshot would make the catalog describe a plan # nobody ran. # + # A dispatch deploys only because each component's stage and prod + # subscriptions carry a `profileRules` entry naming this binding, beside + # the github-push-main one: deploy for a Worker, apply for Terraform and + # db-migrate. Without it the subscription's default profile (verify, + # plan-only) ran, so a dispatch built and dry-ran and deployed nothing. + # A new component needs the same two rules. + # # `requireRule` is DELIBERATELY off. Turning it on means a component is # dispatchable only if one of its `profileRules` names this binding — - # safer, and 45 components' worth of opt-in. The guard that matters here + # safer, and a component without the rule would be refused rather than + # verified. The guard that matters here # is the environment list below: a dispatch can only reach an environment # that activates this binding, so dev (verify-only) cannot be deployed # into by anybody. diff --git a/tasks/DSP-1.TaskContract.yaml b/tasks/DSP-1.TaskContract.yaml new file mode 100644 index 0000000..f35d8d5 --- /dev/null +++ b/tasks/DSP-1.TaskContract.yaml @@ -0,0 +1,18 @@ +apiVersion: orun.io/v1 +kind: TaskContract +metadata: + name: DSP-1 + title: "The on-demand deploy deploys" +spec: + goal: "A workflow_dispatch of CI for a component and an environment deploys (Workers) or applies (Terraform, db-migrate) that component there, instead of only verifying it; pull requests still only verify and plan." + affects: + - "apps/*/component.yaml" + - "infra/**/component.yaml" + - "intent.yaml" + - "apps/cms/docs/runbook.md" + - "ai/context/operations.md" + - "tasks/DSP-1.TaskContract.yaml" + doneWhen: + - "a simulated dispatch plans the deploy or apply profile, and a simulated pull request still plans verify and plan-only" + - "after the merge, a dispatch of cms to stage deploys it (its log shows the deploy and smoke steps)" + gates: []