fix(docker): copy css.d.ts into app build stage to fix nightly build - #2631
fix(docker): copy css.d.ts into app build stage to fix nightly build#2631jordan-simonovski wants to merge 3 commits into
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.
🦋 Changeset detectedLatest commit: 4463181 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. 2 Skipped Deployments
|
🔴 Tier 4 — CriticalTouches auth, data models, config, tasks, OTel pipeline, ClickHouse, or CI/CD. Why this tier:
Additional context: agent branch ( Review process: Deep review from a domain expert. Synchronous walkthrough may be required. Stats
|
Greptile SummaryThis PR fixes container builds that were missing the app's stylesheet declarations. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (3): Last reviewed commit: "ci: stop rebuilding the app inside the a..." | Re-trigger Greptile |
Deep ReviewThis PR is a targeted infra fix: it copies ✅ No critical issues found. 🟡 P2 -- recommended
🔵 P3 nitpicks (4)
Reviewers (6): correctness, testing, maintainability, project-standards, kieran-typescript, reliability. Testing gaps:
|
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.
E2E Test Results✅ All tests passed • 236 passed • 3 skipped • 1544s
Tests ran across 4 shards in parallel. |
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.
|
Superseded by #2632 — this PR auto-closed when the branch was renamed |
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.