feat(org-status): add Needs Rebase column to daily PR table#231
Conversation
…allback - org_status.sh: query headRefName/baseRefName, compute behind_by per PR via the REST compare API, surface a Needs Rebase column in the existing per-repo open-PRs table, and emit /tmp/needs-rebase.json for the follow-up commenter. - daily-org-status.yml: post an idempotent @claude rebase request on each stale PR (sentinel <!-- claude-rebase-request -->) using GH_PAT_WORKFLOWS so the comment author is OWNER and the Claude reusable workflow fires. - auto-rebase-reusable.yml: when update-branch is blocked by the missing workflows permission, post an @claude rebase request via GH_PAT_WORKFLOWS (sentinel <!-- auto-rebase-claude-request -->); fall back to the original manual-rebase comment when GH_PAT_WORKFLOWS is unset. - standards/workflows/auto-rebase.yml: document the optional GH_PAT_WORKFLOWS secret that enables the @claude fallback for consumer repos.
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 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 |
|
Auto-rebase blocked — the base branch contains Please rebase this branch manually: |
Following manual validation, @claude cannot perform branch operations (rebase/merge/history rewrite), so the agentic rebase fallback in #231 will not work. Reduce the PR to its reporting-only core: - Revert .github/workflows/auto-rebase-reusable.yml and standards/workflows/auto-rebase.yml to main. - Revert .github/workflows/daily-org-status.yml (drop the @claude comment step, pull-requests: write permission, REBASE_LIST_FILE env). - scripts/org_status.sh: drop the /tmp/needs-rebase.json sidecar; keep the behind_by detection and Needs Rebase column in the existing per-repo open-PRs table.
…mpliance-prs-6ojvJ
There was a problem hiding this comment.
Pull request overview
Adds “Needs Rebase” signal to the daily org status report’s per-repo open PR breakdown by computing whether each open PR branch is behind its base branch.
Changes:
- Extends the PR GraphQL query to capture
headRefName/baseRefName. - Adds a per-PR REST compare pass to compute
behind_byand flags PRs asneedsRebase. - Updates the per-repo aggregated PR counts and prompt format to include a “Needs Rebase” column.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| AUGMENTED='[]' | ||
| while IFS= read -r pr; do | ||
| [ -z "$pr" ] && continue | ||
| pr_repo=$(echo "$pr" | jq -r '.repo') | ||
| pr_head=$(echo "$pr" | jq -r '.headRefName') | ||
| pr_base=$(echo "$pr" | jq -r '.baseRefName') | ||
| behind=$(gh api "repos/${pr_repo}/compare/${pr_base}...${pr_head}" --jq '.behind_by' 2>/dev/null || echo 0) | ||
| [[ "$behind" =~ ^[0-9]+$ ]] || behind=0 | ||
| augmented_pr=$(echo "$pr" | jq --argjson b "$behind" '. + {behindBy: $b, needsRebase: ($b > 0)}') | ||
| AUGMENTED=$(jq -n --argjson a "$AUGMENTED" --argjson p "$augmented_pr" '$a + [$p]') | ||
| done <<< "$(echo "$ALL_PRS" | jq -c '.[]')" |
…lurp Address Copilot review on PR #231: - Accumulate one augmented PR per line of NDJSON, then slurp into a single array at the end via jq -s '.'. Avoids reparsing a growing array on each iteration of the loop, which was O(n^2) in time and memory. - Replace silent compare-API fallback (|| echo 0) with a warning logged to stderr so transient API failures or fork-PR 404s are visible in the workflow log instead of silently zeroing behindBy.
|



Summary
Adds a Needs Rebase column to the existing per-repo open-PRs table in the daily org status report. Reporting only — no automated rebase or comments.
Changes
scripts/org_status.sh:headRefName/baseRefNameon each open PR.GET repos/{repo}/compare/{base}...{head}per PR to computebehind_by; PRs withbehind_by > 0are taggedneedsRebase: true.PR_BY_REPOaggregation gains aneeds_rebasecount.Needs Rebasecolumn renderingN 🔄when count > 0,—otherwise.Why
Most open compliance PRs that aren't merging are either behind
mainor actively conflicting. The daily report previously gave no signal of this — surfacing it in the existing PR table makes the drift visible without adding a new table or any automated action.What was removed
A first iteration of this PR tried to close the loop by:
@claudecomments on stale PRs fromdaily-org-status.yml@claudefallback toauto-rebase-reusable.ymlwhenupdate-branchfails with the missingworkflowspermissionManual validation on #213 (job 25635994899) confirmed that
claude-code-actioncannot perform branch operations (rebase / merge / history rewrite), so the agentic fallback would never have worked. Both of those changes have been reverted; this PR is now scoped to surfacing the signal only. A follow-up can wire in aGH_PAT_WORKFLOWS-based retry inauto-rebase-reusable.ymlif/when that becomes the right next step.Test plan
Daily Org Statusviaworkflow_dispatch; verify the per-repo PR table includes aNeeds Rebasecolumn with realistic values.main(e.g. fix(feature-ideation): address Copilot + CodeRabbit review on PR #85 (18 fixes, 17 new tests) #85, fix(ci): remediate .github compliance findings — 2026-04-17 audit #147) and confirm it shows a non-zero count.