| name | close-human-intervention-and-failing-ci-prs |
| description | Close batches of graalvm-reachability-metadata pull requests that either have the `human-intervention` label or failing CI, and revert their linked issues by clearing assignees and moving project status to `Todo`. |
Close Human-Intervention and Failing-CI PRs
Use this skill when asked to clean up open pull requests that need human
intervention or have failing CI. In this skill, "revert" means only issue
rollback: the linked issue must have no assignees and its project Status must
be Todo. This is not a git revert workflow.
Scope
Target open PRs in oracle/graalvm-reachability-metadata when either condition
is true:
- The PR has the
human-intervention label.
- The PR's CI rollup is failed (
FAILURE or ERROR), or an individual
completed check has a failing conclusion such as FAILURE, CANCELLED,
TIMED_OUT, or ACTION_REQUIRED.
Deduplicate PRs that match both conditions. Do not delete branches unless the
user explicitly asks.
Workflow
-
Build an inventory before making changes.
- Fetch open human-intervention PRs:
gh pr list -R oracle/graalvm-reachability-metadata --state open --label human-intervention --limit 200 --json number,title,url,labels,statusCheckRollup
- Fetch open PRs broadly enough to find failing CI:
gh pr list -R oracle/graalvm-reachability-metadata --state open --limit 500 --json number,title,url,labels,statusCheckRollup
- If the repository has more open PRs than the limit, rerun with a higher
limit or use GraphQL pagination.
- Treat
PENDING, EXPECTED, missing, or empty checks as not yet failing.
Do not close those PRs for CI failure alone.
-
For each target PR, re-read live state immediately before acting.
gh pr view PR_NUMBER -R oracle/graalvm-reachability-metadata --json number,title,state,merged,labels,statusCheckRollup,url,body
- Skip merged PRs and report them separately. A merged PR needs a real code
revert decision, which is outside this skill.
- If a PR is already closed, still try the issue rollback when the linked
issue is unambiguous.
-
Resolve the linked issue without guessing.
-
Revert the linked issue.
- Read assignees and project items:
gh issue view ISSUE_NUMBER -R oracle/graalvm-reachability-metadata --json assignees,projectItems,state,title,url
- Remove every assignee:
gh issue edit ISSUE_NUMBER -R oracle/graalvm-reachability-metadata --remove-assignee login1,login2
- If the assignees remain after
gh issue edit, clear them through the REST
API:
gh api repos/oracle/graalvm-reachability-metadata/issues/ISSUE_NUMBER -X PATCH -f assignees[]=
- Set every linked project item that has a
Status field to Todo. Query
item IDs and current status:
gh api graphql -f query='
query {
repository(owner: "oracle", name: "graalvm-reachability-metadata") {
issue(number: ISSUE_NUMBER) {
projectItems(first: 20) {
nodes {
id
project {
id
number
title
owner {
__typename
... on Organization { login }
... on User { login }
}
}
fieldValues(first: 20) {
nodes {
__typename
... on ProjectV2ItemFieldSingleSelectValue {
field {
... on ProjectV2SingleSelectField {
id
name
}
}
name
optionId
}
}
}
}
}
}
}
}'
- Resolve the
Status field ID and Todo option ID from the owning
project. Cache this per project:
gh project field-list PROJECT_NUMBER --owner PROJECT_OWNER --format json
- Update each project item:
gh project item-edit \
--id ITEM_ID \
--project-id PROJECT_ID \
--field-id STATUS_FIELD_ID \
--single-select-option-id TODO_OPTION_ID
-
Close the PR.
- Use a short factual comment matching the reason:
gh pr close PR_NUMBER -R oracle/graalvm-reachability-metadata --comment "Closing this PR because CI is failing and returning the linked issue to Todo."
gh pr close PR_NUMBER -R oracle/graalvm-reachability-metadata --comment "Closing this human-intervention PR and returning the linked issue to Todo."
- If the PR was already closed, do not reopen it.
-
Verify after every mutation.
- Re-read the issue and PR:
gh issue view ISSUE_NUMBER -R oracle/graalvm-reachability-metadata --json assignees,projectItems,state,url
gh pr view PR_NUMBER -R oracle/graalvm-reachability-metadata --json state,url
- Confirm the PR is closed, assignees are empty, and each reverted project
item status is
Todo.
Decision Rules
Output Style
Report a compact batch summary:
- PRs closed for
human-intervention
- PRs closed for failing CI
- linked issues reverted to unassigned +
Todo
- PRs skipped because they were merged, had pending CI, or had ambiguous issue
mapping
- any verification failures that still need manual follow-up