| name | pr-gate-check |
| description | Check gate status for a Bitbucket PR by resolving the PR head commit, finding the gate merge commit, inspecting builds on that merge commit, and summarizing root-cause failures with actionable next steps. |
PR Gate Check
Overview
Use this workflow when asked for gate status of a PR. Usually the builds are tied to a merge commit generated on Bitbucket, so this skill goes through finding the remote merge commit.
Workflow
- Get PR commits and identify PR head commit (first commit in
gdev-cli bitbucket commits output):
gdev-cli bitbucket commits --project=G --repo=graalpython --pullrequest=<PR_ID> --all --json
- Fetch refs and locate merge commit whose parent includes PR head:
git ls-remote origin 'refs/pull-requests/<PR_ID>/*'
git fetch --no-tags origin '+refs/heads/*:refs/remotes/origin/*' --prune
git rev-list --all --parents | rg ' <PR_HEAD_SHA>( |$)'
Pick the merge commit where one parent is <PR_HEAD_SHA> and the other is the target branch tip at merge time.
If you cannot find it this way, another heuristic is to take the branch name and append _gate - that usually has the merge commit we want as tip.
- Check builds on that merge commit:
gdev-cli bitbucket get-builds --commit=<MERGE_SHA> --all --format=key,state,url
- Separate root failures from fan-out failures:
FAILED + /builders/.../builds/... URL: executed failed build (root failure candidate).
FAILED + URL: usually not-run/downstream due to earlier failure.