Skip to content

Commit cca4f94

Browse files
thiagowfxAmp
andcommitted
feat(review_queue): make exclusive the default, add --include-team to opt in
Amp-Thread-ID: https://ampcode.com/threads/T-019cb3cb-925a-77ef-9fcc-279bc3fb59dd Co-authored-by: Amp <amp@ampcode.com>
1 parent 23ac569 commit cca4f94

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

review_queue/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ review_queue --slack | pbcopy
2222
# Include draft PRs (excluded by default)
2323
review_queue --include-draft
2424

25-
# Only show PRs where you were requested directly (not via team)
26-
review_queue --exclusive
25+
# Include team-based review requests (excluded by default)
26+
review_queue --include-team
2727

2828
# Filter by organization
2929
review_queue -o helm
@@ -45,7 +45,7 @@ review_queue -q && echo "reviews pending" || echo "inbox zero"
4545
- `--json` - Output raw JSON
4646
- `--slack` - Output as Slack mrkdwn (for pasting into Slack)
4747
- `--include-draft` - Include draft PRs (excluded by default)
48-
- `-e, --exclusive` - Only show PRs where you were requested directly (not via team)
48+
- `--include-team` - Include PRs where review was requested via team (excluded by default)
4949
- `-o, --org ORG` - Filter PRs to a specific organization
5050
- `--created-before WHEN` - Only show PRs created before WHEN (YYYY-MM-DD or relative like "60 days")
5151
- `--created-after WHEN` - Only show PRs created after WHEN (YYYY-MM-DD or relative like "60 days")

review_queue/review_queue.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ OPTIONS:
1717
--json Output raw JSON
1818
--slack Output as Slack mrkdwn (for pasting into Slack)
1919
--include-draft Include draft PRs (excluded by default)
20-
-e, --exclusive Only show PRs where you were requested directly (not via team)
20+
--include-team Include PRs where review was requested via team (excluded by default)
2121
-o, --org ORG Filter PRs to a specific organization
2222
--created-before WHEN Only show PRs created before WHEN (YYYY-MM-DD or relative like "60 days")
2323
--created-after WHEN Only show PRs created after WHEN (YYYY-MM-DD or relative like "60 days")
@@ -40,7 +40,7 @@ EXAMPLES:
4040
$cmd --created-before "7 days" Only show PRs older than 7 days
4141
$cmd --created-after 2025-01-01 Only show PRs created after a date
4242
$cmd helm/helm tulip/terraform Only show PRs from specific repos
43-
$cmd --exclusive Only direct review requests (skip team-based ones)
43+
$cmd --include-team Include team-based review requests
4444
$cmd -q && echo "reviews pending" Check if you have reviews pending
4545
4646
EXIT CODES:
@@ -107,7 +107,7 @@ parse_since_date() {
107107

108108
fetch_prs() {
109109
local include_draft="$1"
110-
local exclusive="$2"
110+
local include_team="$2"
111111

112112
local query_str="review-requested:@me is:pr is:open"
113113
if [[ "$include_draft" != "true" ]]; then
@@ -169,7 +169,7 @@ fetch_prs() {
169169
hasDirectRequest: ([.reviewRequests.nodes[].requestedReviewer | select(.__typename == "User")] | length > 0)
170170
}]'
171171

172-
if [[ "$exclusive" == "true" ]]; then
172+
if [[ "$include_team" != "true" ]]; then
173173
jq_filter="${jq_filter} | [.[] | select(.hasDirectRequest)]"
174174
fi
175175

@@ -319,7 +319,7 @@ render_slack() {
319319

320320
main() {
321321
local include_draft=false
322-
local exclusive=false
322+
local include_team=false
323323
local json_output=false
324324
local slack_output=false
325325
local quiet=false
@@ -338,8 +338,8 @@ main() {
338338
include_draft=true
339339
shift
340340
;;
341-
-e|--exclusive)
342-
exclusive=true
341+
--include-team)
342+
include_team=true
343343
shift
344344
;;
345345
--json)
@@ -397,7 +397,7 @@ main() {
397397
check_dependencies
398398

399399
local prs
400-
prs=$(fetch_prs "$include_draft" "$exclusive")
400+
prs=$(fetch_prs "$include_draft" "$include_team")
401401

402402
# Apply filters
403403
if [[ -n "$org_filter" ]]; then

0 commit comments

Comments
 (0)