Commit 0e96d36
authored
ci(integration): isolate live-DB stacks instead of serialising them (#731)
* ci(integration): isolate live-DB stacks instead of serialising them
Integration jobs were being CANCELLED, not run — four times in ~80 minutes
on 2026-07-20, most recently the `db=supabase` leg of #712, which is the
exact variant that PR exists to fix.
Cause: the three integration workflows share one job-level concurrency
group, `integration-live-db-<db>`, deliberately not scoped by ref
(d02bf63) because two PRs contend for a fixed host port as much as two
pushes to one PR. But GitHub Actions allows only ONE in-progress plus ONE
pending run per group — a third contender is cancelled outright. With
three workflows funnelling into two keys, that fires under any load.
The failure mode is worse than a flake: a cancelled job never runs, so
its check goes ABSENT rather than red. The signal is silently lost, and
`main` is not branch-protected, so nothing blocks the merge.
Remove the contention rather than serialising it. A new `integration-db`
composite action gives every job:
- its own compose project name (run id + attempt + job + variant), so
container names cannot collide; and
- EPHEMERAL host ports — `CS_PG_PORTS` / `CS_PGRST_PORTS` carry a bare
container port, so compose publishes with no fixed host side and the
assigned port is read back with `docker compose port`.
Nothing is shared between jobs, so nothing needs to queue, and the
concurrency groups are gone from all three workflows. The compose files
keep their fixed 55432 / 55433 / 55430 mappings when the vars are unset,
so local dev and the help text in `test-kit/src/env.ts` are unchanged.
Dropped the pre-`up` `docker compose down` too. With unique project names
it is a no-op, and blanket-pruning is now actively unsafe: without the
concurrency group, another job's stack may be live on the same runner.
Also, since this adds a composite action: `.github/actions/` had no
CODEOWNERS rule, though such actions run arbitrary steps in the same job
with the same secrets as the workflow calling them. Added the rule and
the matching assertion in `supply-chain.e2e.test.ts` (verified it fails
without it). Fixed a stale claim in the Drizzle workflow header that
`PGRST_URL` is left unset — the matrix had been setting it.
Verified: compose interpolation resolves to the fixed mapping by default
and to an ephemeral publish under the CI vars (`docker compose config`);
YAML parses; the action's shell body is syntax-clean with no GitHub
templating interpolated into it; 18/18 supply-chain e2e tests pass.
* fix(ci): validate every port readback, not just Postgres
CodeRabbit caught a real asymmetry in the new action: `pg_port` was checked
for emptiness but the supabase branch built `pgrest_url` straight from
`$(port_of postgrest 3000)`. `docker compose port` exits 0 with EMPTY
stdout when a port is not bound, so an unbound PostgREST would have
silently yielded `http://localhost:` and handed every `PGRST_URL` consumer
(the Drizzle-supabase leg, both Supabase-workflow steps) a malformed URL
instead of the immediate error the Postgres path already gave.
Move the check into `port_of` itself so it applies by construction and the
asymmetry cannot come back, rather than adding a second call-site guard.
Each port is now captured in its own bare assignment so `set -e` fails the
step unambiguously on a non-zero `port_of`.
Verified with a stubbed `docker` that returns a port for `db` and nothing
for `postgrest`: the Postgres read succeeds, the guard fires for postgrest,
and the script exits 1 before exporting anything.1 parent cf2c57c commit 0e96d36
8 files changed
Lines changed: 237 additions & 98 deletions
File tree
- .github
- actions/integration-db
- workflows
- e2e/tests
- local
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
| 9 | + | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| |||
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
77 | 72 | | |
78 | 73 | | |
79 | 74 | | |
| |||
85 | 80 | | |
86 | 81 | | |
87 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
88 | 87 | | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
| 88 | + | |
99 | 89 | | |
100 | 90 | | |
101 | 91 | | |
| |||
110 | 100 | | |
111 | 101 | | |
112 | 102 | | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | 103 | | |
118 | 104 | | |
119 | 105 | | |
| |||
152 | 138 | | |
153 | 139 | | |
154 | 140 | | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
163 | 146 | | |
164 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
165 | 151 | | |
166 | 152 | | |
167 | 153 | | |
168 | 154 | | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
169 | 158 | | |
170 | 159 | | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
171 | 163 | | |
172 | 164 | | |
173 | 165 | | |
174 | 166 | | |
175 | 167 | | |
176 | 168 | | |
177 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
178 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
179 | 177 | | |
180 | | - | |
181 | | - | |
| 178 | + | |
| 179 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| 56 | + | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
66 | 68 | | |
67 | 69 | | |
68 | 70 | | |
| |||
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
| 79 | + | |
84 | 80 | | |
85 | 81 | | |
86 | 82 | | |
87 | 83 | | |
88 | 84 | | |
89 | 85 | | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | 86 | | |
95 | 87 | | |
96 | 88 | | |
| |||
109 | 101 | | |
110 | 102 | | |
111 | 103 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
118 | 109 | | |
119 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
120 | 114 | | |
121 | 115 | | |
122 | 116 | | |
123 | 117 | | |
124 | 118 | | |
125 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
126 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
127 | 129 | | |
128 | | - | |
129 | | - | |
| 130 | + | |
| 131 | + | |
0 commit comments