feat(gh-cli): add pull request involvement report - #171
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The PR introduces a couple of correctness/usability and consistency issues (grouping description vs behavior, missing explicit API error handling, shebang consistency) that should be addressed before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Lite
Findings: 1
New issues introduced by this change (5)
| Severity | Finding |
|---|---|
gh-cli/README.md — The README description says the final group is "otherwise involving you", which implies it excludes… |
|
gh-cli/README.md — The README’s "Involved" bullet doesn’t mention review requests and reads like a distinct bucket,… |
|
gh-cli/get-my-pull-requests.sh — In gh-cli, almost all scripts use #!/bin/bash (e.g., gh-cli/get-most-recent-migration-id-for-rep… |
|
gh-cli/get-my-pull-requests.sh — gh api failures (rate limit / permission / API errors) will currently exit due to set -e, but… |
|
gh-cli/get-my-pull-requests.sh — There appears to be an extra blank line with trailing whitespace at the end of the script, which… |
What changed in this PR
Adds a new gh-cli helper script to report a user’s open pull request involvement (authored/assigned/review-requested/involved) with optional organization exclusions, and documents it in the gh-cli README.
Changes:
- Add
get-my-pull-requests.shto query open PRs via the Search API with pagination and exclusion validation - Document the new script’s purpose, usage, and auth requirements in
gh-cli/README.md
| File | Description |
|---|---|
| gh-cli/get-my-pull-requests.sh | New script to fetch and group open PRs by involvement, with optional excluded organizations |
| gh-cli/README.md | Adds a README entry documenting the new script and its usage/auth notes |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The script currently allows overlaps between some “mutually exclusive” groups, which can produce duplicate pull requests across sections.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Lite
Findings: 1
New issues introduced by this change (1)
| Severity | Finding |
|---|---|
gh-cli/get-my-pull-requests.sh — The README and PR description say the output groups are mutually exclusive, but the "Assigned to… |
Issues resolved since last review (5)
| Severity | Finding |
|---|---|
gh-cli/get-my-pull-requests.sh — There appears to be an extra blank line with trailing whitespace at the end of the script, which… View resolved comment |
|
gh-cli/get-my-pull-requests.sh — gh api failures (rate limit / permission / API errors) will currently exit due to set -e, but… View resolved comment |
|
gh-cli/get-my-pull-requests.sh — In gh-cli, almost all scripts use #!/bin/bash (e.g., gh-cli/get-most-recent-migration-id-for-rep… View resolved comment |
|
gh-cli/README.md — The README’s "Involved" bullet doesn’t mention review requests and reads like a distinct bucket,… View resolved comment |
|
gh-cli/README.md — The README description says the final group is "otherwise involving you", which implies it excludes… View resolved comment |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
The new script’s argument-count validation exits without a clear error message, which weakens the user-facing input validation experience.
Review tier: Lite
Findings: None
Issues resolved since last review (1)
| Severity | Finding |
|---|---|
gh-cli/get-my-pull-requests.sh — The README and PR description say the output groups are mutually exclusive, but the "Assigned to… View resolved comment |
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
gh-cli/get-my-pull-requests.sh:36
- When more than one argument is provided, the script prints usage and exits without a clear error message. Since this is input validation for a user-facing script, it should fail with an actionable message (while still showing usage).
[[ $# -le 1 ]] || { usage; exit 1; }
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Search limits can cause failures or incomplete reports, and malformed exclusion lists can bypass validation.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 1
New issues introduced by this change (1)
| Severity | Finding |
|---|---|
gh-cli/get-my-pull-requests.sh — --paginate cannot make this report complete once a bucket exceeds 1,000 matches because… |
Suppressed comments (2)
Previously missed (1) — in code that hasn't changed since the last review.
gh-cli/get-my-pull-requests.sh:51
- Bash
read -adrops a trailing empty field, so malformed values such asacme,bypass the per-organization regex instead of producing the promised validation error. Reject empty CSV elements before splitting.
This issue also appears on line 55 of the same file.
IFS=',' read -ra orgs <<< "$exclude_orgs"
gh-cli/get-my-pull-requests.sh:55
- The fourth search already contains three negated qualifiers, and GitHub Search rejects queries with more than five boolean operators. Supplying three or more excluded organizations—currently allowed by the interface—therefore makes this bucket fail; long names can also exceed the 256-character query limit. Either validate a safe limit/length with a specific error or filter excluded owners outside the search query.
exclusion="$exclusion -org:$org"
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Search API timeouts can silently produce incomplete reports.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 1
New issues introduced by this change (1)
| Severity | Finding |
|---|---|
gh-cli/get-my-pull-requests.sh — The Search API can return HTTP 200 with incomplete_results: true when a query times out. Both… |
Issues resolved since last review (1)
| Severity | Finding |
|---|---|
gh-cli/get-my-pull-requests.sh — --paginate cannot make this report complete once a bucket exceeds 1,000 matches because… View resolved comment |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
A race between the count and retrieval requests can silently truncate results above the API limit.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 1
New issues introduced by this change (1)
| Severity | Finding |
|---|---|
gh-cli/get-my-pull-requests.sh — The retrieval pass does not retain .total_count, so the 1,000-result guarantee can be invalidated… |
Issues resolved since last review (1)
| Severity | Finding |
|---|---|
gh-cli/get-my-pull-requests.sh — The Search API can return HTTP 200 with incomplete_results: true when a query times out. Both… View resolved comment |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Authentication validation can incorrectly fail because of unrelated stale GitHub CLI credentials.
Review tier: Balanced
Findings: None
Issues resolved since last review (1)
| Severity | Finding |
|---|---|
gh-cli/get-my-pull-requests.sh — The retrieval pass does not retain .total_count, so the 1,000-result guarantee can be invalidated… View resolved comment |
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
gh-cli/get-my-pull-requests.sh:109
gh auth statuschecks all configured hosts/accounts and exits nonzero if any credential is invalid, so an unrelated stale login can block this report even when the account used bygh apiis valid. Validate authentication through the actual/userrequest instead and handle that failure directly.
gh auth status >/dev/null 2>&1 ||
fail "GitHub CLI is not authenticated. Run: gh auth login"
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>



Summary
Validation
bash -n gh-cli/get-my-pull-requests.shnode ./.github/scripts/lint-readme.jsgit diff --check