fix(docker): copy css.d.ts into app build stage to fix nightly build - #2632
Conversation
The TypeScript 6 upgrade (#2617) added ambient 'declare module *.css' declarations in packages/app/css.d.ts to satisfy TS2882 for side-effect stylesheet imports in pages/_app.tsx. Both Dockerfiles copied mdx.d.ts but not css.d.ts, so next build failed type-checking inside the container, breaking the App, All-in-One, and Local nightly image builds. Also drops a stray 'export' on getAlertWindowStart (only used in-file) so the pre-commit knip check passes.
A source-level type check can't catch failures that only surface inside the Docker image — like the css.d.ts declaration file that existed in the repo but was never COPYed into the build stage, which broke every nightly image build. Add a Docker Build workflow that builds each released image with push:false so these are caught in PR review. Builds are conditional on changed paths (via tj-actions/changed-files, matching the existing otel-collector jobs in main.yml) so unrelated PRs skip them: - OTel Collector image: docker/otel-collector or packages/otel-collector - App/prod image: api/app/common-utils/docker-hyperdx or root deps - All-in-one image: the above plus clickhouse/otel bundled-service inputs Single-arch (amd64) and warmed from the nightly gha cache scopes to keep runtimes low; build errors are arch-independent.
The all-in-one target does COPY --from=prod /app /app, so it already builds the full App/prod image. With the app paths in both filters, every app change ran both jobs and built the Node app twice (~8 wasted minutes). Gate the all-in-one job only on the incremental bundling inputs (ClickHouse / OTel / the shared Dockerfile); api/app/common-utils/deps are covered by the App Image job and can't affect the bundling layers.
Add .yarnrc.yml, .prettierrc, .prettierignore to the app-image changed-files gate and .vex/** to the all-in-one gate, so a PR touching only those Dockerfile inputs still runs the build check. Make workflow_dispatch force-build all three jobs (changed-files finds nothing without a PR payload) and fall back to github.run_id for CODE_VERSION so it is never a bare 'pr-'.
🦋 Changeset detectedLatest commit: e0c5eed The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🔴 Tier 4 — CriticalTouches auth, data models, config, tasks, OTel pipeline, ClickHouse, or CI/CD. Why this tier:
Review process: Deep review from a domain expert. Synchronous walkthrough may be required. Stats
|
Greptile SummaryThis PR fixes Docker image builds and adds PR checks for released images. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (4): Last reviewed commit: "Merge branch 'main' into jordansimonovsk..." | Re-trigger Greptile |
The all-in-one job only built the auth target, but noauth is a sibling off all-in-one-base with its own entry-script COPY layer. A break there (gated under docker/hyperdx/**, so the job runs) would pass the PR check and fail the nightly Local build. Build both siblings; the base is reused from buildx's local cache so noauth only adds its one COPY layer.
E2E Test Results✅ All tests passed • 236 passed • 3 skipped • 1565s
Tests ran across 4 shards in parallel. |
Deep Review✅ No critical issues found. This is a low-risk build/CI fix. The 🔵 P3 nitpicks (1)
Reviewers (5): correctness, reliability, maintainability, project-standards, kieran-typescript. Testing gaps:
|
Why
The nightly release (run 29215841780) has been failing across the App, All-in-One, and Local image builds with:
The TypeScript 6 upgrade (#2617) introduced the stricter TS2882 check for side-effect imports of otherwise-untyped modules. To satisfy it, that PR added
packages/app/css.d.tswith ambientdeclare module '*.css'(and.scss/.sass) declarations, which cover the stylesheet imports inpages/_app.tsx.This works locally, but both Dockerfiles only copy
mdx.d.tsinto the build stage, notcss.d.ts. Inside the container the ambient declaration is missing, sonext buildfails type-checking. Localtsc/CI passed becausecss.d.tsis present on disk there — a source-level type check fundamentally cannot catch a file that exists in the repo but was neverCOPYed into the image.What
The fix
css.d.tsto theCOPYline indocker/hyperdx/Dockerfile(App / All-in-One / Local nightly + release images) andpackages/app/Dockerfile(standalone app image), right alongside the existingmdx.d.ts.exportongetAlertWindowStart(packages/api/src/tasks/checkAlerts/index.ts) — only used within its own file. Pre-existing dead export flagged by the pre-commitknipcheck, which was blocking commits through the hook.@hyperdx/app.Prevention — new
Docker Buildworkflow (.github/workflows/docker-build.yml)push: false, so image-only build failures are caught in review instead of the nightly.tj-actions/changed-files, matching the existing otel-collector gating inmain.yml) so unrelated PRs skip the builds:docker/otel-collector/**,packages/otel-collector/**packages/{api,app,common-utils}/**,docker/hyperdx/**, root depsdocker/clickhouse/**,docker/otel-collector/**Verification
Ran the
docker/hyperdxbuildertarget locally (the stage that runsnext build) with the fix:The TS2882 error is gone and the image builds cleanly.