refactor(docker): share env/common GMS values between Docker and Docker-free
Stacked on #21829.
Docker GMS services now read env/common/gms.env, the file the Docker-free stack already reads, so both stacks share one copy of these values. Docker's own copies are deleted. The effective env of every service is unchanged on both stacks.
Keys now shared
Opt-in defaults (KEY=${KEY:-default}): ALTERNATE_MCP_VALIDATION, STRICT_URN_VALIDATION_ENABLED, ENTITY_VERSIONING_ENABLED, THEME_V2_DEFAULT, SHOW_HAS_SIBLINGS_FILTER, SHOW_SEARCH_BAR_AUTOCOMPLETE_REDESIGN, SEARCH_BAR_API_VARIANT, SHOW_HOME_PAGE_REDESIGN, DEV_TOOLING_ENABLED, VIEW_AUTHORIZATION_ENABLED, DATAHUB_BASE_PATH, DATAHUB_GMS_BASE_PATH, MCL_CONSUMER_BATCH_ENABLED, USAGE_AGGREGATION_ENABLED, USAGE_AGGREGATION_FLUSH_INTERVAL_SECONDS, USAGE_AGGREGATION_ALIGNMENT_PERIOD_SECONDS, USAGE_AGGREGATION_INCLUDE_AGENT_NAME.
Literals: ELASTICSEARCH_LIMIT_RESULTS_STRICT, GRAPH_SERVICE_DIFF_MODE_ENABLED, ENTITY_SERVICE_ENABLE_RETENTION, UI_INGESTION_ENABLED, CONFIG_ENTITY_REGISTRY_USE_OPTIMIZED_LOADING, GRAPHQL_SHAPE_LOGGING_* (5 keys), ZDU_STAGE_10, ZDU_STAGE_20.
They are removed from env/docker/gms.env and from the GMS environment: anchor (including four restated DEV_TOOLING_ENABLED lines). That anchor is used only by GMS services, so no other service loses a key. Cassandra's ZDU_STAGE_20=false comes from env/docker/variants/cassandra/gms.env, which is later in the list, so it still wins. Exception: Docker keeps DATAHUB_BASE_PATH and DATAHUB_GMS_BASE_PATH in environment: (x-datahub-common), which wins over the shared file and reads the same shell value.
Moved to env/docker-free
ES_BULK_ACK_AFTER_TRANSFER=true and POLICY_CACHE_REFRESH_INTERVAL_SECONDS=10 differ on Docker (unset, and 120). They move from env/common/gms.env to env/docker-free/gms.env, so env/common holds only values that are equal on both stacks.
Who reads env/common
- Every Docker GMS service:
env/common/all.env(optional; does not exist) thenenv/common/gms.env, first in eachenv_filelist (base, debug, and the six variant lists). - Not Docker
system-update: it keeps its env unchanged and does not read GMS files. - Not mae-consumer, mce-consumer, frontend, actions or ai-service: there is no
env/common/<service>.envfor them. datahub-dev env listshowsenv/commonfirst inlayers.
The legacy docker/mysql/docker-compose.mysql.yml fragment now lists env/common/gms.env before env/docker/gms.env, so it keeps the values removed from the Docker file.
Verification
Each check below compares the base branch with this branch:
compose_env_snapshot.py(from #21820) scenariosbare,shell,smoke,ai,zdu: no differences (71 scenarios;debug-frontendis known-broken on the base too). Theshellscenario sets each opt-in key in the shell, which shows the keys stay opt-in.gradlescenarios (all 27quickstart_configskeys), run on scratch copies with the print task'sdocker/build.gradle: no differences (quickstartDebugSearchSplitis known-broken on the base too).gms-lite-stack.py --print-envfor each job (none,smoke-test,playwright) and mode (local,ci): identical values, apart fromINDEX_PREFIX, which comes from the checkout path. Only the source of the two moved keys changes.python3 smoke-test/check_env_parity.py: exit 0, allowlist unchanged../gradlew :scripts:dev:test: pass../gradlew :docker:generateQuickstartComposeConfigthengit diff --exit-code docker/quickstart/: clean.
Checklist
- The PR conforms to DataHub's Contributing Guideline (PR title format)
- Links to related issues (if applicable)
- Tests for the changes have been added/updated (if applicable):
_docker_layer_orderunit test - Docs related to the changes have been added/updated (if applicable):
env/README.md - For any breaking change/potential downtime/deprecation/big changes an entry has been made in Breaking Changes: not a breaking change
🤖 Generated with Claude Code
Summary by cubic
Docker GMS services now read env/common/gms.env, the file the Docker-free stack already reads, so both stacks share one source of common GMS values and Docker's own copies are removed. The effective environment of every service is unchanged on both stacks.
The shared keys are opt-in defaults like ALTERNATE_MCP_VALIDATION and literals like ELASTICSEARCH_LIMIT_RESULTS_STRICT. The two keys that differ on Docker, ES_BULK_ACK_AFTER_TRANSFER and POLICY_CACHE_REFRESH_INTERVAL_SECONDS, move to env/docker-free/gms.env. Docker GMS services list env/common/all.env (optional) and env/common/gms.env first in each env_file list; system-update and the other services don't read env/common.
Verification
- Compose env snapshots, gradle quickstart configs,
gms-lite-stack.py --print-env, andcheck_env_parity.pyall show effective env identical to the base branch.