ci: run typecheck in the PR gate to match the post-merge gate#41
Open
dmchaledev wants to merge 1 commit into
Open
ci: run typecheck in the PR gate to match the post-merge gate#41dmchaledev wants to merge 1 commit into
dmchaledev wants to merge 1 commit into
Conversation
The PR workflow (ci.yml) ran lint + test + build, but not a full type-check. `npm run build` compiles with tsconfig.build.json, which excludes src/__tests__, and `npm test` runs under vitest, which strips types without checking them. As a result a type error in a test file (or any type mismatch outside the shipped source) passes PR CI. The push-to-main workflow (auto-tag.yml) does run `tsc --noEmit`, so such a regression is only caught *after* merge — where it fails the auto-tag/release job and blocks tagging until a follow-up fix lands. Add a `npm run typecheck` step so the PR gate is as strict as the post-merge gate and type regressions are caught before merge. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S9yEyQHgsR7KvSL3ZAtWbJ
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.
Problem
The PR CI gate is weaker than the post-merge gate, so a type-only regression can pass review, merge, and then break
main.ci.yml(runs onpull_request) runs lint + test + build, but no full type-check.npm run buildusestsconfig.build.json, which excludessrc/__tests__— so type errors in test files aren't compiled.npm testruns under vitest, which strips types without checking them.auto-tag.yml(runs on push tomain) does runtsc --noEmit.Net effect: a type error outside the shipped source (e.g. in a test) passes PR CI, merges, and only fails after merge — in the auto-tag/release job — blocking tagging until a follow-up fix.
Reproduction
Injecting a trivial type error into a test file (
const _x: string = 42;):npm run buildnpm testnpm run typecheck(tsc --noEmit)TS2322: Type 'number' is not assignable to type 'string'Fix
Add a
npm run typecheckstep toci.ymlso the PR gate is as strict as the post-merge gate and type regressions are caught before merge.Scope / non-overlap
.github/workflows/ci.yml(one added step) — orthogonal to the in-flight CI PRs (npm ci/node-matrix, SHA-pinning, Dependabot).lint,typecheck,test(29 passing), andbuildall green on this branch.🤖 Generated with Claude Code
https://claude.ai/code/session_01S9yEyQHgsR7KvSL3ZAtWbJ
Generated by Claude Code