Skip to content

refactor(docker): move frontend, actions and ai-service env into env/docker - #21828

Open
devashish2203 wants to merge 5 commits into
pfp-8941-env-anchors-debugfrom
pfp-8941-env-anchors-frontend
Open

devashish2203 wants to merge 5 commits into
pfp-8941-env-anchors-debugfrom
pfp-8941-env-anchors-frontend

Conversation

@devashish2203

@devashish2203 devashish2203 commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #21827.

Moves the environment: values of the frontend, actions and ai-service compose services into env/docker layer and variant files. The rendered compose config is unchanged in every scenario.

Moved keys

Key Service(s) From To
DATAHUB_GMS_HOST, THEME_V2_DEFAULT, PLAY_HTTP_CONTEXT, LOG_AGGREGATOR_ENDPOINT, DATAHUB_AI_SERVICE_URL all frontend frontend service anchor env/docker/frontend.env (replaces stale DATAHUB_GMS_HOST line; stale DATAHUB_SECRET line removed)
DATAHUB_ANALYTICS_ENABLED frontend debug dev template env/docker/variants/debug/frontend.env
ACTIONS_EXTRA_PACKAGES, ACTIONS_CONFIG, SCHEMA_REGISTRY_URL all actions three templates + pgQueue anchor env/docker/actions.env (replaces stale SCHEMA_REGISTRY_URL)
DATAHUB_ACTIONS_SYSTEM_CONFIGS_PATH, PGQUEUE_HOST_PORT, PGQUEUE_DATABASE, PGQUEUE_USERNAME, PGQUEUE_PASSWORD, DATAHUB_PGQUEUE_SCHEMA, DATAHUB_PGQUEUE_TABLE_PREFIX 4 non-CDC Postgres actions services pgQueue anchor env/docker/variants/postgres/actions.env
DATAHUB_GMS_URL, DATAHUB_AI_MCP_ENABLED ai-service ai-service anchor new env/docker/ai-service.env (now a required entry)

The debug frontend services and the non-CDC Postgres actions services get their own anchored env_file lists (x-env-files-frontend-debug, x-env-files-actions-postgres) with the variant in place. The postgres-cdc actions services never used pgQueue and keep the base list.

Kept in environment:

  • JAVA_TOOL_OPTIONS (frontend debug): tied to debug port 5002.
  • AWS_PROFILE (bare pass-through) and AWS_SDK_LOAD_CONFIG (actions): tied to the ~/.aws mounts.
  • DATAHUB_AI_PORT: tied to the container port mapping.
  • PYTHONPATH (ai-service dev): tied to the source mounts.
  • DATAHUB_BASE_PATH, DATAHUB_GMS_BASE_PATH, DATAHUB_SYSTEM_CLIENT_SECRET (frontend): the GMS-side services keep them in environment: too, so all read the same shell value.
  • DATAHUB_SECRET (frontend): no env layer or ad-hoc file can replace it with a short legacy value, which stops Play 3 from starting.
  • DATAHUB_AI_TRUSTED_PROXIES (ai-service): only the frontend is trusted to name the client host; no env layer can widen that.

Interpolation: PLAY_HTTP_CONTEXT=${DATAHUB_BASE_PATH:-/} (frontend), SCHEMA_REGISTRY_URL (actions) and DATAHUB_GMS_URL (ai-service) read the base paths, which no file in their lists sets, so they resolve from the shell as the environment: values did.

Verification

Rendered with compose_env_snapshot.py (from #21820) on a clean copy of the base and on this branch, then diffed:

  • bare and shell (every profile), smoke, ai (both embedding variants), zdu: no differences (71 scenarios; debug-frontend is known-broken on the base too).
  • gradle: all 27 quickstart_configs keys, with the print task's docker/build.gradle copied over scratch copies only: no differences (quickstartDebugSearchSplit is known-broken on the base too).
  • Ad-hoc files (smoke-test/test_resources/actions/actions.env, CI ai-gms.env, smoke.common.env, zdu-test.env, spark smoke-gms.env) set none of the moved keys, so no precedence change.
  • ./gradlew :docker:generateQuickstartComposeConfig then git diff --exit-code docker/quickstart/: clean, no env_file key.
  • python3 smoke-test/check_env_parity.py: exit 0.

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): rendered-config snapshot diff, no new tests
  • 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

