Skip to content

feat: implement issue #324 — Compliance: ruleset-drift-pr-quality-dismiss_stale_reviews_on_push - #333

Closed
don-petry wants to merge 1 commit into
mainfrom
dev-lead/issue-324-20260717-1359
Closed

feat: implement issue #324 — Compliance: ruleset-drift-pr-quality-dismiss_stale_reviews_on_push#333
don-petry wants to merge 1 commit into
mainfrom
dev-lead/issue-324-20260717-1359

Conversation

@don-petry

Copy link
Copy Markdown
Contributor

Closes #324

Implemented by dev-lead agent. Please review.

Copilot AI review requested due to automatic review settings July 17, 2026 14:04
@don-petry
don-petry requested a review from a team as a code owner July 17, 2026 14:04
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@don-petry, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 51 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: feadd5be-7e05-4db7-9d62-37a5ca9c80cf

📥 Commits

Reviewing files that changed from the base of the PR and between 8e2a986 and 5510a39.

📒 Files selected for processing (2)
  • .github/scripts/apply-pr-quality-ruleset.sh
  • .github/scripts/tests/apply-pr-quality-ruleset.bats
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev-lead/issue-324-20260717-1359

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.

@gemini-code-assist gemini-code-assist 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.

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.

Comment on lines +40 to +41
EXISTING_ID=$(gh api "repos/$REPO/rulesets" \
--jq ".[] | select(.name == \"$RULESET_NAME\") | .id" 2>/dev/null || true)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

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.

Suggested change
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")

Comment on lines +32 to +35
if [ -z "${GH_TOKEN:-}" ]; then
echo "ERROR: GH_TOKEN is required with administration:write scope" >&2
exit 1
fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

low

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.

Suggested change
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

@sonarqubecloud

Copy link
Copy Markdown

Copilot stopped reviewing on behalf of don-petry due to an error July 17, 2026 14:35

Copilot AI 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.

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.

@don-petry

Copy link
Copy Markdown
Contributor Author

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.

@don-petry don-petry closed this Jul 21, 2026
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.

Compliance: ruleset-drift-pr-quality-dismiss_stale_reviews_on_push

3 participants