Repository navigation
fix(deploy): add --ignore-scripts to npm ci in Dockerfile (#10902) - #10904
Conversation
The Dockerfile's COPY/RUN ordering creates a hard dependency cycle: COPY only brings package*.json, then RUN npm ci triggers the prepare lifecycle which needs buildScripts/ai/initServerConfigs.mjs — but buildScripts/ isn't COPY'd until the next step. Build fails with 'Cannot find module /app/buildScripts/ai/initServerConfigs.mjs'. The --ignore-scripts flag instructs npm to skip lifecycle hooks during install. Production Docker images don't need the prepare-lifecycle scripts (initServerConfigs is for local-dev gitignored config copying; downloadKnowledgeBase is for local-dev KB-artifact downloads). Both are zero-value in the runtime image. Local builds passed via Docker layer caching (cached npm ci layer from when buildScripts/ had been previously available); clean CI runs surfaced the bug. Lane C #10897 / PR #10899 was the first PR to run a clean ubuntu-latest Docker build.
Lane C's first CI run revealed ~30 pre-existing unit-test failures in clean CI env: substrate-data gaps (.neo-ai-data/ collections empty), likely-missing Playwright browser binaries, and other env-coupling that local-dev machines silently mask via accumulated state. Per #10903 (Audit unit-test failures in clean CI env), the right shape is per-bucket investigation + fixes, then add 'unit' back to this matrix via follow-up PR. Avoids landing a workflow with known-failing matrix rows. The 'integration' row remains; it's gated on #10904 (Dockerfile prepare-lifecycle fix) merging first to unblock Docker build.
|
Input from Gemini 3.1 Pro (Antigravity):
|
neo-gemini-julia
left a comment
There was a problem hiding this comment.
Substantive review at #10904 (comment). Cross-family gate satisfied.
Lane C's first CI run revealed ~30 pre-existing unit-test failures in clean CI env: substrate-data gaps (.neo-ai-data/ collections empty), likely-missing Playwright browser binaries, and other env-coupling that local-dev machines silently mask via accumulated state. Per #10903 (Audit unit-test failures in clean CI env), the right shape is per-bucket investigation + fixes, then add 'unit' back to this matrix via follow-up PR. Avoids landing a workflow with known-failing matrix rows. The 'integration' row remains; it's gated on #10904 (Dockerfile prepare-lifecycle fix) merging first to unblock Docker build.
…10908) (#10909) The chromadb/chroma:1.5.9 image is debian-slim-based and does NOT include curl. The healthcheck at ai/deploy/docker-compose.test.yml:7 'test: [CMD, curl, -f, ...]' fails every 5s for 60s, marks the chroma container unhealthy, and blocks kb-server + mc-server from starting (both have depends_on: chroma: service_healthy). Result: integration tests time out at the 240s webServer envelope. Same root pattern as #10902/#10904 (Dockerfile prepare-lifecycle): substrate config bug masked by local Docker layer caching, surfaces on first clean ubuntu-latest CI build via Lane C #10899. Fix: use Python urllib (stdlib, guaranteed in the chromadb image since Chroma is itself a Python app). Same /api/v2/heartbeat endpoint, same interval/timeout/retries, no external binary dependency. Empirical anchor: Lane C CI run 25506320077 integration job — 'dependency failed to start: container neo-integration-test-chroma-1 is unhealthy' at 60s, then 240s webServer timeout. Co-authored-by: tobiu <[email protected]>
Lane C's first CI run revealed ~30 pre-existing unit-test failures in clean CI env: substrate-data gaps (.neo-ai-data/ collections empty), likely-missing Playwright browser binaries, and other env-coupling that local-dev machines silently mask via accumulated state. Per #10903 (Audit unit-test failures in clean CI env), the right shape is per-bucket investigation + fixes, then add 'unit' back to this matrix via follow-up PR. Avoids landing a workflow with known-failing matrix rows. The 'integration' row remains; it's gated on #10904 (Dockerfile prepare-lifecycle fix) merging first to unblock Docker build.
Lane C's first CI run revealed ~30 pre-existing unit-test failures in clean CI env: substrate-data gaps (.neo-ai-data/ collections empty), likely-missing Playwright browser binaries, and other env-coupling that local-dev machines silently mask via accumulated state. Per #10903 (Audit unit-test failures in clean CI env), the right shape is per-bucket investigation + fixes, then add 'unit' back to this matrix via follow-up PR. Avoids landing a workflow with known-failing matrix rows. The 'integration' row remains; it's gated on #10904 (Dockerfile prepare-lifecycle fix) merging first to unblock Docker build.
Lane C's first CI run revealed ~30 pre-existing unit-test failures in clean CI env: substrate-data gaps (.neo-ai-data/ collections empty), likely-missing Playwright browser binaries, and other env-coupling that local-dev machines silently mask via accumulated state. Per #10903 (Audit unit-test failures in clean CI env), the right shape is per-bucket investigation + fixes, then add 'unit' back to this matrix via follow-up PR. Avoids landing a workflow with known-failing matrix rows. The 'integration' row remains; it's gated on #10904 (Dockerfile prepare-lifecycle fix) merging first to unblock Docker build.
Lane C's first CI run revealed ~30 pre-existing unit-test failures in clean CI env: substrate-data gaps (.neo-ai-data/ collections empty), likely-missing Playwright browser binaries, and other env-coupling that local-dev machines silently mask via accumulated state. Per #10903 (Audit unit-test failures in clean CI env), the right shape is per-bucket investigation + fixes, then add 'unit' back to this matrix via follow-up PR. Avoids landing a workflow with known-failing matrix rows. The 'integration' row remains; it's gated on #10904 (Dockerfile prepare-lifecycle fix) merging first to unblock Docker build.
Lane C's first CI run revealed ~30 pre-existing unit-test failures in clean CI env: substrate-data gaps (.neo-ai-data/ collections empty), likely-missing Playwright browser binaries, and other env-coupling that local-dev machines silently mask via accumulated state. Per #10903 (Audit unit-test failures in clean CI env), the right shape is per-bucket investigation + fixes, then add 'unit' back to this matrix via follow-up PR. Avoids landing a workflow with known-failing matrix rows. The 'integration' row remains; it's gated on #10904 (Dockerfile prepare-lifecycle fix) merging first to unblock Docker build.
#10897) (#10899) * feat(ci): test matrix workflow gating PRs on unit + integration suites (#10897) - New .github/workflows/test.yml runs npm run test-{unit,integration} on PR-to-dev and push-to-dev - Matrix-on-suite shape: future test types plug in as one-line additions; no per-test-type workflow proliferation - fail-fast:false for independent suite reporting; concurrency-cancel for superseded PR pushes - Pre-create empty .neo-ai-data/ to short-circuit downloadKnowledgeBase in npm prepare lifecycle (KB not needed for either suite) - Bundle parse5 step required for unit-test runner per bootstrapWorktree.mjs precedent - Artifact upload on failure for reviewer-side inspection (test/playwright/test-results/, 14d retention) - Closes the explicit out-of-scope follow-up named in #10805 Out-of-Scope section * fix(ci): defer unit suite until substrate audit (#10897, #10903) Lane C's first CI run revealed ~30 pre-existing unit-test failures in clean CI env: substrate-data gaps (.neo-ai-data/ collections empty), likely-missing Playwright browser binaries, and other env-coupling that local-dev machines silently mask via accumulated state. Per #10903 (Audit unit-test failures in clean CI env), the right shape is per-bucket investigation + fixes, then add 'unit' back to this matrix via follow-up PR. Avoids landing a workflow with known-failing matrix rows. The 'integration' row remains; it's gated on #10904 (Dockerfile prepare-lifecycle fix) merging first to unblock Docker build. * fix(ci): activate NEO_TEST_SKIP_CI for bucket-skip pattern (#10897) Per @neo-gpt's empirical RA on PR #10919 (skip-guards for bucket F application-spec deferrals): the test-side guards are inert without the env var actually being set in the target CI path. This adds NEO_TEST_SKIP_CI=true to the Run-tests step's env block — canonical activation for the bucket-skip pattern that all the merged unit-suite skips (#10907 bucket A+E, Gemini's bucket B+D, GPT's #10910 bucket C) AND the in-flight integration-suite skips (#10919 bucket F = #10917 + #10918) depend on. Single workflow knob; symmetric across both unit + integration matrix rows when unit gets re-added in the planned followup PR. Closes the gate-gap GPT correctly named: skip activation contract was incomplete on this PR's prior iteration. --------- Co-authored-by: tobiu <[email protected]>
Resolves #10902
Authored by Claude Opus 4.7 (Claude Code). Session 7e897a0b-33ce-4d6c-b1a9-a1ff93e4e571.
One-line fix to
ai/deploy/Dockerfilethat unblocks all clean-environment Docker builds. The substrate bug was hidden by Docker layer caching on local-dev machines and surfaced for the first time by Lane C CI workflow (#10897 / PR #10899) on its first run.Evidence: L1 (file change minimal + clear; comment explains rationale) → L3 in-flight (this PR's own CI under #10899's workflow will validate at L3 once both branches converge in
dev). No external residuals — the L3 evidence materializes via Lane C CI on any subsequent integration-suite run.Root Cause Summary
Dockerfilelines 4-5 before this fix:npm ciautomatically runs thepreparescript defined inpackage.json:57:At the time
npm ciruns in the Dockerfile,buildScripts/hasn't been COPY'd yet. The script fails withCannot find module '/app/buildScripts/ai/initServerConfigs.mjs'. The subsequentCOPY . .brings buildScripts/ but Docker has already failed.Empirical anchor: Lane C CI run 25497549380,
integrationjob — bothkb-serverandmc-serverDocker builds fail at this same step.The Fix
The
--ignore-scriptsflag instructs npm to skip lifecycle hooks (prepare,postinstall, etc.) during install. Production Docker images don't need either of the prepare-lifecycle scripts (initServerConfigsis for local-dev gitignored-config copying;downloadKnowledgeBaseis for local-dev KB-artifact downloads). Both are zero-value in the runtime image.Why this wasn't caught earlier
Local Docker builds passed via layer caching: when developers ran
docker compose -f ai/deploy/docker-compose.test.yml up --buildafter a prior successful build, theRUN npm cilayer was cached from a state whenbuildScripts/had been previously available (e.g., during local dev with full repo). Layer-cache invalidation only fires when the COPY'd files change, so subsequent--buildinvocations re-used the already-broken-but-cached layer.#10880 (Docker artifacts) and #10893 (Lane A integration test using these artifacts) both landed under this caching mask. Lane C (#10899) was the first PR to run a truly clean ubuntu-latest Docker build → bug surfaced immediately.
Test Evidence
L1 verification (this PR):
git diff ai/deploy/Dockerfile: 1 line changed (added flag) + 4 lines added (inline comment).L3 verification (deferred to convergence):
dev, Lane C #10899'sintegrationmatrix row will pass on its next CI run.Sibling Lane Impact
This fix unblocks integration-test verification for:
Post-Merge Validation
integrationmatrix row passes.docker compose -f ai/deploy/docker-compose.test.yml build --no-cache kb-server mc-serverfrom a clean checkout.Cross-family review request
This touches @neo-gemini-3-1-pro's #10880 substrate. Routing to @neo-gemini-3-1-pro as primary reviewer per Authorship-respect heuristic + cross-family pairing (Anthropic → Google).
Origin Session ID:
7e897a0b-33ce-4d6c-b1a9-a1ff93e4e571