Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 22 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
fetch-depth: 0
- uses: sourceplane/orun-action@v1.2.0
with:
version: v2.39.0
version: v2.48.0
- env:
# Surface the best-effort catalog auto-sync (execution.state.autopushCatalog).
# A successful push prints "✓ pushed catalog …"; ORUN_VERBOSE also makes
Expand Down Expand Up @@ -63,6 +63,10 @@ jobs:
if: ${{ needs.plan.outputs.job-matrix != '[]' && needs.plan.outputs.job-matrix != '' }}
strategy:
fail-fast: false
# Stagger the fan-out: every lane hits the lease-bound resolve at job
# start, and an unbounded herd saturated it twice. The orun DAG already
# serializes dependents, so capped parallelism costs little wall-clock.
max-parallel: 8
matrix:
include: ${{ fromJson(needs.plan.outputs.job-matrix) }}
name: ${{ matrix.job-name }}
Expand All @@ -79,33 +83,30 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- uses: sourceplane/orun-action@v1.2.0
with:
version: v2.39.0
version: v2.48.0
# exec-id is the RUN id alone (no attempt suffix): a `gh run rerun
# --failed` then RESUMES the same orun execution — jobs that succeeded in
# a prior attempt stay completed, so re-run lanes' cross-job dependencies
# are already satisfied instead of waiting forever on lanes that are not
# re-running (the partial-rerun deadlock). --retry re-opens THIS lane's
# job when it terminally failed in a prior attempt (no-op on first
# attempts) — together they make `gh run rerun --failed` a true resume.
- run: |
orun run \
--plan plan.json \
--runner github-actions \
--remote-state \
--job "${{ matrix.job-id }}" \
--exec-id "${{ github.run_id }}-${{ github.run_attempt }}"
--exec-id "${{ github.run_id }}" \
--retry
env:
# GITHUB_TOKEN is the only credential CI holds — GitHub-issued and
# ephemeral. Every provider credential (Cloudflare token + account
# id, Supabase management token + org id) is an orun-managed secret:
# brokered fresh per run from the workspace's integrations, resolved
# lease-bound by the jobs that declare it (profile secretBindings or
# component secretEnv), and log-redacted. Nothing provider-shaped is
# stored in GitHub.
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# CLOUDFLARE_API_TOKEN is now an orun-managed brokered secret
# (secret://lumen/lumen/<env>/CLOUDFLARE_API_TOKEN, minted fresh per
# run from the Cloudflare integration): worker deploys receive it via
# the deploy profile's secretBindings, cloudflare-kv via its
# component secretEnv — the resolved value overrides this ambient one.
# The ambient copy remains ONLY for cloudflare-hyperdrive and
# cloudflare-domain, whose Terraform needs Hyperdrive/DNS permissions
# the workers-deploy broker template does not mint yet. Remove it when
# those two components migrate.
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
SUPABASE_API_KEY: ${{ secrets.SUPABASE_API_KEY }}
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_API_KEY }}
TF_VAR_cloudflare_account_id: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
# Supabase org id is environment/account-specific, so it comes from a
# CI secret rather than a committed component parameter. Used by the
# supabase terraform component as var.supabaseOrgId.
TF_VAR_supabaseOrgId: ${{ secrets.SUPABASE_ORG_ID }}
DOCKER_CONFIG: /home/runner/.docker
9 changes: 7 additions & 2 deletions apps/admin-worker/component.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ spec:
path: apps/admin-worker
dependsOn:
- component: cloudflare-hyperdrive
# BF6 wiring documents from orun secrets (SEC-JOB): lease-published by
# the infra components; wire-live renders the wrangler template from
# these instead of Secrets Manager documents.
secretEnv:
WIRING_CLOUDFLARE_HYPERDRIVE_STAGE: "secret://lumen/lumen/stage/WIRING_CLOUDFLARE_HYPERDRIVE"
WIRING_CLOUDFLARE_HYPERDRIVE_PROD: "secret://lumen/lumen/prod/WIRING_CLOUDFLARE_HYPERDRIVE"

subscribe:
environments:
- name: dev
Expand All @@ -35,8 +42,6 @@ spec:
# BF6b: deploy-time wiring — wrangler.jsonc is rendered, never committed.
# Verify lanes render from wiring.fixture.json (offline); deploy lanes
# resolve real IDs from the Secrets Manager wiring manifest (BF5).
awsAccountId: "306024784101"
awsRegion: us-east-1
orgName: sourceplane
owner: sourceplane
repo: lumen
Expand Down
11 changes: 9 additions & 2 deletions apps/api-edge/component.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ spec:
- component: membership-worker
- component: metering-worker
- component: notifications-worker
# BF6 wiring documents from orun secrets (SEC-JOB): lease-published by
# the infra components; wire-live renders the wrangler template from
# these instead of Secrets Manager documents.
secretEnv:
WIRING_CLOUDFLARE_HYPERDRIVE_STAGE: "secret://lumen/lumen/stage/WIRING_CLOUDFLARE_HYPERDRIVE"
WIRING_CLOUDFLARE_HYPERDRIVE_PROD: "secret://lumen/lumen/prod/WIRING_CLOUDFLARE_HYPERDRIVE"
WIRING_CLOUDFLARE_KV_STAGE: "secret://lumen/lumen/stage/WIRING_CLOUDFLARE_KV"
WIRING_CLOUDFLARE_KV_PROD: "secret://lumen/lumen/prod/WIRING_CLOUDFLARE_KV"

subscribe:
environments:
- name: dev
Expand Down Expand Up @@ -56,8 +65,6 @@ spec:
wiringComponents: "cloudflare-hyperdrive,cloudflare-kv"
wiringEnvs: "stage,prod"
wiringFixture: wiring.fixture.json
awsAccountId: "306024784101"
awsRegion: us-east-1
orgName: sourceplane
owner: sourceplane
repo: lumen
Expand Down
21 changes: 17 additions & 4 deletions apps/billing-worker/component.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,20 @@ spec:
path: apps/billing-worker
dependsOn:
- component: policy-worker
# Runtime secrets, wire-now-seed-later: best-effort references —
# an unseeded key is skipped at resolve (and by secrets-live), so
# this block is inert until the value is stored in orun secrets.
# BF6 wiring documents from orun secrets (SEC-JOB): lease-published by
# the infra components; wire-live renders the wrangler template from
# these instead of Secrets Manager documents.
secretEnv:
WIRING_CLOUDFLARE_HYPERDRIVE_STAGE: "secret://lumen/lumen/stage/WIRING_CLOUDFLARE_HYPERDRIVE"
WIRING_CLOUDFLARE_HYPERDRIVE_PROD: "secret://lumen/lumen/prod/WIRING_CLOUDFLARE_HYPERDRIVE"

optionalSecretEnv:
POLAR_ACCESS_TOKEN: "secret://lumen/lumen/{{ .environment }}/POLAR_ACCESS_TOKEN"
POLAR_WEBHOOK_SECRET: "secret://lumen/lumen/{{ .environment }}/POLAR_WEBHOOK_SECRET"

subscribe:
environments:
- name: dev
Expand All @@ -35,14 +49,13 @@ spec:
# BF6b: deploy-time wiring — wrangler.jsonc is rendered, never committed.
# Verify lanes render from wiring.fixture.json (offline); deploy lanes
# resolve real IDs from the Secrets Manager wiring manifest (BF5).
awsAccountId: "306024784101"
awsRegion: us-east-1
orgName: sourceplane
owner: sourceplane
repo: lumen

# SS2: manifest key for the secrets-live escrow sync (saas-secrets-sync).
secretsWorker: billing-worker
# Runtime worker secrets, pushed by the secrets-live step from the
# values orun resolves for the optionalSecretEnv references below.
runtimeSecrets: "POLAR_ACCESS_TOKEN,POLAR_WEBHOOK_SECRET"
turboFilter: "@saas/billing-worker"
wranglerConfig: wrangler.jsonc
wranglerTemplate: wrangler.template.jsonc
Expand Down
33 changes: 23 additions & 10 deletions apps/config-worker/component.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@ spec:
dependsOn:
- component: membership-worker
- component: policy-worker
# Runtime secrets, wire-now-seed-later: best-effort references —
# an unseeded key is skipped at resolve (and by secrets-live), so
# this block is inert until the value is stored in orun secrets.
# BF6 wiring documents from orun secrets (SEC-JOB): lease-published by
# the infra components; wire-live renders the wrangler template from
# these instead of Secrets Manager documents.
secretEnv:
WIRING_CLOUDFLARE_HYPERDRIVE_STAGE: "secret://lumen/lumen/stage/WIRING_CLOUDFLARE_HYPERDRIVE"
WIRING_CLOUDFLARE_HYPERDRIVE_PROD: "secret://lumen/lumen/prod/WIRING_CLOUDFLARE_HYPERDRIVE"

