Skip to content

feat(gh-cli): add pull request involvement report - #171

Merged
joshjohanning merged 8 commits into
mainfrom
feat/get-my-pull-requests
Aug 31, 2026
Merged

feat(gh-cli): add pull request involvement report#171
joshjohanning merged 8 commits into
mainfrom
feat/get-my-pull-requests

Conversation

@joshjohanning

Copy link
Copy Markdown
Owner

Summary

  • add a paginated script that groups open pull requests by author, assignee, review request, and involvement
  • support excluding one or more organizations with input validation
  • document authentication requirements and usage

Validation

  • bash -n gh-cli/get-my-pull-requests.sh
  • live authenticated script run
  • invalid argument and organization validation
  • node ./.github/scripts/lint-readme.js
  • git diff --check

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 31, 2026 14:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Medium severity · 4 Low severity

New issues introduced by this change (5)
Severity Finding
Low severity gh-cli/​README.md — The README description says the final group is "otherwise involving you", which implies it excludes…
Low severity gh-cli/​README.md — The README’s "Involved" bullet doesn’t mention review requests and reads like a distinct bucket,…
Low severity 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…
Medium severity gh-cli/​get-my-pull-requests.shgh api failures (rate limit / permission / API errors) will currently exit due to set -e, but…
Low severity 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.sh to 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.

Comment thread gh-cli/README.md Outdated
Comment thread gh-cli/README.md Outdated
Comment thread gh-cli/get-my-pull-requests.sh Outdated
Comment thread gh-cli/get-my-pull-requests.sh
Comment thread gh-cli/get-my-pull-requests.sh
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Medium severity

New issues introduced by this change (1)
Severity Finding
Medium severity 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
Low severity 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
Medium severity gh-cli/​get-my-pull-requests.shgh api failures (rate limit / permission / API errors) will currently exit due to set -e, but… View resolved comment
Low severity 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
Low severity gh-cli/​README.md — The README’s "Involved" bullet doesn’t mention review requests and reads like a distinct bucket,… View resolved comment
Low severity gh-cli/​README.md — The README description says the final group is "otherwise involving you", which implies it excludes… View resolved comment

Comment thread gh-cli/get-my-pull-requests.sh Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Medium severity 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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 High severity

New issues introduced by this change (1)
Severity Finding
High severity 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 -a drops a trailing empty field, so malformed values such as acme, 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"

Comment thread gh-cli/get-my-pull-requests.sh Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Medium severity

New issues introduced by this change (1)
Severity Finding
Medium severity 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
High severity gh-cli/​get-my-pull-requests.sh--paginate cannot make this report complete once a bucket exceeds 1,000 matches because… View resolved comment

Comment thread gh-cli/get-my-pull-requests.sh Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Medium severity

New issues introduced by this change (1)
Severity Finding
Medium severity 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
Medium severity 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

Comment thread gh-cli/get-my-pull-requests.sh Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Medium severity 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 status checks 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 by gh api is valid. Validate authentication through the actual /user request 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>
@joshjohanning
joshjohanning merged commit b6d2955 into main Aug 31, 2026
6 checks passed
@joshjohanning
joshjohanning deleted the feat/get-my-pull-requests branch August 31, 2026 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants