refactor(smoke): select the ZDU env through a job folder
Stacked on #21832.
What changes
docker/profiles/zdu-test.env becomes the job folder smoke-test/env/zdu/ (one file, all.env, same five keys and values). It has to be all.env, because the old file reached every DataHub service through the ad-hoc DATAHUB_LOCAL_COMMON_ENV slot.
The folder sits with the other smoke job layers under smoke-test/env/. Neither smoke layer reads it: the launcher and the compose job slot read only a job folder's own files and its local/, ci/ and docker/ subfolders, check_env_parity.py reads smoke-test/env/ and smoke-test/env/ci/, and the GMS-lite workflow's smoke-test/env/** path filter excludes smoke-test/env/zdu/**. It is not under smoke-test/tests/, because a folder there without __init__.py fails .github/scripts/check_python_package.py.
ZDUTestRunnersetsDATAHUB_ENV_JOB_DIRto the absolute folder before its first compose call. Both entry points (python -m tests.zdu.frameworkandtest_zdu_upgrade.py) build the runner, and every compose call inherits the process env. Any job dir already set in the shell is replaced, so ZDU never mixes in another job's values.- The
METADATA_SERVICE_AUTH_ENABLED=falseshell export is removed from_shared.py,rolling_restart.pyandnuke_and_redeploy.py. Since #21832, onlyenv/docker/gms.envreads it (${METADATA_SERVICE_AUTH_ENABLED:-true}), and the joball.envsets a literalfalselater in the sameenv_filelist. - Nuke no longer carries
DATAHUB_LOCAL_COMMON_ENVthrough. It only copied the process env value, so removing it changes nothing. - Cleanup adds
DATAHUB_ENV_JOB_DIR=""(compose treats empty as unset) and keepsDATAHUB_LOCAL_COMMON_ENV=empty.env, so the dev stack goes back to its defaults. It skips the recreate only when GMS runs the original image tag and no longer hasZDU_TEST_FRAMEWORK_ENABLED, a key only the ZDU layer sets: every recreate during the run loads that layer, so the tag alone does not prove the default env. - Comments, READMEs,
run_test.md, the PDL patch README andenv/README.mdare updated. A staleupgrade_blocking.pycomment that said system-update has noenv_fileis fixed.
Per-phase compose env, before and after
Process env: before = DATAHUB_LOCAL_COMMON_ENV=zdu-test.env (from the workflow); after = DATAHUB_ENV_JOB_DIR=<repo>/smoke-test/env/zdu (set by the runner).
| Phase call | Before | After |
|---|---|---|
plain docker compose (ps, logs, health) | none | none |
nuke and redeploy (up_stack) | old pins + mounts + tokens + DATAHUB_LOCAL_COMMON_ENV + METADATA_SERVICE_AUTH_ENABLED=false | old pins + mounts + tokens |
| prepare old stack (recreate) | version + tokens | unchanged |
| rolling restart / shared recreate | version + tokens + mounts + METADATA_SERVICE_AUTH_ENABLED=false | version + tokens + mounts |
| system-update one-shot runs | update/version + mounts + tokens; -e flags | unchanged |
| cleanup (recreate) | version + tokens + DATAHUB_LOCAL_COMMON_ENV=empty.env | same + DATAHUB_ENV_JOB_DIR="" |
Preflight
Preflight no longer requires DATAHUB_LOCAL_COMMON_ENV, because the runner always supplies the auth bypass. If it is set to anything other than empty.env:
- The file must exist under
docker/profiles/. This catches a leftoverzdu-test.envbefore compose fails with a missing-file error. - The file must not set
AUTH_POLICIES_ENABLED,REST_API_AUTHORIZATION_ENABLEDorMETADATA_SERVICE_AUTH_ENABLEDto anything butfalse, and must not list them as bareKEYlines (compose then unsets them). The ad-hoc slot layers over the job slot, so such a line would turn auth back on.
Workflow
.github/workflows/zdu-e2e-daily.yml: one line removed, DATAHUB_LOCAL_COMMON_ENV: zdu-test.env. If it stayed, compose would fail on the deleted file.
Verification
- Hand-rendered each phase's real compose command and env, before and after, for the
debuganddebug-consumerstopologies. The command isdocker compose -f docker-compose.yml -f docker-compose.zdu-test-override.yml config, run once per phase env above, plus cleanup with the job dir unset. Every service's rendered model is identical in all 16 renders. A control run without the job dir does differ, so the check catches real changes. ./gradlew :smoke-test:stackFreePytest: 550 passed../gradlew :smoke-test:pythonLint: ruff check and ruff format pass. mypy reports two errors intests/e2e/knowledge/test_okf_reimport.py, a file this PR does not touch.python3 .github/scripts/check_python_package.py: passes.- Compose env snapshot (bare, shell, smoke, AI scenarios), before and after: no differences.
./gradlew :docker:generateQuickstartComposeConfigandgit diff --exit-code docker/quickstart/: clean.actionlinton the workflow: clean.
No runtime proof
The daily ZDU workflow does not run on PRs, and no stack was started for this change. All of the evidence above comes from rendered compose models and unit tests. Before merging, run the ZDU daily workflow on this branch manually (workflow_dispatch).
Checklist
- The PR conforms to DataHub's Contributing Guideline (particularly PR Title Format)
- Links to related issues (if applicable)
- Tests for the changes have been added/updated (if applicable)
- Docs related to the changes have been added/updated (if applicable)
- For any breaking change/potential downtime/deprecation/big changes an entry has been made in Breaking Changes (not needed: no effective value changes; only the ZDU test harness is affected)
š¤ Generated with Claude Code
Summary by cubic
Selects the ZDU test environment through a compose job folder instead of ad-hoc env slots. The file docker/profiles/zdu-test.env moves to smoke-test/env/zdu/all.env, the runner sets DATAHUB_ENV_JOB_DIR to that folder for every compose call, and the daily workflow no longer passes DATAHUB_LOCAL_COMMON_ENV. Phases drop their METADATA_SERVICE_AUTH_ENABLED=false shell exports since the job file delivers the same value.
- Preflight no longer requires
DATAHUB_LOCAL_COMMON_ENV; if set, the file must exist underdocker/profiles/and must not setAUTH_POLICIES_ENABLED,REST_API_AUTHORIZATION_ENABLED, orMETADATA_SERVICE_AUTH_ENABLEDto anything butfalseā including bare keys, which compose unsets and thereby drops the job layer's false. - Cleanup detects the ZDU layer by its
ZDU_TEST_FRAMEWORK_ENABLEDmarker instead of the image tag alone, so it resets the env even when a container recreated during the run already carries the original tag; it clearsDATAHUB_ENV_JOB_DIRand keepsDATAHUB_LOCAL_COMMON_ENV=empty.env. - The job folder lives at
smoke-test/env/zdu/, next to the other smoke job layers; neither smoke layer reads it, and the GMS-lite workflow'ssmoke-test/env/**path filter now excludes it. - Verification is limited to rendered compose models and unit tests; the ZDU daily workflow does not run on PRs, so run it manually before merging.