feat(ci): report backend test fails#109543
Conversation
Simplify the report job — if tests pass, the previous failure comment is left as-is rather than being deleted. Also defers the listComments API call until we know there are failures to report. Co-Authored-By: Claude <[email protected]>
This reverts commit ee8bed1.
Each push now gets its own failure comment instead of appending to a single comment. The comment header shows the short SHA linking to the commit, making it clear which push the failures belong to. Co-Authored-By: Claude Opus 4.6 <[email protected]>
- flatMap/filter/map chains instead of imperative loops - Data-driven JOB_MATCHERS table with named capture groups - Iterator.prototype.map() on matchAll (no intermediate spread) - Extracted truncateBody helper (was duplicated) - Destructured context.repo once instead of repeating everywhere Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
|
||
| const {owner, repo} = context.repo; | ||
| const prNumber = context.payload.pull_request.number; | ||
| const {sha} = context; |
There was a problem hiding this comment.
Uses merge commit SHA instead of PR head SHA
Medium Severity
context.sha in a pull_request event is the temporary merge commit SHA, not the actual PR head commit. The comment will display a SHA developers don't recognize and link to a commit URL that likely 404s. Other scripts in this directory (e.g., getsentry-dispatch.js) correctly use context.payload.pull_request.head.sha for the PR commit. The commitMarker still changes per push so comment-tracking works, but the user-visible SHA and link are wrong.
Additional Locations (1)
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Backend Test FailuresFailures on
|
This reverts commit e09cf29.
…ept-encoding * origin/master: (63 commits) fix(api): Add missing cursor query parameter to paginated endpoint OpenAPI schemas (#109642) docs(sentry-apps): Add sentryAppId to sentry-app-installations API schema (#109628) feat(occurrences on eap): Implement double reads from EAP in organization events trace API endpoint (#109391) feat(occurrences on eap): Implement double reads from EAP for reprocessing2 flow (#109345) feat(ci): report backend test fails (#109543) feat(seer): Add signed viewer context header to Seer API requests (#109626) devenv: cleanup devenv-managed uv (#109617) feat(seer): Iterate on the instructions at the top of seer settings pages (#109586) ref(seer): Add typed wrappers for remaining Seer API callsites (#109607) feat(preprod): Make snapshots endpoint org scoped (#109575) chore: capture exception (#109620) fix(formatting): run ruff format (#109618) feat(preprod): Create admin gated recompare snapshots endpoint (#109546) feat(cells): expand locality/cell distinction (#109538) feat(cells): add db migration for synapse (#109615) feat(preprod): Add public install-details endpoint and shared utilities (#109583) fix(tests): Fix flaky test_cross_trace_query_with_spans_and_logs (#109572) fix(grouping): Resolve mypy possibly-undefined errors in grouphash caching (#109602) fix(dashboards): Default axisRange to auto for existing widgets in builder (#109598) fix(billing): Fix category display names in pending changes (#109612) ...


Adds a PR comment summarising backend test failures across all shards as they happen.
Each shard's job runs a
github-scriptstep immediately after its tests finish. The step reads.artifacts/pytest.jsondirectly from the runner filesystem (no artifact upload/download needed) and appends any new failures to the PR comment. The comment body itself is the shared accumulator —extractNodeids()parses existing<code>tags to skip already-reported tests, so re-runs and concurrent shards are idempotent.Each failure links to its shard's job log via
listJobsForWorkflowRun.The step runs with
continue-on-error: trueso a GitHub API hiccup never fails CI.