Skip to content

fix(ci): post E2E Gate check to the PR when workflow_run fires#938

Merged
pimlock merged 1 commit intomainfrom
fix/e2e-gate-skip-detection
Apr 23, 2026
Merged

fix(ci): post E2E Gate check to the PR when workflow_run fires#938
pimlock merged 1 commit intomainfrom
fix/e2e-gate-skip-detection

Conversation

@pimlock
Copy link
Copy Markdown
Collaborator

@pimlock pimlock commented Apr 23, 2026

Summary

Follow-up to #926. E2E Gate still doesn't auto-refresh on the PR after the guarded workflow completes — the workflow_run-triggered re-evaluation posts its check to main instead of the PR head SHA, because workflow_run-triggered workflows run in the default-branch context. Result: PR check stays red until a human manually re-runs it.

Example from testing on #924:

Change

Stop evaluating the gate in the workflow_run handler. Instead, look up the most recent pull_request-triggered E2E Gate run for the same head SHA and call POST /actions/runs/<id>/rerun. A re-run replays the original event payload (labels, PR head SHA), so the fresh check lands on the PR as a normal pull_request-context run — and this time the gate sees the successful upstream run.

New rerun-on-completion job needs actions: write; the evaluation jobs stay actions: read. No loop: rerun-triggered runs don't re-fire workflow_run.

Testing

Checklist

  • Conventional Commits
  • DCO sign-off

@pimlock pimlock requested a review from a team as a code owner April 23, 2026 16:24
When `Branch E2E Checks` (or `GPU Test`) finishes, the `workflow_run`
trigger fires the gate in the default-branch context. Any check posted
from there lands on `main` rather than on the PR head SHA, so the PR's
`E2E / Enforce...` check never flips from red to green automatically —
the user has to re-run it by hand.

Stop evaluating the gate in the `workflow_run` handler. Instead, find
the most recent `pull_request`-triggered gate run for the same head SHA
and call the actions API to re-run it. Re-runs replay the original
event payload (labels, PR head SHA), so the check posts back to the PR
as a normal `pull_request`-context run, and the gate now sees the
upstream success.

Needs `actions: write` on that one job; the evaluation jobs stay
`actions: read`.

Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
@pimlock pimlock force-pushed the fix/e2e-gate-skip-detection branch from aa28149 to 509ab65 Compare April 23, 2026 16:27
@pimlock pimlock merged commit ab3f3e0 into main Apr 23, 2026
17 checks passed
@pimlock pimlock deleted the fix/e2e-gate-skip-detection branch April 23, 2026 20:02
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.

3 participants