feat: implement issue #409 — Compliance: ruleset-drift-pr-quality-require_last_push_approval - #414
feat: implement issue #409 — Compliance: ruleset-drift-pr-quality-require_last_push_approval#414don-petry wants to merge 2 commits into
Conversation
…uire_last_push_approval
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
Next review available in: 43 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL 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 |
There was a problem hiding this comment.
Code Review
This pull request introduces a new Bash test script, tests/scripts/apply-rulesets.test.sh, which stubs the gh CLI to verify that the apply-rulesets.sh script correctly outputs the expected PR quality ruleset parameters during a dry run. The review feedback suggests several improvements to make the script more robust: adding a guard to ensure mktemp -d successfully creates a temporary directory before writing to it, enabling set -e to exit immediately on errors, and safely capturing the exit status of the dry-run command under set -e.
| STUB_DIR="$(mktemp -d)" | ||
| trap 'rm -rf "$STUB_DIR"' EXIT |
There was a problem hiding this comment.
If mktemp -d fails, STUB_DIR will be empty. Since set -e is not enabled in this script, execution will continue and attempt to write the stub to /gh (since "$STUB_DIR/gh" resolves to /gh), which can cause permission errors or write to the root directory if run as root. Adding a guard to check that STUB_DIR is non-empty and exists prevents this.
| STUB_DIR="$(mktemp -d)" | |
| trap 'rm -rf "$STUB_DIR"' EXIT | |
| STUB_DIR="$(mktemp -d)" | |
| if [[ -z "${STUB_DIR:-}" || ! -d "$STUB_DIR" ]]; then | |
| echo "not ok - failed to create temporary directory" | |
| exit 1 | |
| fi | |
| trap 'rm -rf "$STUB_DIR"' EXIT |
There was a problem hiding this comment.
Fixed in tests/scripts/apply-rulesets.test.sh: added a guard immediately after the mktemp -d call that checks STUB_DIR is non-empty and is a real directory, printing not ok and exiting 1 if either condition fails. The trap is now placed after the guard so it only runs when the directory was successfully created.
There was a problem hiding this comment.
Pull request overview
Adds a shell test that guards Broodly’s repo-ruleset automation against future drift in the pr-quality ruleset—specifically ensuring require_last_push_approval remains codified as true, as required by compliance issue #409.
Changes:
- Adds
tests/scripts/apply-rulesets.test.shto runscripts/apply-rulesets.shin--dry-run --forcemode. - Stubs the
ghCLI so the test is network-free and does not require real GitHub credentials. - Asserts the emitted
pr-qualityruleset payload includes the required pull request parameters (includingrequire_last_push_approval: true).
Dev-Lead — review-changes (applied)Changes committed and pushed. |
|
Dev-Lead — fix-bot-comment (no-changes)Agent reasoning |
|
Closing as part of the 50-PR cap drain. The dev-lead fix-loop repairs #1340 (self-cancellation), #1290 (comment-inertness) and #806 (thread-resolution) have all landed, so this deadlocked PR can be regenerated cleanly through the repaired loop. The driving issue stays open and its dev-lead label is re-fired — no work is lost. |
Pull request was closed



Closes #409
Implemented by dev-lead agent. Please review.