Skip to content

🐛 Docker build - Keep __tests__ out of the image so next build passes its type check - #2812

Merged
bradystroud merged 1 commit into
mainfrom
bs/dockerignore-tests
Nov 13, 2026
Merged

bradystroud merged 1 commit into
mainfrom
bs/dockerignore-tests

Conversation

@bradystroud

Copy link
Copy Markdown
Member

Description

✏️ main cannot build an image since #2783. Staging run 43351607701 failed after 58 seconds in the type check of next build:

__tests__/lib/ruleFolders.test.ts(17,34): error TS2307: Cannot find module '@/scripts/rule-folders'
__tests__/scripts/rulesChatChunking.test.ts(4,57): error TS2307: Cannot find module '@/scripts/rules-chat/chunking.mjs'
__tests__/scripts/validateRuleCategories.test.ts(7,40): error TS2307: Cannot find module '@/scripts/validate-rule-categories'
... (5 errors)

Cause: #2783 upgraded next from 16.2.4 to 16.4.6. The type check of 16.4.6 fails on test files that import from scripts/, and .dockerignore keeps scripts/ out of the image. Three of the five failing tests are older and passed with 16.2.4 (for example in production run 43338971692 tonight).

Fix: add __tests__ to .dockerignore. Tests run in the check workflow, not in the image.

Tests

  • A copy of main with the Docker file set (scripts excluded as in .dockerignore): tsc --noEmit fails with TS2307 on a test file. The same copy without __tests__: 0 errors.
  • Production is not affected: release/v1.8.20 (the 06:00 UTC deploy) still has Next 16.2.4.
  • Still to do: a full image build with Next 16.4.6 (/deploy on this PR). This fix only removes the first error. Other changes of 16.4 can show up later in the build.

Note: #2806 also changes .dockerignore, a few lines above. The two changes do not overlap.

Screenshot (optional)

✏️ Not applicable.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UTtNDpWnuaUUQ2winSSgMb

… its type check

Since #2783 (next 16.2.4 to 16.4.6), the type check of next build in the
Docker build fails with TS2307 on test files that import from scripts/.
.dockerignore keeps scripts/ out of the image, so those imports cannot
resolve. Staging run 43351607701 of main failed this way after 58 seconds.

Tests run in the check workflow, not in the image, so the image does not
need __tests__.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UTtNDpWnuaUUQ2winSSgMb
@bradystroud
bradystroud enabled auto-merge (squash) November 13, 2026 03:15
@bradystroud
bradystroud merged commit 9ec7c00 into main Nov 13, 2026
1 check passed
@bradystroud
bradystroud deleted the bs/dockerignore-tests branch November 13, 2026 03:42

This branch was previously deployed

1 inactive deployment
staging — d22744b7 Deployed Nov 13, 2026 by bradystroud via Delete PR Slot #204
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants