Repository navigation
refactor(smoke): select the ZDU env through a job folder - #21833
devashish2203 wants to merge 15 commits into
Conversation
docker/profiles/zdu-test.env moves to smoke-test/test_resources/zdu/env/all.env. The ZDU runner sets DATAHUB_ENV_JOB_DIR to that folder for every compose call, so the daily workflow no longer passes DATAHUB_LOCAL_COMMON_ENV and the phases drop their METADATA_SERVICE_AUTH_ENABLED=false shell export: the job file delivers the same value to the same services. Cleanup clears the job dir to restore dev defaults. Preflight no longer requires the ad-hoc file; when one is set it must exist and must not re-enable auth. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR SummaryOverview Phase compose env drops per-call Preflight no longer requires the ad-hoc env file; if Reviewed by Cursor Bugbot for commit 91def69. Bugbot is set up for automated code reviews on this repo. Configure here. |
Smart test selectionpytest smoke testsMode: active. Only the selection below runs for the pytest smoke tests on this PR (applied:
Selected scopes (7 files or classes, 26 tests)
Add the Playwright E2E testsThis run:
Add the commit |
There was a problem hiding this comment.
All reported issues were addressed across 22 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
- preflight: a bare bypass key in the ad-hoc env file also overrides the job layer (compose unsets it), so flag it. - cleanup: don't skip the env reset just because GMS is on the original tag; a container recreated during the run still carries the ZDU layer. - tests: nuke no longer passes DATAHUB_LOCAL_COMMON_ENV; the runner selects the job folder and its all.env holds the auth bypass. - fix two inaccurate comments. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # .gitignore
Every smoke job layer now sits under smoke-test/env/. The folder holds the same all.env; the framework still selects it itself. The Docker-free and Docker smoke layers never read the zdu/ subfolder, and the GMS-lite workflow's smoke-test/env/** path filter now excludes it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # env/README.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Stacked on #21832.
What changes
docker/profiles/zdu-test.envbecomes the job foldersmoke-test/env/zdu/(one file,all.env, same five keys and values). It has to beall.env, because the old file reached every DataHub service through the ad-hocDATAHUB_LOCAL_COMMON_ENVslot.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 itslocal/,ci/anddocker/subfolders,check_env_parity.pyreadssmoke-test/env/andsmoke-test/env/ci/, and the GMS-lite workflow'ssmoke-test/env/**path filter excludessmoke-test/env/zdu/**. It is not undersmoke-test/tests/, because a folder there without__init__.pyfails.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.METADATA_SERVICE_AUTH_ENABLED=falseshell export is removed from_shared.py,rolling_restart.pyandnuke_and_redeploy.py. Since refactor(docker): move Gradle spark settings into a job folder #21832, onlyenv/docker/gms.envreads it (${METADATA_SERVICE_AUTH_ENABLED:-true}), and the joball.envsets a literalfalselater in the sameenv_filelist.DATAHUB_LOCAL_COMMON_ENVthrough. It only copied the process env value, so removing it changes nothing.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.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).docker compose(ps, logs, health)up_stack)DATAHUB_LOCAL_COMMON_ENV+METADATA_SERVICE_AUTH_ENABLED=falseMETADATA_SERVICE_AUTH_ENABLED=false-eflagsDATAHUB_LOCAL_COMMON_ENV=empty.envDATAHUB_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 thanempty.env:docker/profiles/. This catches a leftoverzdu-test.envbefore compose fails with a missing-file error.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
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../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
🤖 Generated with Claude Code
Summary by cubic
Selects the ZDU test environment through a compose job folder (
smoke-test/env/zdu/all.env) instead of ad-hoc env slots. The runner setsDATAHUB_ENV_JOB_DIRon every compose call, so the daily workflow no longer passesDATAHUB_LOCAL_COMMON_ENVand phases drop theirMETADATA_SERVICE_AUTH_ENABLED=falseshell exports.docker/profiles/zdu-test.envmoves tosmoke-test/env/zdu/all.env, next to the other smoke job layers; the GMS-lite workflow's path filter excludes it.DATAHUB_LOCAL_COMMON_ENV; if set, the file must exist and must not setAUTH_POLICIES_ENABLED,REST_API_AUTHORIZATION_ENABLED, orMETADATA_SERVICE_AUTH_ENABLEDto anything butfalse— including bare keys, which compose unsets.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.DATAHUB_ENV_JOB_DIRfrom the job folder when the tree has one, falling back to the old ad-hoc file for older trees.Written for commit fba4dbb. Summary will update on new commits.