Moves the environment: values of the frontend, actions, and ai-service compose services into env/docker layer and variant files. The rendered compose config is unchanged in every scenario.

Refactor details

  • Frontend values move to env/docker/frontend.env, replacing its stale DATAHUB_GMS_HOST and DATAHUB_SECRET lines; ai-service values move to the new required env/docker/ai-service.env; actions values move to env/docker/actions.env, with pgQueue values for non-CDC Postgres services in env/docker/variants/postgres/actions.env and the debug analytics default in env/docker/variants/debug/frontend.env.
  • The debug frontend and non-CDC Postgres actions services get variant-aware env_file lists; postgres-cdc actions services keep the base list.
  • Keys tied to a service port or mount (JAVA_TOOL_OPTIONS, AWS_PROFILE/AWS_SDK_LOAD_CONFIG, DATAHUB_AI_PORT, PYTHONPATH) stay in environment:, as do DATAHUB_SECRET and DATAHUB_AI_TRUSTED_PROXIES, which an env layer could otherwise override (a short legacy secret stops Play 3 from starting; a wider trusted-proxies list would trust forwarded hosts from other peers).
  • Rendered configs were diffed against the base branch across all profiles and scenarios with no differences.

Written for commit 3468bdb. Summary will update on new commits.

View guided diff Turn on auto-fix

…docker

Move the frontend, actions and ai-service values out of the
docker/profiles compose anchors into env/docker layer and variant files:

- Frontend values go to env/docker/frontend.env, replacing the stale
  DATAHUB_GMS_HOST and DATAHUB_SECRET lines it carried. The debug
  analytics default goes to env/docker/variants/debug/frontend.env, read
  by the debug frontend services through their own env_file list.
- Actions values go to env/docker/actions.env, replacing the stale
  SCHEMA_REGISTRY_URL line. The pgQueue values of the non-CDC Postgres
  services go to env/docker/variants/postgres/actions.env.
- ai-service values go to the new env/docker/ai-service.env, now a
  required entry like the other service files.

The rendered compose config is unchanged in every scenario, and no ad-hoc
env file sets a moved key. Keys stay in environment: where they are tied
to a port or mount of the same service: JAVA_TOOL_OPTIONS (debug port),
AWS_PROFILE and AWS_SDK_LOAD_CONFIG (~/.aws mounts), DATAHUB_AI_PORT and
PYTHONPATH (source mounts).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the devops PR or Issue related to DataHub backend & deployment label Dec 2, 2026
@cursor

cursor Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

PR Summary

Overview
This PR relocates inline environment: settings for frontend, actions, and ai-service into the env/docker layering model, matching how other DataHub Docker services are configured.

Frontend values such as PLAY_HTTP_CONTEXT, THEME_V2_DEFAULT, DATAHUB_AI_SERVICE_URL, and related settings move into env/docker/frontend.env. Debug frontend profiles use a new x-env-files-frontend-debug anchor that also pulls env/docker/variants/debug/frontend.env (e.g. DATAHUB_ANALYTICS_ENABLED). Secrets and base paths (DATAHUB_SECRET, DATAHUB_BASE_PATH, DATAHUB_GMS_BASE_PATH, DATAHUB_SYSTEM_CLIENT_SECRET) stay in compose environment: so shell interpolation stays aligned with GMS-side services.

Actions shared settings (ACTIONS_*, updated SCHEMA_REGISTRY_URL) land in env/docker/actions.env. The old postgres pgQueue environment: anchor is replaced by x-env-files-actions-postgres, which layers env/docker/variants/postgres/actions.env for the four non-CDC Postgres action services. CDC postgres actions keep the base env file list. AWS-related pass-throughs remain inline with the volume mounts.

