Commit bd4378b
Docker CLI: scope parallel .env handling to type=dev, exclude e2e (#49160)
The hybrid tools/docker/.env machinery added in #48643 (read parallel keys
as a base layer, conflict warnings, append-on-`up --name` persistence) gated
its read block on `up` and its persist block on `up --name`, but neither
checked `argv.type === 'dev'`.
The E2E framework runs `jetpack docker --type e2e --name t1 up -d`
(tools/e2e-commons/bin/e2e-env.sh), which sets argv.name. So running the
E2Es in a plain checkout wrote COMPOSE_PROJECT_NAME=jetpack_t1 and the
PORT_* keys into tools/docker/.env — reported in
#48643 (comment).
That pollution cascades: a subsequent bare `jetpack docker up` (type=dev)
reads the polluted .env, infers argv.name='t1' via augmentArgvFromEnvFile,
and silently brings the dev container up as jetpack_t1 on the E2E ports.
Fix: add an exported `shouldManageParallelEnv( argv )` predicate
(`type === 'dev' && _[1] === 'up'`) and gate both the read/conflict block
and the persist block through it — mirroring resolveDevCloneSource being
"correct on its own terms". E2E now neither reads parallel keys from nor
writes them to the shared .env, and uses its own 8889 default port. The
buildEnv/process-env path is untouched, so E2E's own container behavior is
unchanged.
Adds a shouldManageParallelEnv describe block (4 cases incl. the e2e
regression). tools/cli suite: 156 passed, 3 skipped.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 74e17f8 commit bd4378b
2 files changed
Lines changed: 51 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
343 | 343 | | |
344 | 344 | | |
345 | 345 | | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
346 | 361 | | |
347 | 362 | | |
348 | 363 | | |
| |||
810 | 825 | | |
811 | 826 | | |
812 | 827 | | |
813 | | - | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
814 | 832 | | |
815 | 833 | | |
816 | 834 | | |
| |||
901 | 919 | | |
902 | 920 | | |
903 | 921 | | |
904 | | - | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
905 | 925 | | |
906 | 926 | | |
907 | 927 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
197 | 198 | | |
198 | 199 | | |
199 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
200 | 229 | | |
201 | 230 | | |
202 | 231 | | |
| |||
0 commit comments