fix(org-status): fix first-table truncation + add per-repo merge activity by day - #184
Conversation
…vity by day - Add CRITICAL instruction that all sections must be output in order so the PR summary table always appears first and is never missing from the report - Limit Open Issues data to 25 per repo (from unlimited) before sending to Claude, significantly reducing prompt payload and leaving Claude more output budget for the PR tables at the top of the report - Compute MERGE_BY_REPO_DAY: per-repo-per-day merge counts (jq, reuses existing ORG_MERGES / PERSONAL_MERGES raw data, no extra API calls) - Replace the flat | Repo | Merges | breakdown with a by-day matrix table: | Repo | Apr-26 | … | Apr-30 | Total | plus a TOTAL row - Keep the existing daily org-level | Date | petry-projects | don-petry | table as a companion summary; add Grand Total column - Remove the now-redundant "Org/Personal Merges Raw" prompt data sections (covered by the new per-repo-per-day data) - Update Open Issues instructions: show "(showing 25 of N)" when truncated rather than the old "(truncated at 1000)" note Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe script now aggregates merged PRs into a per-repo, per-day structure for the last 8 days and trims open-issues to at most 25 items per repo with truncation metadata. Prompt inputs and report templates were adjusted to use these new data shapes. ChangesMerge Reporting and Issue Trimming Enhancement
Sequence Diagram(s)(omitted) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR updates the scripts/org_status.sh org-status report generator to prevent the report from being truncated (by reducing issue payload size) and to enhance the merge-activity section with a per-repo × per-day merge matrix.
Changes:
- Trim open-issues data to 25 issues per repo before building the Claude prompt, and add a “CRITICAL” instruction to enforce section ordering with the PR summary first.
- Add
MERGE_BY_REPO_DAYaggregation (computed locally injq) to support a per-repo-per-day merge activity table, and remove the redundant flat per-repo breakdown.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| def dates: [range(8) | ($since | strptime("%Y-%m-%d") | mktime) + (. * 86400) | strftime("%Y-%m-%d")]; | ||
| (($org | map({repo: ("petry-projects/" + .repository.name), date: .closedAt[:10]})) + | ||
| ($personal | map({repo: ("don-petry/" + .repository.name), date: .closedAt[:10]}))) | | ||
| group_by(.repo) | map( |
There was a problem hiding this comment.
Fixed in the follow-up commit (sort_by/.repo added, ISSUE_LIMIT variable, Mon-DD header).
| # Limit issues to 25 per repo to keep prompt size manageable and ensure Claude | ||
| # has enough output budget to generate all sections (especially the PR tables first). | ||
| ISSUES_BY_REPO_TRIMMED=$(echo "$ISSUES_BY_REPO" | jq ' | ||
| map({ | ||
| repo: .repo, | ||
| count: .count, | ||
| truncated: (.count > 25), | ||
| issues: .issues[:25] | ||
| })') |
There was a problem hiding this comment.
Fixed in the follow-up commit (sort_by/.repo added, ISSUE_LIMIT variable, Mon-DD header).
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@scripts/org_status.sh`:
- Around line 323-326: The example table header currently shows YYYY-MM-DD but
the instructions mandate short Mon-DD headers; update the example header in
scripts/org_status.sh (the "Per-repo-per-day table using the Merge Activity —
Per-Repo Per-Day data" section) so the placeholder column headers use the short
format (e.g., Apr-26) instead of YYYY-MM-DD, and ensure the adjacent bullet that
says "Date headers: use short format Mon-DD" remains consistent with that
example.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 2fcf0ce8-2d2e-4c92-ad75-d03394dafdeb
📒 Files selected for processing (1)
scripts/org_status.sh
…Mon-DD header - Add sort_by(.repo) before group_by(.repo) in MERGE_BY_REPO_DAY jq so the combined array is sorted before grouping (jq group_by requires sorted input; without this, records from the same repo could land in separate groups) - Extract the hard-coded issues-per-repo cap into an ISSUE_LIMIT variable and pass it via --argjson so the jq slice, the truncated flag, and the prompt text all stay in sync when the limit changes - Fix contradictory table-header example: replace YYYY-MM-DD placeholders with Mon-DD to match the date-format instruction on the following line Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
There was a problem hiding this comment.
♻️ Duplicate comments (1)
scripts/org_status.sh (1)
324-333:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winResolve the remaining date-format instruction conflict.
This section requires
Mon-DDheaders, but Line 338 still saysDates: YYYY-MM-DD. That mixed guidance can make the model emit incorrect header formats.🐛 Suggested prompt-contract tweak
OUTPUT CONTRACT -- Dates: YYYY-MM-DD +- Dates: YYYY-MM-DD for row values; for the per-repo merge-activity matrix headers, use Mon-DD (e.g., Apr-26) - Section headers include total counts: `## Open Issues (47 total)` - Empty sections show _none_, never omit them - Every item with a url must be rendered as a markdown hyperlink🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@scripts/org_status.sh` around lines 324 - 333, The date-header format is inconsistent: the spec requires short Mon-DD (e.g. Apr-26) but the script still emits "Dates: YYYY-MM-DD"; update the generation and header text so both use Mon-DD. Locate the Per-repo-per-day table generation and the place emitting the "Dates: YYYY-MM-DD" label (search for that literal and the block that builds the repo-per-day header row) and change the date formatting to output short month-name and day (Mon-DD) for every date column, and update the header text/label to "Dates: Mon-DD" so the instructions and output match; ensure the TOTAL row summation and date ordering logic remain unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@scripts/org_status.sh`:
- Around line 324-333: The date-header format is inconsistent: the spec requires
short Mon-DD (e.g. Apr-26) but the script still emits "Dates: YYYY-MM-DD";
update the generation and header text so both use Mon-DD. Locate the
Per-repo-per-day table generation and the place emitting the "Dates: YYYY-MM-DD"
label (search for that literal and the block that builds the repo-per-day header
row) and change the date formatting to output short month-name and day (Mon-DD)
for every date column, and update the header text/label to "Dates: Mon-DD" so
the instructions and output match; ensure the TOTAL row summation and date
ordering logic remain unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: c8646189-318e-44e1-90a7-6c99f0140a63
📒 Files selected for processing (1)
scripts/org_status.sh
…vity by day (#184) * fix(org-status): fix first table truncation + add per-repo merge activity by day - Add CRITICAL instruction that all sections must be output in order so the PR summary table always appears first and is never missing from the report - Limit Open Issues data to 25 per repo (from unlimited) before sending to Claude, significantly reducing prompt payload and leaving Claude more output budget for the PR tables at the top of the report - Compute MERGE_BY_REPO_DAY: per-repo-per-day merge counts (jq, reuses existing ORG_MERGES / PERSONAL_MERGES raw data, no extra API calls) - Replace the flat | Repo | Merges | breakdown with a by-day matrix table: | Repo | Apr-26 | … | Apr-30 | Total | plus a TOTAL row - Keep the existing daily org-level | Date | petry-projects | don-petry | table as a companion summary; add Grand Total column - Remove the now-redundant "Org/Personal Merges Raw" prompt data sections (covered by the new per-repo-per-day data) - Update Open Issues instructions: show "(showing 25 of N)" when truncated rather than the old "(truncated at 1000)" note Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(org-status): address review comments — sort_by, ISSUE_LIMIT var, Mon-DD header - Add sort_by(.repo) before group_by(.repo) in MERGE_BY_REPO_DAY jq so the combined array is sorted before grouping (jq group_by requires sorted input; without this, records from the same repo could land in separate groups) - Extract the hard-coded issues-per-repo cap into an ISSUE_LIMIT variable and pass it via --argjson so the jq slice, the truncated flag, and the prompt text all stay in sync when the limit changes - Fix contradictory table-header example: replace YYYY-MM-DD placeholders with Mon-DD to match the date-format instruction on the following line Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…vity by day (#184) * fix(org-status): fix first table truncation + add per-repo merge activity by day - Add CRITICAL instruction that all sections must be output in order so the PR summary table always appears first and is never missing from the report - Limit Open Issues data to 25 per repo (from unlimited) before sending to Claude, significantly reducing prompt payload and leaving Claude more output budget for the PR tables at the top of the report - Compute MERGE_BY_REPO_DAY: per-repo-per-day merge counts (jq, reuses existing ORG_MERGES / PERSONAL_MERGES raw data, no extra API calls) - Replace the flat | Repo | Merges | breakdown with a by-day matrix table: | Repo | Apr-26 | … | Apr-30 | Total | plus a TOTAL row - Keep the existing daily org-level | Date | petry-projects | don-petry | table as a companion summary; add Grand Total column - Remove the now-redundant "Org/Personal Merges Raw" prompt data sections (covered by the new per-repo-per-day data) - Update Open Issues instructions: show "(showing 25 of N)" when truncated rather than the old "(truncated at 1000)" note Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(org-status): address review comments — sort_by, ISSUE_LIMIT var, Mon-DD header - Add sort_by(.repo) before group_by(.repo) in MERGE_BY_REPO_DAY jq so the combined array is sorted before grouping (jq group_by requires sorted input; without this, records from the same repo could land in separate groups) - Extract the hard-coded issues-per-repo cap into an ISSUE_LIMIT variable and pass it via --argjson so the jq slice, the truncated flag, and the prompt text all stay in sync when the limit changes - Fix contradictory table-header example: replace YYYY-MM-DD placeholders with Mon-DD to match the date-format instruction on the following line Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…vity by day (#184) * fix(org-status): fix first table truncation + add per-repo merge activity by day - Add CRITICAL instruction that all sections must be output in order so the PR summary table always appears first and is never missing from the report - Limit Open Issues data to 25 per repo (from unlimited) before sending to Claude, significantly reducing prompt payload and leaving Claude more output budget for the PR tables at the top of the report - Compute MERGE_BY_REPO_DAY: per-repo-per-day merge counts (jq, reuses existing ORG_MERGES / PERSONAL_MERGES raw data, no extra API calls) - Replace the flat | Repo | Merges | breakdown with a by-day matrix table: | Repo | Apr-26 | … | Apr-30 | Total | plus a TOTAL row - Keep the existing daily org-level | Date | petry-projects | don-petry | table as a companion summary; add Grand Total column - Remove the now-redundant "Org/Personal Merges Raw" prompt data sections (covered by the new per-repo-per-day data) - Update Open Issues instructions: show "(showing 25 of N)" when truncated rather than the old "(truncated at 1000)" note Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(org-status): address review comments — sort_by, ISSUE_LIMIT var, Mon-DD header - Add sort_by(.repo) before group_by(.repo) in MERGE_BY_REPO_DAY jq so the combined array is sorted before grouping (jq group_by requires sorted input; without this, records from the same repo could land in separate groups) - Extract the hard-coded issues-per-repo cap into an ISSUE_LIMIT variable and pass it via --argjson so the jq slice, the truncated flag, and the prompt text all stay in sync when the limit changes - Fix contradictory table-header example: replace YYYY-MM-DD placeholders with Mon-DD to match the date-format instruction on the following line Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…vity by day (#184) * fix(org-status): fix first table truncation + add per-repo merge activity by day - Add CRITICAL instruction that all sections must be output in order so the PR summary table always appears first and is never missing from the report - Limit Open Issues data to 25 per repo (from unlimited) before sending to Claude, significantly reducing prompt payload and leaving Claude more output budget for the PR tables at the top of the report - Compute MERGE_BY_REPO_DAY: per-repo-per-day merge counts (jq, reuses existing ORG_MERGES / PERSONAL_MERGES raw data, no extra API calls) - Replace the flat | Repo | Merges | breakdown with a by-day matrix table: | Repo | Apr-26 | … | Apr-30 | Total | plus a TOTAL row - Keep the existing daily org-level | Date | petry-projects | don-petry | table as a companion summary; add Grand Total column - Remove the now-redundant "Org/Personal Merges Raw" prompt data sections (covered by the new per-repo-per-day data) - Update Open Issues instructions: show "(showing 25 of N)" when truncated rather than the old "(truncated at 1000)" note Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(org-status): address review comments — sort_by, ISSUE_LIMIT var, Mon-DD header - Add sort_by(.repo) before group_by(.repo) in MERGE_BY_REPO_DAY jq so the combined array is sorted before grouping (jq group_by requires sorted input; without this, records from the same repo could land in separate groups) - Extract the hard-coded issues-per-repo cap into an ISSUE_LIMIT variable and pass it via --argjson so the jq slice, the truncated flag, and the prompt text all stay in sync when the limit changes - Fix contradictory table-header example: replace YYYY-MM-DD placeholders with Mon-DD to match the date-format instruction on the following line Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…vity by day (#184) * fix(org-status): fix first table truncation + add per-repo merge activity by day - Add CRITICAL instruction that all sections must be output in order so the PR summary table always appears first and is never missing from the report - Limit Open Issues data to 25 per repo (from unlimited) before sending to Claude, significantly reducing prompt payload and leaving Claude more output budget for the PR tables at the top of the report - Compute MERGE_BY_REPO_DAY: per-repo-per-day merge counts (jq, reuses existing ORG_MERGES / PERSONAL_MERGES raw data, no extra API calls) - Replace the flat | Repo | Merges | breakdown with a by-day matrix table: | Repo | Apr-26 | … | Apr-30 | Total | plus a TOTAL row - Keep the existing daily org-level | Date | petry-projects | don-petry | table as a companion summary; add Grand Total column - Remove the now-redundant "Org/Personal Merges Raw" prompt data sections (covered by the new per-repo-per-day data) - Update Open Issues instructions: show "(showing 25 of N)" when truncated rather than the old "(truncated at 1000)" note Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(org-status): address review comments — sort_by, ISSUE_LIMIT var, Mon-DD header - Add sort_by(.repo) before group_by(.repo) in MERGE_BY_REPO_DAY jq so the combined array is sorted before grouping (jq group_by requires sorted input; without this, records from the same repo could land in separate groups) - Extract the hard-coded issues-per-repo cap into an ISSUE_LIMIT variable and pass it via --argjson so the jq slice, the truncated flag, and the prompt text all stay in sync when the limit changes - Fix contradictory table-header example: replace YYYY-MM-DD placeholders with Mon-DD to match the date-format instruction on the following line Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>



Summary
CRITICALinstruction that all sections must be output in order with the PR summary first.MERGE_BY_REPO_DAYdata (per-repo per-day counts, computed in jq with no extra API calls). Updated the prompt format to produce a per-repo × per-day matrix table (| Repo | Apr-26 | … | Total |+TOTALrow) followed by the existing daily org-level summary table. Removed the now-redundant flat per-repo breakdown.Example output
Issue #188 — generated from this branch via
workflow_dispatch. Confirms:@don-petry+ PR blocker summary tableTest plan
workflow_dispatchand verify issue body starts with@don-petryfollowed by the PR blocker summary table🤖 Generated with Claude Code