feat(dev): select env mode and job layer in datahub-dev Docker mode
Ā
DE
14h ago+191+191+012345678901234567890123456789-12-12-01234567890123456789
Stacked on #21821.
datahub-dev Docker mode now selects the env mode and job layer that the optional compose slots read.
_dev_env()exportsDATAHUB_ENV_MODE(ciwhenCIis set, elselocal), using the same rule as the Docker-free launcher.start --job smoke-test|playwrightand--mode local|cinow work in Docker mode. They are recorded per worktree, and_dev_env()exportsDATAHUB_ENV_JOB_DIRas an absolute path, sorebuild,env restart,resetandnukereuse them. When no job is recorded,_dev_env()drops aDATAHUB_ENV_JOB_DIRinherited from the shell, so it cannot select a job layer by accident. The job folders and mode names come from the Docker-free launcher.- A remote
startforwards--joband--modeto the remote runner. env listin Docker mode printslayers: the env files that exist and that compose reads for GMS, lowest precedence first.- Docs in
scripts/dev/README.mdandscripts/dev/AGENTS.md.
A plain start renders the same config as before: docker compose config is byte-identical with DATAHUB_ENV_MODE unset and set to local.
Job values that compose environment: already sets do not take effect until they move to layer files, because environment: beats env_file.
Verification
./gradlew :scripts:dev:test: 191 passed, 1 skipped.- A scratch job folder with an extra key in
gms.envrenders into the GMS service environment.
Checklist
- Conforms to the Contributing Guideline and PR title format
- Tests added
- Docs updated
- No breaking changes
š¤ Generated with Claude Code
Summary by cubic
datahub-dev Docker mode now selects the env mode and job layer for the optional compose slots, matching the Docker-free launcher.
start --job smoke-test|playwrightand--mode local|cinow work in Docker mode and on remote start, recorded per worktree sorebuild,env restart,resetandnukereuse them._dev_env()exportsDATAHUB_ENV_MODE(defaults tociwhenCIis set, elselocal; an explicit--modeoverrides it) andDATAHUB_ENV_JOB_DIRas an absolute path, dropping any stale inherited value when no job is recorded._dev_env()fails when the extension or job env folder does not exist, because compose lists them asrequired: falseand would skip a typo silently.--job/--modechoices come from the Docker-free launcher so the two modes stay in sync.env listprintslayers: the env files compose reads for GMS, lowest precedence first, including the extension folder whenDATAHUB_ENV_EXTENSION_DIRis set.- A plain
startkeeps rendering the same config as before. - Job values already set by compose
environment:keys do not apply until they move to layer files, becauseenvironment:overridesenv_file.