optionalSecretEnv:
SECRET_ENCRYPTION_KEY: "secret://lumen/lumen/{{ .environment }}/SECRET_ENCRYPTION_KEY"

subscribe:
environments:
- name: dev
Expand All @@ -36,14 +49,13 @@ spec:
# BF6b: deploy-time wiring — wrangler.jsonc is rendered, never committed.
# Verify lanes render from wiring.fixture.json (offline); deploy lanes
# resolve real IDs from the Secrets Manager wiring manifest (BF5).
awsAccountId: "306024784101"
awsRegion: us-east-1
orgName: sourceplane
owner: sourceplane
repo: lumen

# SS2: manifest key for the secrets-live escrow sync (saas-secrets-sync).
secretsWorker: config-worker
# Runtime worker secrets, pushed by the secrets-live step from the
# values orun resolves for the optionalSecretEnv references below.
runtimeSecrets: "SECRET_ENCRYPTION_KEY"
turboFilter: "@saas/config-worker"
wranglerConfig: wrangler.jsonc
wranglerTemplate: wrangler.template.jsonc
Expand All @@ -55,14 +67,15 @@ spec:
typecheckCommand: pnpm exec turbo run typecheck --filter=@saas/config-worker
dryRunCommand: pnpm exec wrangler deploy --dry-run --config wrangler.jsonc --env prod
deployCommand: pnpm exec wrangler deploy --config wrangler.jsonc --env prod
# Ensure the secrets-at-rest encryption key exists on every deploy target
# before the worker ships (PX2 completion — live stage verification found
# "Encryption is not configured"). Generate-if-missing, idempotent:
# Safety net: ensure the secrets-at-rest encryption key exists on every
# deploy target before the worker ships. Generate-if-missing, idempotent —
# `wrangler secret list` is the existence probe; the key is generated in
# CI, pushed straight to Cloudflare, and never logged or persisted
# elsewhere. Runs only in the deploy profile (pre-deploy capability), so
# PR/verify lanes never touch live secrets. AWS Secrets Manager escrow of
# this key is a named follow-up (BF deploy-time wiring).
# elsewhere. The MANAGED path is orun secrets: seed SECRET_ENCRYPTION_KEY
# (escrow the CURRENTLY DEPLOYED value — a fresh key bricks stored data)
# and the secrets-live step keeps the worker in sync; this pre-deploy
# probe then always finds the key present and does nothing. Remove it
# once the key is seeded in orun.
preDeployCommand: |
for e in stage prod; do
if ! pnpm exec wrangler secret list --config wrangler.jsonc --env "$e" 2>/dev/null | grep -q '"SECRET_ENCRYPTION_KEY"'; then
Expand Down
9 changes: 7 additions & 2 deletions apps/events-worker/component.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ spec:
dependsOn:
- component: membership-worker
- component: policy-worker
# BF6 wiring documents from orun secrets (SEC-JOB): lease-published by
# the infra components; wire-live renders the wrangler template from
# these instead of Secrets Manager documents.
secretEnv:
WIRING_CLOUDFLARE_HYPERDRIVE_STAGE: "secret://lumen/lumen/stage/WIRING_CLOUDFLARE_HYPERDRIVE"
WIRING_CLOUDFLARE_HYPERDRIVE_PROD: "secret://lumen/lumen/prod/WIRING_CLOUDFLARE_HYPERDRIVE"

