Fix: get-tracking-info.sh PR lookup race condition and missing merge state filter
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 26
- Forks
- 11
- Avg merge
- 7d 16h
- Merged PRs (30d)
- 1
Description
Problem
get-tracking-info.sh uses gh pr list --search to check if a commit was part of a promoted PR. This relies on GitHub's search index, which can lag behind the actual state of PRs. A recently merged PR may not appear in search results yet, causing the promotion check to incorrectly return n.
Fix
Replace gh pr list --search with the commits/{sha}/pulls API endpoint, which reflects real-time state rather than the search index:
count=$(gh api "repos/${GITHUB_REPOSITORY}/commits/${COMMIT_ID}/pulls" \
--jq '[.[] | select(.merged_at != null) | select(.labels[].name == "promoted")] | length')
This ensures no dependency on search index freshness, resolving the race condition.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with get-tracking-info.sh and locate the current gh pr list --search lookup. Replace that lookup with the commits/{sha}/pulls API query described in the issue, then verify that only merged pull requests with the promoted label are counted and that recently merged pull requests no longer depend on search-index freshness.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github, shell
- Domain
- release
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 82/100