Repository navigation
ci: stop recompiling the TypeScript compiler in every CI job - #93
Merged
Merged
Conversation
…y versions The shim module required older versions of dependencies it shares with the root module, so CI compiled the TypeScript compiler once per module. That added two to three minutes to the test and lint jobs. A lint check now fails when the versions differ, a pre-commit hook brings the shim in line, and Renovate updates the shim's indirect dependencies and tidies the root module with them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The sample server compiled the TypeScript compiler at the same time as the typescript-compiler target, so the test job compiled it twice on the same CPUs and took about twice as long to get past that step. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
alecthomas
marked this pull request as ready for review
November 2, 2026 04:24
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ff14a4004a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Every CI run compiled everything from scratch, including the TypeScript compiler, which took minutes of each test and lint run. Only main saves the cache, so branches reuse main's latest build without evicting it. This also reverts building the sample server after the TypeScript compiler. CI showed no gain from it: the sample server's other packages had been compiling in parallel and moved onto the critical path instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A failed go command produced an empty version list, which the script read as "no differences". The lint check then passed and the pre-commit sync reported success without comparing or changing anything. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The CI test and lint jobs spent most of their time compiling the TypeScript compiler, often more than once per job, and always from scratch.
The repeated build came from the TypeScript shim, a separate Go module that required older versions of
x/sys,x/sync,x/textandcpuidthan the root module selects. Different dependency versions give the compiler's packages different build cache keys, so each module compiled them separately. Locally, building the shim after the root module recompiled 35 TypeScript compiler packages before this change and none after it. On CI, the shim's build step dropped from about 3 minutes to under a second, and its test step from about 2 minutes to 10 seconds.The root module is the source of truth, because it already selects versions at least as new as the shim's. Three things keep the shim in line with it:
bit lint-go-modules, now part ofbit lint, fails when the shim's required dependencies differ from the root module's versions.bit sync-go-moduleswhenever ago.modorgo.sumis staged, and stages the shim's updated files.gomodTidyAlltidies the root module in the same PR.Renovate still misses one case. A root dependency upgrade that raises a shared dependency as a side effect leaves the shim behind, and the lint fails on that PR until someone runs
bit sync-go-moduleson the branch.The test and lint jobs now also cache Go's build and module caches and tsk's lint results. Only pushes to
mainsave the cache, and every other branch restoresmain's latest entry, so branches cannot evict it with entries nothing else reads. The cache only helps runs after this is merged andmainhas saved it once.Whole-job times vary by up to about 2x between runners, so compare job times over several runs rather than one.
A temporary
go.workfile in CI was also considered. Workspace mode also upgraded the root module's own dependencies (google/pprof), so CI would have tested different versions than the released binaries.🤖 Generated with Claude Code