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
7 changes: 7 additions & 0 deletions .baseline/product/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,13 @@ own domain:
The apply owns the project's Auth URLs: an edit in the Supabase dashboard is
undone by the next apply.

The repository also names the domain in one place, `BASE_DOMAIN` under each
environment's `env:` in `intent.yaml`, which the product was born with as the
reserved placeholder `supabase-starter.example.com`. Nothing builds a URL from
it — the origin is `SITE_URL` — so replacing it moves nothing by itself; it
records the domain. Replace it with yours in the same pull request as
`SITE_URL`.

## CI

| Workflow | What it runs |
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/baseline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ jobs:
--out "$(mktemp -d)" \
--set reponame=acme-auth \
--set "productname=Acme Cloud" \
--set productdomain=acme.dev \
--set githuborg=acme-inc
- name: the leak gate — what a product carries
run: bash testing/leak.test.sh
Expand Down
14 changes: 9 additions & 5 deletions BOOTSTRAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ cd supabase-starter
orun new --blueprint repo-blueprint.yaml \
--out ~/products/acme-notes --run-hooks --resume \
--set reponame=acme-notes --set productname="Acme Notes" \
--set productdomain=acme.dev --set githuborg=acme-inc \
--set githuborg=acme-inc \
--set orunWorkspace=ws_XXXXXXXX \
--set subdomain=<workers-dev-subdomain>
```
Expand Down Expand Up @@ -98,9 +98,13 @@ orun new --blueprint repo-blueprint.yaml --out ~/products/acme-notes --run-hooks

`02-docs` reads the identity back from `.rebrand/values.json` in the placed
tree, but the blueprint's **required** inputs — `reponame`, `productname`,
`productdomain`, `githuborg` — are validated before anything runs, so pass
them every time (a `--values` file is easier). The full guide, one page per
phase: [docs/phases/README.md](docs/phases/README.md).
`githuborg` — are validated before anything runs, so pass them every time (a
`--values` file is easier). The domain is not one of them: the app goes live
on workers.dev, and `productdomain` defaults to empty, which brands the
reserved placeholder `<reponame>.example.com` into `BASE_DOMAIN` for an owner
to replace when they attach a domain (README, "Custom domain"). Pass
`--set productdomain=` only for a product that already has its domain.
The full guide, one page per phase: [docs/phases/README.md](docs/phases/README.md).

| flag | what it does |
|---|---|
Expand Down Expand Up @@ -231,5 +235,5 @@ at the tag and refuses the whole catalogue if it 404s.
| The convergence reported green, then `verify` got 404 | a second workflow ran on the push to main and the watch took its run. Only `ci.yml` may run on a push to main; `checks.yml` runs on pull requests only |
| The product's `intent.yaml` says `workspace: ws_SET_ME` | `orunWorkspace` was empty and the build ran outside a workspace; set it and re-run `01-product` |
| A bootstrap stopped before `02-docs`; prod no longer waits on stage | the gate is deferred, not dropped: run `02-docs`, or `node tooling/bootstrap/promotion.mjs --restore --file <product>/intent.yaml` |
| `✕ input "productdomain" is required` | all four required inputs must be set on every invocation, single-phase ones included |
| `✕ input "productname" is required` | all three required inputs (`reponame`, `productname`, `githuborg`) must be set on every invocation, single-phase ones included |
| `unknown flag: --phase` or a parse error in the blueprint | the CLI is below the v2.58.11 floor |
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ departure.
git clone --depth 1 --branch <baseline-tag> https://github.com/sourceplane/supabase-starter
cd supabase-starter
orun new --blueprint repo-blueprint.yaml --out ~/products/acme-notes --run-hooks --resume \
--set reponame=acme-notes --set productname="Acme Notes" --set productdomain=acme.dev \
--set reponame=acme-notes --set productname="Acme Notes" \
--set githuborg=acme-inc --set subdomain=<workers-dev-subdomain>
```

Expand Down
4 changes: 2 additions & 2 deletions ai/context/current.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ environment), then records what went live (`02-docs`).

| | |
|---|---|
| Latest tag | `baseline-v3` (SS6 — the cirrus standard: no kiox, generated component docs, this context pack, and the console card reading `subdomain` from the Cloudflare connection); `baseline-v2` is SS5, `baseline-v1` is SS4 |
| Latest tag | `baseline-v4` (SS7 — the domain is set later: the console asks for no domain, and a product is born with the placeholder `<reponame>.example.com` in `BASE_DOMAIN` for an owner to replace); `baseline-v3` is SS6 (the cirrus standard), `baseline-v2` SS5, `baseline-v1` SS4 |
| Proven live | No. Nothing has been applied against a real Supabase organization: no Terraform apply, no live deploy, no live bootstrap (risk SS-I). Everything short of the platform is proven offline in Baseline CI, against a local Supabase stand-in |

## Where to read
Expand All @@ -33,7 +33,7 @@ environment), then records what went live (`02-docs`).

## Next

1. Bootstrap one product from `baseline-v3` against a workspace with a
1. Bootstrap one product from `baseline-v4` against a workspace with a
Supabase connection, and record its timings — the apply, the brokered
token's reach to the API-keys and Auth-config endpoints, a sign-up on the
first deploy (closes SS-I).
1 change: 1 addition & 0 deletions ai/context/decisions.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ reads in order.
| 11 | orun is pinned only where it runs (the `orun-action` `version:` in each workflow); no kiox | `kiox.yaml` pinned a version nothing ran | IMPLEMENTATION-STATUS (SS6) |
| 12 | Component docs are generated from the manifests and checked in CI | A hand-written copy of the dependency graph, bindings and published outputs drifts silently | `tooling/catalog/gen-component-docs.py` |
| 13 | The console card reads `subdomain` from the Cloudflare connection (`from: connection.cloudflare.workersSubdomain`); only a hand-run build passes it | It belongs to the account like its id and has one right answer; a typed one could only be wrong, and wrong showed up after deploy (cirrus-baseline since baseline-v23) | `blueprint.yaml`, IMPLEMENTATION-STATUS (SS-8) |
| 14 | The console asks for no domain; an empty `productdomain` brands the placeholder `<reponame>.example.com` | The app goes live on workers.dev and nothing in the build needs a domain (the origin is `SITE_URL`, else workers.dev); attaching one is an owner's step, and the placeholder keeps the place the domain goes in the repository, ready to replace | `repo-blueprint.yaml`, `tooling/rebrand/rebrand.mjs`, IMPLEMENTATION-STATUS (SS-9) |
2 changes: 1 addition & 1 deletion ai/context/operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ orun integrations list --org <ws> --json && orun cloud check --org <ws>
| require email confirmation | SMTP first, then `authEmailConfirmation: "true"` (above) |
| add a table | create it with `enable row level security` and `auth.uid()` policies (above); the day the product has migrations, Lumen's `packages/db` + `db-migrate` is the shape, reading `SUPABASE_DB_URL` |
| redeploy without a change | edit the last line of the component's `component.yaml` (`# orun: redeploy <reason> <stamp>`) and merge — it is a deploy trigger, nothing reads it |
| serve a custom domain | attach it to the Worker in Cloudflare, set `SITE_URL` under `environments.prod.env` in `intent.yaml`, and touch the redeploy line of both `apps/web/component.yaml` and `infra/terraform/supabase/component.yaml` in the same PR (an `intent.yaml` change alone plans nothing) |
| serve a custom domain | attach it to the Worker in Cloudflare (README, "Custom domain"), set `SITE_URL` under `environments.prod.env` in `intent.yaml`, replace the placeholder `supabase-starter.example.com` in `intent.yaml`'s `BASE_DOMAIN` with it (a record; nothing builds a URL from it), and touch the redeploy line of both `apps/web/component.yaml` and `infra/terraform/supabase/component.yaml` in the same PR (an `intent.yaml` change alone plans nothing) |
| headless credentials | `ORUN_TOKEN` (workspace-scoped) + `GITHUB_TOKEN` |

The deployment record is the bootstrap's `02-docs` phase. Re-running it (the
Expand Down
11 changes: 6 additions & 5 deletions blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ spec:
# already holds says so with `from`. repo-blueprint.yaml declares the same
# names; `repoPrivate`, `orunWorkspace` and `epicSlug` are build inputs with
# defaults (or filled from the build's workspace) and are not asked.
#
# NOR IS THE DOMAIN. The app goes live on workers.dev, and a domain is an
# owner's step after the bootstrap: `productdomain` defaults to empty, the
# rebrand writes the reserved placeholder `<reponame>.example.com` where
# the domain goes, and the product's README ("Custom domain") says how to
# set it. Nothing that needs a domain is removed — it waits for one.
inputs:
- key: reponame
label: Repo name
Expand All @@ -75,11 +81,6 @@ spec:
pattern: "^[A-Za-z0-9][A-Za-z0-9 .,'&-]{1,48}$"
help: The name people see — in the header of every page and in every page title.
example: Acme Notes
- key: productdomain
label: Product domain
pattern: "^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$"
help: The domain the product will answer on. It does not need to exist — the app goes live on workers.dev first.
example: acme.dev
- key: githuborg
label: GitHub organisation
pattern: "^[A-Za-z0-9][A-Za-z0-9-]*$"
Expand Down
13 changes: 10 additions & 3 deletions docs/phases/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,16 @@ carry, so it is an owner's step after the bootstrap (the product's README,
`01-product` takes the product's identity once and writes it into the repo
(`.rebrand/values.json`); `02-docs` reads it back from the placed tree. But
the blueprint's **required** inputs — `reponame`, `productname`,
`productdomain`, `githuborg` — are validated before any phase runs, so they
must be supplied on every invocation, single-phase ones included. A
`--values` file is easier than repeating `--set`.
`githuborg` — are validated before any phase runs, so they must be supplied
on every invocation, single-phase ones included. A `--values` file is easier
than repeating `--set`.

