Repository navigation
ci(ai): build the datahub-ai-service image on every relevant PR - #21351
Conversation
PR SummaryOverview CI & image selection: Compose & quickstart: A new Build & tooling: The AI Dockerfile mounts netrc for the second Small MCP fix: Reviewed by Cursor Bugbot for commit 66f9777. Bugbot is set up for automated code reviews on this repo. Configure here. |
e005125 to
7cd9f53
Compare
1542892 to
73dbb4b
Compare
| curl -fsS http://127.0.0.1:9005/health | ||
| if [[ "$health" != healthy ]]; then | ||
| docker logs ai | ||
| exit 1 |
There was a problem hiding this comment.
Health failure hides container logs
Low Severity
The host curl to /health runs before docker logs, and GitHub Actions runs this step with set -e. When the container never listens, curl -fsS aborts the step, so the log dump in the unhealthy branch never runs. That is the usual failure mode this job exists to catch, and it leaves only a connection error instead of the process traceback.
Reviewed by Cursor Bugbot for commit 73dbb4b. Configure here.
There was a problem hiding this comment.
small one but valid, moving the unhealthy check + docker logs before the curl would keep the traceback when it never starts
Adds an image job to the DataHub AI Service workflow, so a Dockerfile change or a dependency bump that breaks the image fails in the pull request rather than in a release build: - builds the image with the same Gradle task the release uses; - fails when it grows past a 450 MB budget (about 365 MB today); - checks it runs as a non-root user and ships no curl; - starts it with GMS unreachable and requires it to report healthy within 30 seconds (about 6 seconds locally), since the service has to come up before GMS does. Multi-arch publishing, reuse of the quickstart tag and the image scan come with the quickstart change that puts the image in the release bake. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Quickstart profiles now start datahub-ai-service, and the frontend proxies http://localhost:9002/mcp to it, so an MCP client needs only the URL (no token while GMS auth is off). The plain `quickstart` profile leaves it out for now: `datahub docker quickstart` runs that profile with the latest release's images, and no release has published datahub-ai-service yet, so pulling it would stop the whole stack from starting. It joins that profile once a release ships the image. The other quickstart profiles (smoke tests, run-quickstart.sh) and the debug profiles run it. - docker/profiles/docker-compose.ai.yml: the service publishes 9005 on the host's loopback only; remote clients go through the frontend. No depends_on (it answers 503 until GMS is up) and no compose healthcheck (the image has one). It trusts X-Forwarded-Host only from the frontend. - The frontend gets DATAHUB_AI_SERVICE_URL=http://datahub-ai-service:9005. - Debug profiles (all but debug-min) run the checkout's datahub-ai-service and datahub-core-mcp-tools sources over the installed packages, so a restart picks up changes; the image builds with the other Python services. - generateQuickstartComposeConfig keeps the DATAHUB_MAPPED_AI_PORT, DATAHUB_AI_MCP_ENABLED and DATAHUB_AI_IMAGE overrides; the quickstart compose check fails if any user override is lost (the AI ones join that check when the service joins the `quickstart` profile). - The image joins the release bake (multi-arch, tagged and published with the other images) and every quickstart config whose compose profile runs it. CI's image plan builds it when packages/datahub-ai-service, packages/datahub-core-mcp-tools, docker/datahub-ai-service, metadata-ingestion or the shared uv/SSL snippets change, and otherwise reuses the quickstart tag. The security scan covers it like the other images. - datahub-dev: DATAHUB_MAPPED_AI_PORT in the slot port table (and so in remote tunnels); changes under either package rebuild only datahub-ai-service (`rebuild ai`). AGENTS.md maps both packages to the container. Tested with datahub-dev on a local OSS instance (GMS auth off): the service comes up healthy from the compose file, and through the frontend legacy and modern MCP clients call get_me with no token as the system user; a foreign Host/Origin gets 403, ?token= 400 and OPTIONS 405. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CI's package check compares find_packages with find_namespace_packages, and the gql directory had no __init__.py. Make it a package and declare its .gql files as its own package data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Installing metadata-ingestion and the two packages from source resolves their build requirements from the configured index. In CI that index needs the netrc secret, which only the lock install step mounted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FastMCP 4.2.5 serves subscriptions/listen, and on the 2026-07-28 protocol the SDK advertises listChanged whenever that handler is registered, overriding the notification options. Drop the handler: the server never sends change notifications, and an in-process bus can't reach clients on another replica. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
master now adds its own placeholder right after __SYSTEM_CLIENT_SECRET__. Keeping ours one line further down lets both changes merge without a conflict. The replacements are independent, so their order doesn't matter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 66f9777. Configure here.
| DATAHUB_GMS_BASE_PATH: ${DATAHUB_GMS_BASE_PATH:-/} | ||
| LOG_AGGREGATOR_ENDPOINT: ${LOG_AGGREGATOR_ENDPOINT:-} | ||
| # /mcp is proxied to datahub-ai-service (docker-compose.ai.yml). | ||
| DATAHUB_AI_SERVICE_URL: ${DATAHUB_AI_SERVICE_URL:-http://datahub-ai-service:9005} |
There was a problem hiding this comment.
Frontend proxies MCP without sidecar
Medium Severity
DATAHUB_AI_SERVICE_URL is defaulted on every frontend service, including the generated CLI quickstart file, while datahub-ai-service is still omitted from that profile. /mcp is 404 only while this URL is unset, so CLI quickstart now proxies to a hostname that is never started and returns 503 instead. Unlike MCP_SERVER_ENABLED, the value is also frozen, so it cannot be cleared at runtime.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 66f9777. Configure here.
Smart test selectionpytest smoke testsMode: shadow. The selection below is computed but not applied; this PR still runs the default matrix (
Selected scopes (81 files or classes, 378 tests)
Add the commit |


Stack. This is one PR in a series that adds a built-in MCP server to DataHub Core. It is based on
na--frontend-mcp-route(the previous PR in the stack); review only its own commit. This PR changes GMS, the frontend, Docker or CI, not only the new Python packages. Everything user-facing is behind a GMS feature flag,MCP_SERVER_ENABLED, off by default (added in #21349).Stack so far:
What this does
Adds an image job to the DataHub AI Service workflow, so a Dockerfile change
or a dependency bump that breaks the image fails in the pull request rather
than in a release build:
30 seconds (about 6 seconds locally), since the service has to come up
before GMS does.
Multi-arch publishing, reuse of the quickstart tag and the image scan come
with the quickstart change that puts the image in the release bake.
Testing
Checks run locally against the built image (healthy after 6 s); actionlint.
Checklist
🤖 Generated with Claude Code