subscribe:
environments:
- name: dev
Expand All @@ -36,8 +43,6 @@ spec:
# BF6b: deploy-time wiring — wrangler.jsonc is rendered, never committed.
# Verify lanes render from wiring.fixture.json (offline); deploy lanes
# resolve real IDs from the Secrets Manager wiring manifest (BF5).
awsAccountId: "306024784101"
awsRegion: us-east-1
orgName: sourceplane
owner: sourceplane
repo: lumen
Expand Down
22 changes: 18 additions & 4 deletions apps/identity-worker/component.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,21 @@ spec:
- component: policy-worker
- component: membership-worker
- component: notifications-worker
# Runtime secrets, wire-now-seed-later: best-effort references —
# an unseeded key is skipped at resolve (and by secrets-live), so
# this block is inert until the value is stored in orun secrets.
# BF6 wiring documents from orun secrets (SEC-JOB): lease-published by
# the infra components; wire-live renders the wrangler template from
# these instead of Secrets Manager documents.
secretEnv:
WIRING_CLOUDFLARE_HYPERDRIVE_STAGE: "secret://lumen/lumen/stage/WIRING_CLOUDFLARE_HYPERDRIVE"
WIRING_CLOUDFLARE_HYPERDRIVE_PROD: "secret://lumen/lumen/prod/WIRING_CLOUDFLARE_HYPERDRIVE"

optionalSecretEnv:
GITHUB_OAUTH_CLIENT_SECRET: "secret://lumen/lumen/{{ .environment }}/GITHUB_OAUTH_CLIENT_SECRET"
GOOGLE_OAUTH_CLIENT_SECRET: "secret://lumen/lumen/{{ .environment }}/GOOGLE_OAUTH_CLIENT_SECRET"
OAUTH_STATE_SECRET: "secret://lumen/lumen/{{ .environment }}/OAUTH_STATE_SECRET"

subscribe:
environments:
- name: dev
Expand All @@ -38,14 +53,13 @@ spec:
# BF6b: deploy-time wiring — wrangler.jsonc is rendered, never committed.
# Verify lanes render from wiring.fixture.json (offline); deploy lanes
# resolve real IDs from the Secrets Manager wiring manifest (BF5).
awsAccountId: "306024784101"
awsRegion: us-east-1
orgName: sourceplane
owner: sourceplane
repo: lumen

# SS2: manifest key for the secrets-live escrow sync (saas-secrets-sync).
secretsWorker: identity-worker
# Runtime worker secrets, pushed by the secrets-live step from the
# values orun resolves for the optionalSecretEnv references below.
runtimeSecrets: "GITHUB_OAUTH_CLIENT_SECRET,GOOGLE_OAUTH_CLIENT_SECRET,OAUTH_STATE_SECRET"
turboFilter: "@saas/identity-worker"
wranglerConfig: wrangler.jsonc
wranglerTemplate: wrangler.template.jsonc
Expand Down
24 changes: 20 additions & 4 deletions apps/integrations-worker/component.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,23 @@ spec:
- component: policy-worker
- component: billing-worker
- component: projects-worker
# Runtime secrets, wire-now-seed-later: best-effort references —
# an unseeded key is skipped at resolve (and by secrets-live), so
# this block is inert until the value is stored in orun secrets.
# BF6 wiring documents from orun secrets (SEC-JOB): lease-published by
# the infra components; wire-live renders the wrangler template from
# these instead of Secrets Manager documents.
secretEnv:
WIRING_CLOUDFLARE_HYPERDRIVE_STAGE: "secret://lumen/lumen/stage/WIRING_CLOUDFLARE_HYPERDRIVE"
WIRING_CLOUDFLARE_HYPERDRIVE_PROD: "secret://lumen/lumen/prod/WIRING_CLOUDFLARE_HYPERDRIVE"

optionalSecretEnv:
SECRET_ENCRYPTION_KEY: "secret://lumen/lumen/{{ .environment }}/SECRET_ENCRYPTION_KEY"
INTEGRATIONS_STATE_SECRET: "secret://lumen/lumen/{{ .environment }}/INTEGRATIONS_STATE_SECRET"
GITHUB_APP_PRIVATE_KEY: "secret://lumen/lumen/{{ .environment }}/GITHUB_APP_PRIVATE_KEY"
GITHUB_APP_WEBHOOK_SECRET: "secret://lumen/lumen/{{ .environment }}/GITHUB_APP_WEBHOOK_SECRET"
GITHUB_APP_CLIENT_SECRET: "secret://lumen/lumen/{{ .environment }}/GITHUB_APP_CLIENT_SECRET"

subscribe:
environments:
- name: dev
Expand All @@ -38,14 +55,13 @@ spec:
# BF6b: deploy-time wiring — wrangler.jsonc is rendered, never committed.
# Verify lanes render from wiring.fixture.json (offline); deploy lanes
# resolve real IDs from the Secrets Manager wiring manifest (BF5).
awsAccountId: "306024784101"
awsRegion: us-east-1
orgName: sourceplane
owner: sourceplane
repo: lumen