- `productdomain` — NOT ASKED, default empty. The app goes live on
workers.dev; empty brands the reserved placeholder `<reponame>.example.com`
into `BASE_DOMAIN`, for an owner to replace when they attach a domain (the
product's README, "Custom domain", which also sets `SITE_URL` so the app's
links and the Supabase project's Auth follow it). Pass it only for a
product that already has its domain.

- `subdomain` — the workers.dev subdomain of the Cloudflare account you
deploy into. It is in every URL the phases probe, and it is the origin the
Expand Down
14 changes: 10 additions & 4 deletions repo-blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,17 @@ inputs:
description: The product's display name (e.g. "Acme Notes") — in the header of every page and in every page title.
productdomain:
type: string
required: true
default: ""
description: >-
The domain the product will answer on (e.g. acme.dev) — BASE_DOMAIN and
the custom-domain guidance. It does not need to exist: the app answers
on workers.dev from its first deploy.
The product's own domain, once it has one (e.g. acme.dev). NOT ASKED:
the app answers on workers.dev from its first deploy, and a domain is
an owner's step after it. Empty, the rebrand writes the reserved
placeholder `<reponame>.example.com` where the domain goes (BASE_DOMAIN
under each environment's `env:` in intent.yaml), so setting it later is
replacing that one string — the product's README, "Custom domain", says
how, together with the SITE_URL that moves the app's links and the
Supabase project's Auth Site URL onto it. Pass it with --set only to
brand a hand-run build with a domain it already has.
githuborg:
type: string
pattern: "^[A-Za-z0-9][A-Za-z0-9-]*$"
Expand Down
2 changes: 1 addition & 1 deletion specs/epics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ folder is the adoption; the merge creates the epic in the workspace.

| Epic | Cluster | Status | What it is |
|------|---------|--------|------------|
| [`supabase-starter/`](./supabase-starter/) | **SS** | ✅ Shipped (`baseline-v3`); live bootstrap pending | Vercel's Next.js and Supabase Starter, equivalent in code and function, on Cloudflare Workers with the Supabase project provisioned by Orun — and an Orun baseline that instantiates it in one landing (SS4, `baseline-v1`) |
| [`supabase-starter/`](./supabase-starter/) | **SS** | ✅ Shipped (`baseline-v4`); live bootstrap pending | Vercel's Next.js and Supabase Starter, equivalent in code and function, on Cloudflare Workers with the Supabase project provisioned by Orun — and an Orun baseline that instantiates it in one landing (SS4, `baseline-v1`) |

As-built ≠ intent: what shipped lives in each epic's `IMPLEMENTATION-STATUS.md`.
48 changes: 48 additions & 0 deletions specs/epics/supabase-starter/IMPLEMENTATION-STATUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ the code departed from `design.md` or from the upstream template.
| SS4 — a baseline | ✅ Shipped | [#5](https://github.com/sourceplane/supabase-starter/pull/5) (SS-5), tagged `baseline-v1` |
| SS5 — the product's own origin | ✅ Shipped | [#6](https://github.com/sourceplane/supabase-starter/pull/6) (SS-6), tagged `baseline-v2` |
| SS6 — the cirrus standard | ✅ Shipped | [#7](https://github.com/sourceplane/supabase-starter/pull/7) (SS-7), [#8](https://github.com/sourceplane/supabase-starter/pull/8) (SS-8), tagged `baseline-v3` |
| SS7 — the domain is set later | ✅ Shipped | [#9](https://github.com/sourceplane/supabase-starter/pull/9) (SS-9), tagged `baseline-v4` |

## Departures from the upstream template

Expand Down Expand Up @@ -260,3 +261,50 @@ not list cloudflare`; restored, it passes.
-backend=false` and `validate` (1.15.3) on the root are green on their
own, the lock file unchanged.
- `orun task check SS-7` complete.

## The domain is set later (SS7, SS-9)

The console asked for the product's domain, with help text that said it did
not need to exist — and nothing in the build needed one: the app answers on
workers.dev from its first deploy, its origin (the build's absolute links and
the Supabase project's Auth Site URL and redirect allow-list) is `SITE_URL`
when an environment sets it and the environment's workers.dev URL when it does
not, and the one place the repository names the domain is `BASE_DOMAIN` under
each environment's `env:` in `intent.yaml`, which nothing builds a URL from. A
domain is an owner's step after the bootstrap (README, "Custom domain"), so
the form no longer asks for it.

- `blueprint.yaml` declares no `productdomain` input; the console's Product
step asks for the product's name alone.
- `repo-blueprint.yaml`'s `productdomain` is optional, default empty. No hook,
probe or `when:` reads it — the only use is the `.rebrand/values.json`
template, which writes `""`. A hand-run build may still pass
`--set productdomain=` for a product that already has its domain.
- `rebrand.mjs` no longer requires it. Empty, it brands the reserved
placeholder `<reponame>.example.com` (RFC 2606 — never someone else's
domain) where the domain goes — `BASE_DOMAIN` in dev, stage and prod — so
setting it later is replacing one string; the product README and
`ai/context/operations.md` say so, beside the `SITE_URL` that actually moves
the app's links and Auth onto the domain.
- The Supabase project's Auth URLs are unchanged: `main.tf` still builds the
Site URL and redirect allow-list from `SITE_URL`, else
`https://<repo>-web-<env>.<subdomain>.workers.dev`. The placeholder never
reaches Auth.
- `testing/fixtures/acme.json` carries no domain, so the leak gate, the offline
bootstrap and the e2e tier exercise exactly what a console build supplies;
`testing/rebrand.test.sh` pins the placeholder for an absent and an empty
domain; `baseline.yml`'s blueprint read sets no domain.

Nothing that needs a domain was removed — it waits for one.

Verified: `testing/{manifest,phases,coverage,rebrand,retouch,bootstrap-defer}.test.sh`
green (rebrand: 31 checks, the two new ones included); `gen-component-docs.py
--check` green (3 components); `orun new --status` on `repo-blueprint.yaml`
with no domain (01-product pending, 112 files), `testing/leak.test.sh` (112
files derived, 104 text files read) and `testing/placement.test.sh` (112
tracked files; supabase → web enforced on stage and prod; `--resume` changes
nothing) at v2.58.11. The offline bootstrap of the fixture, which names no
domain, writes `"productdomain": ""` and brands `acme-supabase.example.com`
into the product's three `BASE_DOMAIN` lines, its README and its
`operations.md` (5 lines, 3 files), with no `supabase-starter.example.com`
left. `orun task check SS-9` complete.
Loading
Loading