Skip to content

feat: implement issue #408 — Compliance: ruleset-drift-pr-quality-dismiss_stale_reviews_on_push - #434

Merged
don-petry merged 7 commits into
mainfrom
dev-lead/issue-408-20260721-1922
Aug 2, 2026
Merged

feat: implement issue #408 — Compliance: ruleset-drift-pr-quality-dismiss_stale_reviews_on_push#434
don-petry merged 7 commits into
mainfrom
dev-lead/issue-408-20260721-1922

Conversation

@don-petry

@don-petry don-petry commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

User description

Closes #408

Implemented by dev-lead agent. Please review.

Summary by CodeRabbit

  • New Features

    • Added deterministic dry-run support for ruleset updates without requiring a network connection.
    • Dry-run output now includes the required rulesets and pull-request review settings.
  • Tests

    • Added automated coverage validating dry-run execution, output contents, and failure reporting.
    • Added continuous integration checks to verify ruleset compliance automatically.

CodeAnt-AI Description

Make ruleset dry runs offline and verify pull request review protections

What Changed

  • Ruleset dry runs no longer fetch existing rulesets from GitHub, producing deterministic output without network calls
  • Added compliance checks confirming pr-quality dismisses stale reviews after pushes and requires the standard approval protections
  • Added CI coverage for both required rulesets and their review settings
  • Updated locked dependency versions for PostCSS, brace expansion, and related packages

Impact

✅ Offline ruleset validation
✅ Enforced stale-review dismissal
✅ Automated pull request protection checks

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Copilot AI review requested due to automatic review settings July 21, 2026 19:28
@don-petry
don-petry requested a review from a team as a code owner July 21, 2026 19:28
@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 21, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 48 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 Plus

Run ID: d71f22cd-242f-40fe-b415-981ecab772ac

📥 Commits

Reviewing files that changed from the base of the PR and between e31b863 and 77c334a.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • tests/scripts/apply-rulesets.test.sh
📝 Walkthrough

Walkthrough

Dry-run mode now avoids live ruleset API calls. A Bash test validates the generated ruleset payload and runs in CI. Workspace dependency overrides require newer minimum versions.

Changes

Ruleset dry-run

Layer / File(s) Summary
Dry-run execution
scripts/apply-rulesets.sh
Dry-run mode skips the live rulesets API fetch and uses an empty existing-ruleset list. Normal execution retains API fetching and error handling.
Dry-run payload validation and CI execution
tests/scripts/apply-rulesets.test.sh, .github/workflows/ci.yml
The test runs the script with a dummy token, validates required ruleset settings, and runs as a GitHub Actions job.

Workspace dependency overrides

Layer / File(s) Summary
Dependency minimum versions
pnpm-workspace.yaml
The workspace overrides require newer minimum versions of postcss and brace-expansion.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

  • petry-projects/markets 324 — Covers validation of the pr-quality dismiss_stale_reviews_on_push setting.
  • petry-projects/ContentTwin 388 — Covers updates and tests for the same ruleset script and setting.
  • petry-projects/ContentTwin 400 — Covers pr-quality ruleset configuration and validation.

Suggested reviewers: donpetry-bot

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The postcss and brace-expansion dependency override changes are unrelated to issue #408's ruleset compliance objective. Move the dependency override and lockfile updates to a separate pull request unless they are required by the ruleset implementation.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes validate that pr-quality sets dismiss_stale_reviews_on_push to true and emit both required rulesets in dry-run mode.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the ruleset compliance change for issue #408 and the dismiss_stale_reviews_on_push requirement.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev-lead/issue-408-20260721-1922

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 updates scripts/apply-rulesets.sh to support an offline dry-run mode by skipping live GitHub API calls when DRY_RUN is enabled. It also introduces a new test script, tests/scripts/apply-rulesets.test.sh, to validate the codified ruleset configurations. Feedback is provided to optimize the test assertions using Bash here-strings and grep -F, and to simplify the script existence check since executable permissions are not strictly required when running via bash.

Comment thread tests/scripts/apply-rulesets.test.sh
Comment thread tests/scripts/apply-rulesets.test.sh Outdated

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.

