Skip to content

Commit 1c49238

Browse files
authored
chore(cli): remove per-command SIDE_EFFECTS.md files (#7727)
Removes the per-command `SIDE_EFFECTS.md` files and `apps/cli/src/SIDE_EFFECTS_TEMPLATE.md`. They duplicated what the handlers, tests and user docs already state, and they drifted out of date. - Rationale that existed only in those files now lives next to the code as short comments, or in the existing guides (`apps/cli/docs/compute-commands.md`, `stack-commands.md`, `command-target.md`). - `apps/cli/AGENTS.md` names tests, the error-tag fixture, the telemetry event catalog and shipped behavior as the source of truth. - The automated review prompts judge breaking changes against what the stable release ships and what the tests at the merge base assert, instead of the old `SIDE_EFFECTS.md`. - ADRs are left unchanged as historical records.
1 parent ed2b011 commit 1c49238

153 files changed

Lines changed: 93 additions & 16722 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/ai-review/adjudicate-prompt.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ higher than `minor`; these findings are advisory and never block the PR.
9696
Verify each `breaking-change` finding against the behavior the PR changes:
9797
refute it only when no released, non-experimental use fails or changes meaning,
9898
when the change only rejects a value that never had a meaning, or when the
99-
change matches the old `SIDE_EFFECTS.md`. The PR's intent, tests and
100-
`SIDE_EFFECTS.md` edits are not counter-evidence. Keep the category
99+
change restores behavior that the current stable release ships. The PR's
100+
intent and its own test or doc edits are not counter-evidence. Keep the category
101101
`breaking-change`, severity `major` and the request ending its `claim`, even
102102
when merged with a Codex finding.
103103

‎.github/ai-review/claude-review-prompt.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ errors, even when that is the fix the PR set out to make. Use category
113113
`type(scope)!:` title, a `BREAKING CHANGE:` line in the PR description and, on
114114
`develop`, a retarget to `next`. Do not report internal code, tests, CI,
115115
additive changes, experimental commands, newly rejected values that never had a
116-
meaning, or fixes that match the old `SIDE_EFFECTS.md`.
116+
meaning, or fixes that restore behavior the current stable release ships.
117117

118118
## Output
119119

‎AGENTS.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ comment states only the why that the code cannot carry. Most code needs no comme
100100
### When to comment
101101

102102
Write a comment only for an invariant or constraint the types cannot express, an external quirk,
103-
a decision that would otherwise read as a bug, or a pointer to an ADR, `SIDE_EFFECTS.md`, docs
104-
page, or upstream issue. If the rationale needs more than three lines, move it to documentation.
103+
a decision that would otherwise read as a bug, or a pointer to an ADR, docs page, or upstream
104+
issue. If the rationale needs more than three lines, move it to documentation.
105105

106106
### How to comment
107107

‎apps/cli/AGENTS.md‎

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ src/commands/<command>/
2222
<command>.command.ts # command definition, flags, layer provision
2323
<command>.handler.ts # command implementation
2424
<command>.errors.ts # domain errors
25-
SIDE_EFFECTS.md # required compatibility contract
2625
```
2726

2827
Register every command in `src/cli/root.ts`. Keep `.format.ts` and `.encoders.ts` pure. Handler
@@ -59,16 +58,13 @@ limits; put richer content in reference page bodies.
5958

6059
The established CLI surface is a contract: command paths, flags, output text and streams,
6160
filesystem paths, API routes and request shapes, exit codes, and telemetry event timing and
62-
payloads. Use current tests, command `SIDE_EFFECTS.md`, and shipped behavior as the source of
63-
truth. Update tests and side-effect documentation with intentional behavior changes.
61+
payloads. Use current tests, the error-tag fixture, the telemetry event catalog, and shipped
62+
behavior as the source of truth. Update the tests, fixture, catalog entries, and user docs that
63+
an intentional behavior change affects.
6464

6565
State locations are also public: preserve `~/.supabase/…`, `<workdir>/supabase/.temp/…`, and
6666
native keyring entries. Do not move or rename them.
6767

68-
Every command has a `SIDE_EFFECTS.md` based on the [template](src/SIDE_EFFECTS_TEMPLATE.md), documenting exact
69-
files and formats, API calls and shapes, environment variables, and exit codes. Keep it accurate;
70-
it is the command compatibility checklist and an input to E2E coverage.
71-
7268
Every applicable command must preserve these invariants:
7369

7470
1. `linkedProjectCache.cache(ref)` and `telemetryState.flush` run through `Effect.ensuring`, on
@@ -107,8 +103,6 @@ rather than deleting it; `db remote commit` is the reference:
107103
- Keep the old flag and argument config so existing invocations reach the removal error, not a
108104
parse error, and register the command with `Command.unlisted`.
109105
- Delete the handler, its tests, and its docs pages, and remove its `withDeprecated` annotation.
110-
- `SIDE_EFFECTS.md` documents exit 1, the removal message and suggestion, and the post-run
111-
`telemetry.json` read and write under `SUPABASE_HOME`.
112106
- Test every tombstone through the real parser with and without its old flags, asserting the
113107
`RemovedSurfaceError` message and suggestion.
114108

@@ -198,7 +192,7 @@ Experimental paths may change outside the stable compatibility promise, but befo
198192
family identify published config, disk, server, and telemetry boundaries and record the approved
199193
compatibility decision in the PR. For the Compute transition, no local compatibility aliases or
200194
migrations are required. Compute error tags intentionally start new fingerprints; server-owned
201-
contracts remain unchanged. Update tests, generated schemas, and side-effect documentation.
195+
contracts remain unchanged. Update tests, generated schemas, and user docs.
202196

203197
## Telemetry
204198

@@ -225,8 +219,8 @@ path-valued `--output` remains redacted. Keep free-form user content redacted.
225219
Do not remove, rename, or reshape custom events. Preserve login aliasing after token persistence,
226220
link project and organization identity after the link write (including branch-link metadata),
227221
stack-started after health succeeds, and upgrade-suggested billing-gate events with their existing
228-
envelope and payload semantics. Use the catalog and the relevant command `SIDE_EFFECTS.md` for
229-
the complete current event contract.
222+
envelope and payload semantics. Use the catalog and the telemetry tests for the complete current
223+
event contract.
230224

231225
## Error classification
232226

‎apps/cli/docs/command-target.md‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
Every command that acts on a database or hosted project announces the target it resolved, once, before it acts. The same identity goes to machine consumers as the JSON `target` object.
44

5-
This page is the shared reference for how a command's target is chosen, which errors the selection raises, the deprecated selector flags, how a hosted write is confirmed, and what the banner and the JSON `target` carry. [ADR 0033](../../../docs/adr/0033-target-selection-and-hosted-mutation-consent.md) records why. The `SIDE_EFFECTS.md` of every `hosted`, `selectable` and `account` command opens with a `Target:` line that links here and lists only what is specific to that command: its own calls, files, exit codes and prompt, and any selector rule that differs from this page. A `local-only` command has no `Target:` line.
5+
This page is the shared reference for how a command's target is chosen, which errors the selection raises, the deprecated selector flags, how a hosted write is confirmed, and what the banner and the JSON `target` carry. [ADR 0033](../../../docs/adr/0033-target-selection-and-hosted-mutation-consent.md) records why.
66

77
## Groups
88

9-
The `Target:` line names the command's group and its consent default: `Target: <group>, consent default <No|Yes>`, or `Target: <group>, no consent` when the command never asks for hosted-mutation consent. A document that covers several subcommands gives each one's default.
9+
Every command belongs to one group, which decides what it acts on when no target is given and which selector flags it takes. A command that confirms hosted writes through the shared consent prompt also has a consent default.
1010

1111
| Group | Acts on | With no `--remote` | Selector flags |
1212
| ------------ | ------------------------------- | ------------------ | ---------------------------------------------------------------------------- |
@@ -91,8 +91,6 @@ A selector conflict lists only the selector flags the command has: `Only one of
9191
- `--remote=<url>`: `--password can't be used with --remote=<db-url>. Put the password in the connection string: postgres://USER:PASSWORD@HOST:PORT/postgres`
9292
- the local default: `--password only applies to a linked project. The local database uses [db].password from supabase/config.toml.`, followed by `To use the linked project instead, pass --remote.` in a linked checkout.
9393

94-
A command's own `SIDE_EFFECTS.md` records where else its password can come from and when it is withheld from a target.
95-
9694
## Deprecated selector flags
9795

9896
`--linked`, `--project-ref`, `--db-url` and `--local` (and `gen types --project-id`) still work in v3 and are removed in v4, as is the `linked` value of `db diff --from` and `--to`, which `remote` replaces. Each goes through the same resolver as the `--remote` form it maps to and prints a warning on stderr in every output format, before the `Target:` line. The warning names only the replacement:

‎apps/cli/docs/compute-commands.md‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,34 @@ confirmation first, and both default to no. `compute delete` asks for the
5959
compute's name to be typed back. Pass `--yes`, or set `SUPABASE_YES` in your
6060
shell, to confirm in scripts and CI; without it, a run that cannot prompt fails
6161
before changing anything.
62+
63+
## Excluding files from the build context
64+
65+
`compute push` packages a compute's source directory into the build context, minus the paths
66+
that `[compute.<name>] exclude` matches. Patterns follow `.gitignore`'s path rules:
67+
68+
- A pattern matches that name at any depth unless a `/` other than a trailing one anchors it
69+
at the compute's source directory: `dist/` matches every `dist` directory, `/dist/` only
70+
the top-level one.
71+
- A trailing `/` matches directories only. Repeated trailing separators count as one, so
72+
`dist/` and `dist//` are the same pattern.
73+
- `**` spans directories. Within one segment, `*`, `?` and character classes such as `[a-z]`
74+
work as in the CLI's other glob options; a class negates with `^` (`[^a]`), not `!`.
75+
76+
An excluded directory is not descended into, so everything beneath it is out too, and the
77+
`excluded <n> paths` count on the packaged line counts the directory, not its contents. For
78+
the same reason, a trailing `**` matches what is inside a directory rather than the directory
79+
itself: `cache/**` empties `cache` and keeps the directory, while `cache` removes it.
80+
81+
Re-inclusion with `!` is refused rather than read as a file name: a pattern re-admitting a
82+
path beneath an excluded directory could never be reached. Empty patterns, empty path
83+
segments (`src//dist`) and malformed character classes are refused too. Every refusal names
84+
the compute and the pattern, and happens before anything is packaged or uploaded.
85+
86+
`compute push` applies only the patterns recorded in the config; it has no built-in defaults,
87+
so a compute without an `exclude` key uploads its whole source directory. `compute new`
88+
writes the selected runtime's default list into the project config, where it can be edited.
89+
90+
A source whose every file is excluded fails before upload with an error naming the compute's `exclude` setting.
91+
An excluded symbolic link is skipped before the CLI checks whether it points outside the
92+
source directory, so excluding a hoisted `node_modules` link resolves the escaping-link error.

‎apps/cli/docs/stack-commands.md‎

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,7 @@ primary database without changing other services (webhooks setup only, creating
293293
`supabase start` while that postgres-only stack is running stops it and starts the full
294294
configured stack, keeping data. `--from-backup` is not supported on the stack path.
295295
A local `db reset` and declarative resets rebuild the existing database while retaining stack
296-
identity, ports, and composition. See
297-
[`db/reset/SIDE_EFFECTS.md`](../src/commands/db/reset/SIDE_EFFECTS.md).
296+
identity, ports, and composition.
298297

299298
A local `gen types` and `inspect db …` resolve the project stack through the same
300299
local database target as `db dump`. They do not start a stack.
@@ -384,8 +383,7 @@ bucket seeding and stack `storage` commands then also need
384383
`NODE_EXTRA_CA_CERTS="$(mkcert -CAROOT)/rootCA.pem"`), and
385384
containers must reach the host from loopback: on macOS, Docker Desktop, colima and Podman machine
386385
do; on Linux, rootful Docker, rootful Podman and rootless Podman on pasta don't, so a start that
387-
serves the API over TLS fails there with `api.tls: unsupported networking`. The `stack start` side
388-
effects list its errors.
386+
serves the API over TLS fails there with `api.tls: unsupported networking`.
389387

390388
Stack mode keeps its state under `SUPABASE_HOME` and never reads or writes `supabase/.temp`: Storage
391389
uploads live in `stacks/<stack-id>/uploads`, command scratch output (pgdelta debug bundles, Functions
@@ -436,9 +434,23 @@ release line or major) is refused. The refusal offers to keep the data by pinnin
436434
`local.services.database.version` in your config file, setting `db.major_version` back when the major differs and removing any
437435
`db.orioledb_version` when an OrioleDB build is requested, or to run `supabase stack destroy` and recreate it. `supabase link`
438436
and `supabase stack update` warn when the versions they lock would be refused by an existing stack's
439-
data. A database that never initialized adopts the change. See the [`start` side
440-
effects](../src/commands/experimental/stack/start/SIDE_EFFECTS.md#service-versions-and-the-lock) for
441-
details.
437+
data. A database that never initialized adopts the change.
438+
439+
The project lease is `supabase/.supabase.lock.lease`. Before taking it, the CLI adds it and the
440+
lock's staged writes (`.supabase.lock.*.tmp`) to `supabase/.gitignore` when they are missing. A
441+
frozen start reads the lock without the lease and leaves `supabase/.gitignore` untouched; lock
442+
writes are atomic renames, so it never sees a partial file.
443+
When a `linked` service's observed release cannot be fetched because the release host is
444+
unreachable, the start keeps going with the bundled version, recorded as `unobserved`, and warns;
445+
any other failed resolution fails the start without writing the lock.
446+
447+
`supabase db reset`, the shadow database of `supabase db diff`, and the temporary Functions instance
448+
of `supabase functions serve` read the lock without the lease and never resolve. Without a lock
449+
they use the versions this CLI bundles, and an explicit service version it does not bundle fails
450+
with `supabase/supabase.lock not found; run supabase start to create it`. A stale lock fails with
451+
`is stale for: <service> (<reason>)`, except for a shadow database of a remote with a
452+
`[remotes.<ref>]` block, which takes the bundled version of each stale service and fails only when
453+
one of them has none.
442454

443455
## Port intents
444456

@@ -548,9 +560,7 @@ core. A project with no `[storage.buckets]` or
548560
`[storage.vector.buckets]` configured resolves no credentials and prints nothing. Auto-confirm is
549561
safe here since a first-start stack has no pre-existing buckets. Any other unusable Storage state,
550562
a missing capability/endpoint, a gateway activation failure, or an invalid bucket entry fails the
551-
`start` command; startup does not silently skip the configured seed. See
552-
[`stack/start/SIDE_EFFECTS.md`](../src/commands/experimental/stack/start/SIDE_EFFECTS.md).
563+
`start` command; startup does not silently skip the configured seed.
553564

554565
**A local `db reset` and declarative reset** reapply the catalog, migrations, and seeds before
555566
resuming the saved composition. Bucket-seeding failures warn after the database reset succeeds.
556-
See [`db/reset/SIDE_EFFECTS.md`](../src/commands/db/reset/SIDE_EFFECTS.md).

0 commit comments

Comments
 (0)