Skip to content

ci: run typecheck in the PR gate to match the post-merge gate#41

Open
dmchaledev wants to merge 1 commit into
mainfrom
claude/magical-ptolemy-nbszvn
Open

ci: run typecheck in the PR gate to match the post-merge gate#41
dmchaledev wants to merge 1 commit into
mainfrom
claude/magical-ptolemy-nbszvn

Conversation

@dmchaledev

Copy link
Copy Markdown
Contributor

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 on pull_request) runs lint + test + build, but no full type-check.
    • npm run build uses tsconfig.build.json, which excludes src/__tests__ — so type errors in test files aren't compiled.
    • npm test runs under vitest, which strips types without checking them.
  • auto-tag.yml (runs on push to main) does run tsc --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;):

Step Command Result
PR CI npm run build ✅ exit 0 (tests excluded)
PR CI npm test ✅ exit 0 (vitest strips types)
post-merge npm run typecheck (tsc --noEmit) ❌ exit 2 — TS2322: Type 'number' is not assignable to type 'string'

Fix

Add a npm run typecheck step to ci.yml so the PR gate is as strict as the post-merge gate and type regressions are caught before merge.

      - name: Type check
        run: npm run typecheck

Scope / non-overlap

  • Touches only .github/workflows/ci.yml (one added step) — orthogonal to the in-flight CI PRs (npm ci/node-matrix, SHA-pinning, Dependabot).
  • Verified locally: lint, typecheck, test (29 passing), and build all green on this branch.

🤖 Generated with Claude Code

https://claude.ai/code/session_01S9yEyQHgsR7KvSL3ZAtWbJ


Generated by Claude Code

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
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