Pull request overview

This PR addresses compliance issue #408 by adding a regression test to ensure the codified pr-quality ruleset includes dismiss_stale_reviews_on_push: true, and by adjusting the ruleset application script so --dry-run does not perform live GitHub API fetches.

Changes:

  • Add a shell test that runs scripts/apply-rulesets.sh --dry-run --force and asserts the emitted ruleset JSON includes the compliance-critical fields.
  • Update scripts/apply-rulesets.sh to skip fetching existing rulesets from GitHub when --dry-run is enabled (treating existing rulesets as []).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/scripts/apply-rulesets.test.sh Adds a dry-run-based regression test asserting the pr-quality payload includes dismiss_stale_reviews_on_push: true and other key parameters.
scripts/apply-rulesets.sh Makes --dry-run avoid the live gh api repos/.../rulesets fetch to allow offline-ish dry runs and deterministic output.

Comment thread scripts/apply-rulesets.sh Outdated
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@don-petry
don-petry enabled auto-merge (squash) July 21, 2026 19:41
@don-petry
don-petry disabled auto-merge July 21, 2026 20:02
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — fix-bot-comment (no-changes)

Agent reasoning
Looking at the bot comment and PR state, the SonarCloud quality gate has **passed with zero findings**:
- 0 New issues
- 0 Accepted issues  
- 0 Security Hotspots
- 0.0% Coverage on New Code
- 0.0% Duplication on New Code
**CI check results:** All code quality checks passed (SonarCloud, CodeQL, Go, TypeScript, dependency audits). The two cancelled checks (`dev-lead / ci-relay` and `dev-lead / dispatch`) are workflow-related and marked `[skip ci-relay]` in the commit.
**Review state:** No reviewers have requested changes. Copilot and Gemini provided informational comments but no blockers.
## Summary
**No actionable issues to address.** The quality gate passed and no code fixes are required. The PR is clean from a code quality and security perspective.

@codeant-ai

codeant-ai Bot commented Aug 2, 2026

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR e31b863 Aug 02, 2026 · 16:46 16:47
✅ Reviewed your PR 7d9c27b Aug 02, 2026 · 15:32 15:34
✅ Reviewed your PR 6b252dd Aug 02, 2026 · 15:18 15:20

@codeant-ai codeant-ai Bot added the size:M This PR changes 30-99 lines, ignoring generated files label Aug 2, 2026
@don-petry
don-petry disabled auto-merge August 2, 2026 15:19
@don-petry
don-petry disabled auto-merge August 2, 2026 16:42
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — fix-reviews (applied)

Changes committed and pushed.

@don-petry
don-petry enabled auto-merge (squash) August 2, 2026 16:46
@codeant-ai codeant-ai Bot added size:L This PR changes 100-499 lines, ignoring generated files and removed size:L This PR changes 100-499 lines, ignoring generated files labels Aug 2, 2026
Comment thread tests/scripts/apply-rulesets.test.sh Outdated
Comment thread tests/scripts/apply-rulesets.test.sh Outdated
@don-petry
don-petry disabled auto-merge August 2, 2026 16:50

@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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci.yml:
- Line 169: Update the actions/checkout step in the test job to disable
credential persistence by configuring its persist-credentials option as false.
Keep the existing pinned checkout revision and all other workflow behavior
unchanged.

In `@tests/scripts/apply-rulesets.test.sh`:
- Around line 59-60: Update the _dismiss extraction and assertion to validate
that .parameters.dismiss_stale_reviews_on_push is a JSON boolean before
accepting true; perform the type check inside jq and print only the validated
boolean result, preserving false as the default for missing values.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2fad0e22-d4fc-403c-81e1-d8766def4eba

📥 Commits

Reviewing files that changed from the base of the PR and between 6b252dd and e31b863.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • .github/workflows/ci.yml
  • pnpm-workspace.yaml
  • tests/scripts/apply-rulesets.test.sh

Comment thread .github/workflows/ci.yml
Comment thread tests/scripts/apply-rulesets.test.sh Outdated
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@don-petry
don-petry enabled auto-merge (squash) August 2, 2026 16:52
@don-petry
don-petry disabled auto-merge August 2, 2026 16:55
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@don-petry
don-petry enabled auto-merge (squash) August 2, 2026 16:57
@don-petry
don-petry disabled auto-merge August 2, 2026 16:58
@sonarqubecloud

sonarqubecloud Bot commented Aug 2, 2026

Copy link
Copy Markdown

@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — waiting on PR blockers (intent: fix-reviews)

PR: #434
No changes were committed, but the PR still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews). The retry cron will re-attempt automatically. Next attempt after: 2026-08-02T17:30:03Z

@don-petry
don-petry enabled auto-merge (squash) August 2, 2026 17:00
@don-petry
don-petry disabled auto-merge August 2, 2026 17:16
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — fix-reviews (no-changes)

Agent reasoning
Addressed 0 threads:
  (no open threads)
Test verification: skipped — no code changes made
Files changed: none
```

@don-petry
don-petry enabled auto-merge (squash) August 2, 2026 17:17

@donpetry-bot donpetry-bot 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.

Automated review — APPROVED ✓

Risk: MEDIUM
Reviewed commit: 77c334af237d813df0767e33b318c73df3b7b7b9
Review mode: triage-approved (single reviewer)

Summary

Compliance fix for issue #408: makes apply-rulesets.sh --dry-run fully offline/deterministic (skips the live rulesets fetch), adds a shell test asserting the codified pr-quality ruleset sets dismiss_stale_reviews_on_push=true plus the other standard PR-protection parameters, wires the test into CI as a new Shell Tests job, and bumps override floors for postcss/brace-expansion (with lockfile updates for postcss, brace-expansion, nanoid).

Linked issue analysis

Issue #408 (ruleset-drift-pr-quality-dismiss_stale_reviews_on_push) reports the pr-quality ruleset drifted from the codified standard (dismiss_stale_reviews_on_push expected true). This PR verifies the codified payload emits the correct value and adds a CI guard so a regression cannot land silently; the test also pins the remaining standard pull_request parameters (1 approving review, code-owner review, last-push approval, thread resolution) scoped to the pr-quality ruleset object so a match in another ruleset cannot produce a false pass. Substantively addresses the finding — actual convergence remains a run of scripts/apply-rulesets.sh with admin scope, per the issue's remediation.

Findings

  • Triage assessment confirmed: no issues that would block approval.
  • Workflow change is clean: new Shell Tests job uses actions/checkout pinned to 9c091bb2 (verified via GitHub API to be the v7.0.0 tag), persist-credentials: false, no secrets, no untrusted-input interpolation.
  • Test hygiene is good: a mock gh shim is first on PATH and hard-fails on any 'gh api' invocation, so a dry-run regression cannot silently make a live API call; assertions use grep -qF with fixed strings and jq scoped to the pr-quality object.
  • Dependency changes are patch-level floor bumps of existing overrides (postcss >=8.5.18, brace-expansion >=5.0.8) with matching lockfile resolution (postcss 8.5.25, brace-expansion 5.0.9, nanoid 3.3.16); pnpm audit is green.
  • Minor (non-blocking): the test filters info lines with grep -v '^[' before jq -s, which assumes payload JSON never starts a line with '['; acceptable given the script's current output format.
  • Advisory bot feedback (gemini here-string/grep -F suggestion) is already applied in the current head. SonarCloud quality gate passed.
  • Secret scan: the run_secret_scanning MCP tool is not available in this environment; the gitleaks CI check passed on the head SHA and no secrets are present in the diff.

CI status

All code CI checks on head 77c334a are green: TypeScript, Go, Shell Tests, CodeQL (3 analyses), SonarCloud, SonarCloud Code Analysis, Secret scan (gitleaks), agent-shield, dependency-audit (pnpm audit, govulncheck), Graphite AI Reviews. Cancelled/skipped entries (dev-lead dispatch/ci-relay, review/review) are superseded agent-orchestration runs, each with a later success/skipped run of the same workflow; they are not code CI.


Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files

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