AI service gets a required env/docker/ai-service.env (DATAHUB_GMS_URL, DATAHUB_AI_MCP_ENABLED). DATAHUB_AI_TRUSTED_PROXIES and DATAHUB_AI_PORT stay in compose so proxies and port mapping cannot be overridden by later env layers.

env/README.md documents ai-service in the docker env layout. The PR author reports rendered compose output is unchanged across verified scenarios.

Reviewed by Cursor Bugbot for commit 4b3466e. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Smart test selection

pytest smoke tests

Mode: active. Only the selection below runs for the pytest smoke tests on this PR (applied: smart).

  • Selection: smart: tests for the tagged features, plus always-run modules, this PR's changed tests, and the plumbing sample if the PR changes the pytest harness
  • Size: 126 of 853 tests in 1 batch, predicted longest batch ~2 min
  • Tags: change-type: docs; feature-dev: authentication; feature-user: analytics
  • Confidence: MEDIUM (9 changed files)
  • Classifier reasoning: Docker compose and env files move frontend base paths, the play secret, and analytics toggles, plus AI service and actions env wiring; only the analytics toggle and the frontend secret map cleanly to taxonomy tags.

Medium confidence: a wrong tag means tests are skipped, so check the tags above against what this PR touches.

Selected scopes (15 files or classes, 126 tests)
  • tests/e2e/analytics/test_analytics.py
  • tests/e2e/analytics/test_highlights.py
  • tests/e2e/audit_events/audit_events_test.py
  • tests/e2e/authorization/test_self_entity_auth.py
  • tests/e2e/delete/delete_assertion_cascade_test.py
  • tests/e2e/frontend/test_static_asset_encodings.py
  • tests/e2e/mcp/mcp_test.py
  • tests/e2e/read_only/test_analytics.py
  • tests/e2e/read_only/test_services_up.py
  • tests/e2e/search/test_search_projection.py::TestSearchProjection
  • tests/e2e/service_accounts/test_service_accounts.py
  • tests/e2e/test_authentication_e2e.py
  • tests/e2e/test_e2e.py
  • tests/e2e/tokens/revokable_access_token_test.py
  • tests/e2e/tokens/session_access_token_test.py

Add the run-all-tests:pytest label to run the full pytest suite on this PR.

Playwright E2E tests

This run: smart

  • Selection: smart: specs tagged analytics, authentication plus the tests the change affects
  • Size: 16 tests in 6 spec files, ~2 min predicted on 1 shard(s)
Specs selected because of this PR (6)
Spec Tests Why
analytics/analytics.spec.ts 2/2 tagged analytics
auth/login-with-welcome-modal.spec.ts 3/3 tagged authentication
auth/login.spec.ts 6/6 tagged authentication
login-v2/v2-login.spec.ts 1/1 tagged authentication
settings-v2/v2-manage-access-tokens.spec.ts 1/1 tagged authentication
settings-v2/v2-manage-service-accounts.spec.ts 3/3 tagged authentication

Add the run-all-tests:playwright label to run the full Playwright suite on this PR.

commit 3468bdb · workflow run

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 9 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread docker/profiles/docker-compose.ai.yml Resolved
@codecov

codecov Bot commented Dec 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

# Conflicts:
#	docker/profiles/docker-compose.frontend.yml
#	env/docker/frontend.env

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b73214d. Configure here.

…ompose environment

An env layer or ad-hoc env file could otherwise override them: a short
legacy DATAHUB_SECRET stops Play 3 from starting, and a wider
DATAHUB_AI_TRUSTED_PROXIES would trust forwarded hosts from other peers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 4 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

@david-leifker david-leifker left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

This branch was successfully deployed

1 active deployment
Preview — 3468bdbe Deployed Dec 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devops PR or Issue related to DataHub backend & deployment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants