feat: implement issue #324 — Compliance: ruleset-drift-pr-quality-dismiss_stale_reviews_on_push - #333
feat: implement issue #324 — Compliance: ruleset-drift-pr-quality-dismiss_stale_reviews_on_push#333don-petry wants to merge 1 commit into
Conversation
…miss_stale_reviews_on_push
|
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: 51 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 (2)
✨ 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 bash script, apply-pr-quality-ruleset.sh, to idempotently manage the pr-quality repository ruleset for the petry-projects/markets repository, along with a suite of BATS tests to validate its structure. The review feedback suggests improving the script's robustness by avoiding error masking when querying existing rulesets and adding a pre-flight check to ensure required CLI dependencies (gh and jq) are installed.
| EXISTING_ID=$(gh api "repos/$REPO/rulesets" \ | ||
| --jq ".[] | select(.name == \"$RULESET_NAME\") | .id" 2>/dev/null || true) |
There was a problem hiding this comment.
Masking errors with 2>/dev/null || true when fetching the existing ruleset ID can lead to unexpected behavior. If the gh api call fails due to network issues, expired credentials, or insufficient permissions, the script will silently ignore the error, assume the ruleset does not exist, and attempt to create a duplicate ruleset (which will then fail or cause conflicts). Since set -e is active, we should let the command fail naturally so the script terminates immediately with a clear error.
| EXISTING_ID=$(gh api "repos/$REPO/rulesets" \ | |
| --jq ".[] | select(.name == \"$RULESET_NAME\") | .id" 2>/dev/null || true) | |
| EXISTING_ID=$(gh api "repos/$REPO/rulesets" \\ | |
| --jq ".[] | select(.name == \"$RULESET_NAME\") | .id") |
| if [ -z "${GH_TOKEN:-}" ]; then | ||
| echo "ERROR: GH_TOKEN is required with administration:write scope" >&2 | ||
| exit 1 | ||
| fi |
There was a problem hiding this comment.
It is a good practice to verify that all external CLI dependencies (gh and jq) are installed and available in the system path before executing the script. This ensures the script fails fast with a clear error message if any dependency is missing.
| if [ -z "${GH_TOKEN:-}" ]; then | |
| echo "ERROR: GH_TOKEN is required with administration:write scope" >&2 | |
| exit 1 | |
| fi | |
| for cmd in gh jq; do | |
| if ! command -v "$cmd" &> /dev/null; then | |
| echo "ERROR: Required command '$cmd' is not installed." >&2 | |
| exit 1 | |
| fi | |
| done | |
| if [ -z "${GH_TOKEN:-}" ]; then | |
| echo "ERROR: GH_TOKEN is required with administration:write scope" >&2 | |
| exit 1 | |
| fi |
|
There was a problem hiding this comment.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Note
This error may be related to your runner configuration. You can now configure runners for Copilot code review separately from Copilot cloud agent by creating a copilot-code-review.yml file with your setup steps. Read the docs for details.
|
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. |



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