Skip to content

fix(github-reporter): Attach Check Runs to PR head - #95

Merged
dcramer merged 2 commits into
mainfrom
fix/github-check-pr-head-sha
Aug 7, 2026
Merged

fix(github-reporter): Attach Check Runs to PR head#95
dcramer merged 2 commits into
mainfrom
fix/github-check-pr-head-sha

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Make publish-check land on the PR head commit and own PR status cleanly, with docs for the recommended reporter workflow.

PR head SHA

On pull_request, GitHub sets GITHUB_SHA to a temporary merge commit while PR checks attach to head. The reporter now resolves Check Run SHAs as: explicit shaGITHUB_PR_HEAD_SHApull_request.head.shaGITHUB_SHA.

Soft-fail when the check owns status

When a gated Check Run publishes successfully, the action step stays green by default so the Check Run title/conclusion own green/red instead of canned job failure text. If publishing is skipped or fails, the step still fails on a rejected gate. Override with soft-fail: false.

Docs / APIs

Document the SHA order, soft-fail defaults, job-summary-only mode, and per-shard summary + reducer Check Run pattern across docs/github-actions.md, package README, public docs, and llms.txt. Also set details_url back to the workflow run when available.

Checks: vitest github-reporter suite (60), biome format/lint, tsc --noEmit, pnpm docs:check.

Requested by David Cramer.

--

View Junior Session [Sentry]

Resolve publish-check SHAs from pull_request.head.sha so PR checks land on
the head commit, not the temporary merge GITHUB_SHA. Soft-fail gated steps
when a Check Run publishes successfully so that check owns green/red, and
document the recommended reporter APIs and workflow patterns.
@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
vitest-evals-docs Ready Ready Preview Aug 7, 2026 7:39pm

Request Review

Require a published Check Run before soft-fail can keep the step green,
link details_url to the workflow run page only, and point public docs at
the repo github-actions guide instead of a missing site route.

Co-Authored-By: David Cramer <david@sentry.io>

@sentry-junior sentry-junior Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Went through the reporter end-to-end (action inputs → gate → Check Run publish → docs).

Looks solid

  • PR head SHA resolution order is correct and covered (shaGITHUB_PR_HEAD_SHA → event payload → GITHUB_SHA).
  • Soft-fail only kicks in after a Check Run actually publishes, so a failed gate cannot go silent if publishing is skipped.
  • Success Check Run payload still uses the full job summary (table, scores, quality misses).
  • Docs now spell out when to use Check Run vs job-summary-only, per-shard summaries + reducer gate, and who owns green/red.

Follow-ups outside this PR (not blockers)

  • externalId is wired in code but not exposed as an action input yet. Fine for now; only needed if we want stable Check Run identity across reruns.
  • Detached Checks API runs can still group oddly under another github-actions suite in the PR UI. Head SHA + soft-fail fix the functional bugs; grouping is a GitHub platform quirk, not a reporter correctness issue.
  • Public docs site still has a thinner GitHub page than the repo docs/github-actions.md guide. Link now points at the repo guide; longer-term we may want that content on the site too.

I would ship this as the next reporter minor after CI is green.

@dcramer
dcramer marked this pull request as ready for review August 7, 2026 19:39
@dcramer
dcramer merged commit 8571726 into main Aug 7, 2026
16 checks passed
@dcramer
dcramer deleted the fix/github-check-pr-head-sha branch August 7, 2026 19:44
dcramer added a commit that referenced this pull request Aug 7, 2026
## Summary

Follow-up to #95 for the binary docs gap: bring the public GitHub
reporting guide up to parity with `docs/github-actions.md` so
implementers get the right APIs/patterns without reading the repo guide.

## What changed

- Expanded `packages/docs/src/content/docs/docs/github.mdx` with:
  - Check Run ownership / soft-fail defaults
  - PR head SHA resolution order
  - job-summary-only mode (no detached Checks API entry)
  - full sharded pattern with per-shard summaries + reducer gate
  - inputs / outputs tables
  - recommended ownership patterns
- Pointed `/github-actions` redirect at `/docs/github`
- Expanded `llms.txt` GitHub section + canonical link
- Linked the public page from `docs/github-actions.md`

## Intentionally not in this PR

- `externalId` action input (API surface nicety, not docs parity)
- CodeQL / detached Checks API suite grouping (GitHub platform behavior
when using Checks API + `GITHUB_TOKEN`; not fixed by docs — prefer
job-summary-only / real workflow job ownership if you want clean
association)

## Test plan

- [x] `pnpm docs:check`
- [ ] Preview docs page `/docs/github` after Vercel deploy
- [ ] Confirm `/github-actions` redirects to `/docs/github`

<!-- junior-request-attribution:start -->
Requested by **David Cramer**.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:slack%3AC0B595QDZLL%3A1786129108.273669 -->

--

[View Junior
Session](https://junior-prod.sentry.dev/conversations/slack%3AC0B595QDZLL%3A1786129108.273669)
[[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0B595QDZLL%3A1786129108.273669/?project=4510944073809921)

<!-- junior-session-footer:end -->

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: David Cramer <david@sentry.io>
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