Skip to content

Fix CI coverage-comment failure on push to main - #100

Open
martin-henz wants to merge 2 commits into
mainfrom
fix/ci-coverage-comment-push
Open

Fix CI coverage-comment failure on push to main#100
martin-henz wants to merge 2 commits into
mainfrom
fix/ci-coverage-comment-push

Conversation

@martin-henz

Copy link
Copy Markdown
Member

Summary

  • ArtiomTr/jest-coverage-report-action@v2's default output: comment step tries to post a PR comment even when the workflow was triggered by a direct push to main (e.g. after merging a PR), where there's no associated PR — this fails with HttpError: Resource not accessible by integration and marks the whole build job as failed even though build/tests pass. See failing run: https://github.com/source-academy/java-slang/actions/runs/33060105554/job/98476472987
  • Gate the coverage-comment action to pull_request events only; run plain yarn test on push.
  • Also fixes a pre-existing lint/type issue that was blocking local commits: ExceptionTableEntry.catchType was typed any | null (redundant union, eslint error), which also masked that the field actually holds a ConstantClass (not a ClassData) until resolved via .resolve(). Narrowed to ConstantClass | null to match how it's populated in Attributes.ts and consumed in thread.ts.

Test plan

  • yarn tsc --noEmit passes
  • yarn test passes (65 suites / 1148 tests)
  • Confirm the build workflow succeeds on both a pull_request run (coverage comment posts) and a push-to-main run (no failure) after merge

🤖 Generated with Claude Code

https://claude.ai/code/session_01TujL5U9Kg6vHKvRR7zryE4

martin-henz and others added 2 commits August 27, 2026 18:30
exception-table.ts declared ExceptionTableEntry.catchType as
`any | null`, which eslint flags as a redundant union and which
also masked a latent type mismatch (the field actually holds a
ConstantClass, not a ClassData, until resolved). Narrow it to
ConstantClass | null to match how it's populated in Attributes.ts
and consumed in thread.ts.

The pre-commit hook's repo-wide `eslint --fix` and `prettier --write`
also picked up and applied a handful of pre-existing import-order
and formatting fixes in other files that were tripping the hook.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TujL5U9Kg6vHKvRR7zryE4
jest-coverage-report-action tries to post a PR comment even on
direct pushes to main, where no PR exists, causing the build job
to fail with "Resource not accessible by integration". Only run
the coverage-comment action on pull_request events, and run plain
yarn test on push.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TujL5U9Kg6vHKvRR7zryE4
@github-actions

Copy link
Copy Markdown

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 72.63% 7589/10449
🔴 Branches 59.33% 2553/4303
🟡 Functions 69.54% 1354/1947
🟡 Lines
73.5% (+0% 🔼)
7146/9722

Test suite run success

1148 tests passing in 65 suites.

Report generated by 🧪jest coverage report action from 77297ae

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.

1 participant