Skip to content

fix(org-status): fix first-table truncation + add per-repo merge activity by day - #184

Merged
don-petry merged 5 commits into
mainfrom
claude/condescending-lehmann-ef4514
May 4, 2026
Merged

fix(org-status): fix first-table truncation + add per-repo merge activity by day#184
don-petry merged 5 commits into
mainfrom
claude/condescending-lehmann-ef4514

Conversation

@don-petry

@don-petry don-petry commented May 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • First table fix: Issue #179 body started mid-way through the Open Issues table — the entire PR summary (the first table) and all PR sections were missing. Root cause: the issues payload sent to Claude was unbounded (up to 1000 issues per repo), leaving too little output budget for the PR tables that appear first. Fixed by (a) limiting issues to 25/repo before handing off to Claude, and (b) adding a CRITICAL instruction that all sections must be output in order with the PR summary first.
  • Merge activity by day: Added MERGE_BY_REPO_DAY data (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 | + TOTAL row) 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:

  • Report opens correctly with @don-petry + PR blocker summary table
  • Merge Activity section shows the per-repo × per-day matrix with TOTAL row
  • Open Issues notes "(showing 25 of N)" for repos with more than 25 issues

Test plan

  • Trigger the workflow manually via workflow_dispatch and verify issue body starts with @don-petry followed by the PR blocker summary table
  • Confirm the PR Merge Activity section shows a matrix table with one column per date plus a Total column and TOTAL row
  • Confirm the Open Issues section notes "(showing 25 of N)" for repos with more than 25 issues

🤖 Generated with Claude Code

…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>
Copilot AI review requested due to automatic review settings May 4, 2026 11:46
@coderabbitai

coderabbitai Bot commented May 4, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The 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.

Changes

Merge Reporting and Issue Trimming Enhancement

Layer / File(s) Summary
Data Aggregation
scripts/org_status.sh (lines 155–168)
Adds MERGE_BY_REPO_DAY: aggregates merged PRs into per-repo totals and an 8-day by_date map keyed by YYYY-MM-DD.
Data Transformation & Wiring
scripts/org_status.sh (lines 231–240, 265–268)
Introduces ISSUE_LIMIT=25 and ISSUES_BY_REPO_TRIMMED (first 25 issues per repo plus truncated and original count); updates prompt DATA to include MERGE_BY_REPO_DAY and ISSUES_BY_REPO_TRIMMED, removing prior untrimmed/old merge inputs.
Report Templates
scripts/org_status.sh (lines 309–316, 324–334)
"Open Issues" now shows up to 25 rows per repo and annotates truncation as “(showing 25 of N)”. "PR Merge Activity — Last 8 Days" now renders a per-repo-per-day table with per-repo TOTAL row and a separate daily org-level summary table.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title directly reflects the main changes: fixing truncation in the first table (issues) and adding per-repo merge activity by day breakdown.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/condescending-lehmann-ef4514

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

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_DAY aggregation (computed locally in jq) 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.

Comment thread scripts/org_status.sh Outdated
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(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in the follow-up commit (sort_by/.repo added, ISSUE_LIMIT variable, Mon-DD header).

Comment thread scripts/org_status.sh Outdated
Comment on lines +231 to +239
# 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]
})')

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in the follow-up commit (sort_by/.repo added, ISSUE_LIMIT variable, Mon-DD header).

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between eb93d09 and fd8bb9c.

📒 Files selected for processing (1)
  • scripts/org_status.sh

Comment thread scripts/org_status.sh Outdated
github-actions Bot and others added 2 commits May 4, 2026 12:05
…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>
@sonarqubecloud

sonarqubecloud Bot commented May 4, 2026

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
scripts/org_status.sh (1)

324-333: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Resolve the remaining date-format instruction conflict.

This section requires Mon-DD headers, but Line 338 still says Dates: 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

📥 Commits

Reviewing files that changed from the base of the PR and between fd8bb9c and d15ec56.

📒 Files selected for processing (1)
  • scripts/org_status.sh

@don-petry
don-petry enabled auto-merge (squash) May 4, 2026 19:42
@don-petry
don-petry merged commit d0738f9 into main May 4, 2026
3 checks passed
@don-petry
don-petry deleted the claude/condescending-lehmann-ef4514 branch May 4, 2026 19:43
don-petry added a commit that referenced this pull request Jun 8, 2026
…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>
don-petry added a commit that referenced this pull request Jun 10, 2026
…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>
don-petry added a commit that referenced this pull request Jun 11, 2026
…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>
don-petry added a commit that referenced this pull request Jun 11, 2026
…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>
don-petry added a commit that referenced this pull request Jun 11, 2026
…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>
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