Repository navigation
refactor(docker): add optional env layer slots to compose env_file lists - #21821
devashish2203 wants to merge 5 commits into
Conversation
Every DataHub service env_file list in docker/profiles now names the optional layer files, lowest precedence first: env/docker/all.env and the service file, the env/docker/<mode>/ files, an extension slot (DATAHUB_ENV_EXTENSION_DIR), and a job slot (DATAHUB_ENV_JOB_DIR, then its mode and docker/ subfolders). The existing ad-hoc slots stay last. All new entries are `required: false`. An unset directory variable resolves to a folder that does not exist, so the rendered config is unchanged until a variable is set or a layer file is added. The gms-dev service reuses the gms list through a YAML anchor. docker/profiles now needs Docker Compose 2.24.0 or later for optional env_file entries. The flattened quickstart compose file has no env_file entries and is unaffected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR SummaryOverview Requires Docker Compose 2.24.0+ for optional Reviewed by Cursor Bugbot for commit f69c187. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
All reported issues were addressed across 6 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Smart test selectionpytest smoke testsMode: active. Only the selection below runs for the pytest smoke tests on this PR (applied:
Medium confidence: a wrong tag means tests are skipped, so check the tags above against what this PR touches. Selected scopes (3 files or classes, 10 tests)
Add the Playwright E2E testsThis run:
Add the commit |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Optional env_file entries in the profile compose files need Compose 2.24.0 or later. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The profile compose files use optional env_file entries, which need Compose 2.24.0. Rename the check to minDockerCompose2.24, update the developer prerequisites and add a breaking-changes entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Stacked on #21819 (moves the service env files to
env/docker/). Review that PR first.What
Every DataHub service
env_filelist indocker/profiles/(system-update, gms and gms-dev, mae-consumer, mce-consumer, frontend, actions, ai-service) now names the optional layer files. Order, lowest precedence first:env/docker/all.env, the existingenv/docker/<service>.env, then the same names inenv/docker/${DATAHUB_ENV_MODE:-local}/${DATAHUB_ENV_EXTENSION_DIR}/docker/{all,<service>}.env${DATAHUB_ENV_JOB_DIR}/{all,<service>}.env, then its${DATAHUB_ENV_MODE}/subfolder, then itsdocker/subfolderDATAHUB_LOCAL_COMMON_ENV,DATAHUB_LOCAL_<SERVICE>_ENV) stay lastAll new entries are
required: false, and no layer files are added. An unset directory variable resolves todocker/profiles/.unset/…, which does not exist, so Compose skips the entry with no warning. Every slot does nothing by default, and the rendered config of every profile is unchanged. The gms-dev service reuses the gms list through a YAML anchor. The order and the variables are documented inenv/README.mdunder "Docker stack".Compose version
Optional
env_fileentries need Docker Compose 2.24.0 or later (Compose docs).docker/README.mdnow states this fordocker/profiles/, and the prerequisites indocs/developers.mdnow list Docker Compose >=2.24. The flatteneddocker/quickstart/docker-compose.quickstart-profile.ymlused bydatahub docker quickstarthas noenv_fileentries, so the CLI quickstart and its Compose compatibility matrix are unaffected.The minimum Docker Compose version for the profiles is now 2.24.0 (was 2.20), enforced by the Gradle check
:docker:minDockerCompose2.24. A breaking-changes entry is added.Verification
docker compose config --format jsonfor all 33 profiles (231 profile/service pairs), on the base and on this branch: identical.debug-frontendfails to render on both, as before.DATAHUB_ENV_MODE=ci. Removing the highest file one at a time, the value from each next file in the order above won. An ad-hoc file beats the job layer. Theci/files are ignored whenDATAHUB_ENV_MODEis unset../gradlew :docker:generateQuickstartComposeConfig: no diff, and the file has noenv_filekey.python3 smoke-test/check_env_parity.py: passes.Checklist
🤖 Generated with Claude Code
Summary by cubic
Adds optional environment layer slots to every service
env_filelist indocker/profiles/, ordered lowest-precedence-first, so layer files can override defaults without changing the rendered config until used.env/docker/all.env, the service file, theDATAHUB_ENV_MODEsubfolder, a${DATAHUB_ENV_EXTENSION_DIR}slot, and${DATAHUB_ENV_JOB_DIR}slots (root, mode subfolder,docker/subfolder), with the existing ad-hoc slots staying last.required: false; unset directory variables resolve to a non-existent.unsetfolder, so every slot is a no-op by default and rendered config is unchanged for all profiles.gms-devreuses the gms list via a YAML anchor.docker/profiles/now requires Docker Compose 2.24.0 or later; the quickstart compose file has noenv_fileentries and is unaffected.env/README.mdunder "Docker stack".Written for commit 2adb907. Summary will update on new commits.