# SS2: manifest key for the secrets-live escrow sync (saas-secrets-sync).
secretsWorker: integrations-worker
# Runtime worker secrets, pushed by the secrets-live step from the
# values orun resolves for the optionalSecretEnv references below.
runtimeSecrets: "SECRET_ENCRYPTION_KEY,INTEGRATIONS_STATE_SECRET,GITHUB_APP_PRIVATE_KEY,GITHUB_APP_WEBHOOK_SECRET,GITHUB_APP_CLIENT_SECRET"
turboFilter: "@saas/integrations-worker"
wranglerConfig: wrangler.jsonc
wranglerTemplate: wrangler.template.jsonc
Expand Down
9 changes: 7 additions & 2 deletions apps/membership-worker/component.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ spec:
dependsOn:
- component: policy-worker
- component: billing-worker
# BF6 wiring documents from orun secrets (SEC-JOB): lease-published by
# the infra components; wire-live renders the wrangler template from
# these instead of Secrets Manager documents.
secretEnv:
WIRING_CLOUDFLARE_HYPERDRIVE_STAGE: "secret://lumen/lumen/stage/WIRING_CLOUDFLARE_HYPERDRIVE"
WIRING_CLOUDFLARE_HYPERDRIVE_PROD: "secret://lumen/lumen/prod/WIRING_CLOUDFLARE_HYPERDRIVE"

subscribe:
environments:
- name: dev
Expand All @@ -36,8 +43,6 @@ spec:
# BF6b: deploy-time wiring — wrangler.jsonc is rendered, never committed.
# Verify lanes render from wiring.fixture.json (offline); deploy lanes
# resolve real IDs from the Secrets Manager wiring manifest (BF5).
awsAccountId: "306024784101"
awsRegion: us-east-1
orgName: sourceplane
owner: sourceplane
repo: lumen
Expand Down
9 changes: 7 additions & 2 deletions apps/metering-worker/component.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ spec:
dependsOn:
- component: membership-worker
- component: policy-worker
# BF6 wiring documents from orun secrets (SEC-JOB): lease-published by
# the infra components; wire-live renders the wrangler template from
# these instead of Secrets Manager documents.
secretEnv:
WIRING_CLOUDFLARE_HYPERDRIVE_STAGE: "secret://lumen/lumen/stage/WIRING_CLOUDFLARE_HYPERDRIVE"
WIRING_CLOUDFLARE_HYPERDRIVE_PROD: "secret://lumen/lumen/prod/WIRING_CLOUDFLARE_HYPERDRIVE"

subscribe:
environments:
- name: dev
Expand All @@ -36,8 +43,6 @@ spec:
# BF6b: deploy-time wiring — wrangler.jsonc is rendered, never committed.
# Verify lanes render from wiring.fixture.json (offline); deploy lanes
# resolve real IDs from the Secrets Manager wiring manifest (BF5).
awsAccountId: "306024784101"
awsRegion: us-east-1
orgName: sourceplane
owner: sourceplane
repo: lumen
Expand Down
9 changes: 7 additions & 2 deletions apps/notifications-worker/component.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ spec:
dependsOn:
- component: events-worker
- component: db-migrate
# BF6 wiring documents from orun secrets (SEC-JOB): lease-published by
# the infra components; wire-live renders the wrangler template from
# these instead of Secrets Manager documents.
secretEnv:
WIRING_CLOUDFLARE_HYPERDRIVE_STAGE: "secret://lumen/lumen/stage/WIRING_CLOUDFLARE_HYPERDRIVE"
WIRING_CLOUDFLARE_HYPERDRIVE_PROD: "secret://lumen/lumen/prod/WIRING_CLOUDFLARE_HYPERDRIVE"

subscribe:
environments:
- name: dev
Expand All @@ -36,8 +43,6 @@ spec:
# BF6b: deploy-time wiring — wrangler.jsonc is rendered, never committed.
# Verify lanes render from wiring.fixture.json (offline); deploy lanes
# resolve real IDs from the Secrets Manager wiring manifest (BF5).
awsAccountId: "306024784101"
awsRegion: us-east-1
orgName: sourceplane
owner: sourceplane
repo: lumen
Expand Down
Loading
Loading