[scanner] PR#115: pr-queue-hygiene.yml reads mergeable from 'gh pr list' (often UNKNOWN) — conflicting PRs silently skipped

Open Beginner friendly
#217 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
github-actions, javascript, shell
Domain
ci-cd

Research direction

Start with the "Flag PRs conflicting with base for more than 48h" step in .github/workflows/pr-queue-hygiene.yml, then compare its list-endpoint handling with the per-PR detail pattern around lines 378-390 of scripts/fleet-merge-queue-digest.mjs. Done means UNKNOWN results are retried or refetched and conflicting PRs identified by CONFLICTING or dirty are no longer silently skipped.

Written by the indexing model from the issue text.

Description

agent/scanner bug hive/hosted-available-lke648397-260827-5n31

Finding

PR#115's .github/workflows/pr-queue-hygiene.yml step "Flag PRs conflicting with base for more than 48h" does:

gh pr list --repo "$REPO" --state open --json number,mergeable,updatedAt,labels ...
mergeable=$(echo "$pr_json" | jq -r '.mergeable')
if [ "$mergeable" != "CONFLICTING" ]; then continue; fi

GitHub computes mergeability lazily. The list endpoint (and the GraphQL equivalent gh pr list uses) frequently returns UNKNOWN for PRs whose mergeability hasn't been computed yet. Any conflicting PR reporting UNKNOWN is silently skipped — exactly the PRs the 48h hygiene rule exists to flag. There is no retry or per-PR refetch, so a PR can evade flagging indefinitely.

Notably, the same PR already handles this correctly elsewhere: scripts/fleet-merge-queue-digest.mjs comments "The pulls list endpoint doesn't include a live mergeable field" and fetches a per-PR detail (checking both mergeable === false and mergeable_state === 'dirty'). The workflow step just didn't get the same treatment.

Evidence

  • PR#115 head, .github/workflows/pr-queue-hygiene.yml lines ~44-52 (list-endpoint mergeable + skip-unless-CONFLICTING)
  • Same PR, scripts/fleet-merge-queue-digest.mjs lines ~378-390 (correct per-PR detail pattern, for contrast)

Recommendation

In the hygiene step, when list mergeable is UNKNOWN, fetch the single PR (gh pr view $number --json mergeable,mergeStateStatus) — with one short retry — before deciding to skip; treat mergeable=CONFLICTING / mergeStateStatus=dirty as conflicting. Or reuse the digest script's detail-fetch logic.


Filed by scanner agent (ACMM L4 — issues-only mode)

🐝 Hive Agent: scanner | Instance: hosted-available-lke648397-260827-5n31 | SHA: 00b44df

— hive: agent=scanner backend=copilot model=kimi-k3

Dominant language
JavaScript
Stars
0
Forks
2
Avg merge
2d 22h
Merged PRs (30d)
12

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cncf/endusers

All issues in cncf/endusers

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.