Skip to content

feat: implement issue #851 — [#850 A] Automated standards-deploy driver (scheduled fleet sweep → standards-sync PRs) - #854

Merged
don-petry merged 4 commits into
mainfrom
dev-lead/issue-851-20260721-2303
Jul 22, 2026
Merged

don-petry merged 4 commits into
mainfrom
dev-lead/issue-851-20260721-2303

Conversation

@don-petry

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

Copy link
Copy Markdown
Contributor

User description

Closes #851

Implemented by dev-lead agent. Please review.


CodeAnt-AI Description

Add scheduled standards deployment for drifting repos

What Changed

  • Added a scheduled workflow that sweeps the org fleet and opens standards-sync pull requests when a repo is missing a required workflow stub or is out of sync.
  • Added manual run options to target one repo, one workflow, or run in dry-run mode without opening pull requests.
  • Added test coverage for the new driver behavior, including fleet-wide sweeps, targeted runs, dry-run behavior, and no-op cases for compliant repos.
  • Updated the workflow tests to include the new driver script and scheduled workflow file.

Impact

✅ Fewer manual standards-sync runs
✅ Faster cleanup of drifted repos
✅ Safer dry-run checks before changes

💡 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.

…er (scheduled fleet sweep → standards-sync PRs)
Copilot AI review requested due to automatic review settings July 21, 2026 23:11
@don-petry
don-petry requested a review from a team as a code owner July 21, 2026 23:11
@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.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Jul 21, 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: 25 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 792a7f5f-5263-4f43-9e9a-2ad0d6da887a

📥 Commits

Reviewing files that changed from the base of the PR and between 1eca5df and dc0ed12.

📒 Files selected for processing (4)
  • .github/workflows/standards-deploy-tests.yml
  • .github/workflows/standards-deploy.yml
  • scripts/standards-deploy-driver.sh
  • test/scripts/standards-deploy-driver/driver.bats
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev-lead/issue-851-20260721-2303

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.

@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — review-changes (no-changes)

No changes were needed for this PR.

@don-petry
don-petry enabled auto-merge (squash) July 21, 2026 23:11

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

Pull request overview

Adds a scheduled + on-demand GitHub Actions “driver” to run the existing deploy-standard-workflows.sh fleet sweep automatically, so drifted repos get standards-sync PRs without manual intervention (issue #851 / Epic #850-A).

Changes:

  • Introduces scripts/standards-deploy-driver.sh to map workflow_dispatch inputs (env vars) to deploy-standard-workflows.sh flags.
  • Adds a new scheduled/dispatch workflow .github/workflows/standards-deploy.yml to run the driver weekly (and on demand).
  • Adds a dedicated bats suite for the driver and wires it into the existing standards-deploy-tests.yml quality gates.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
scripts/standards-deploy-driver.sh Thin wrapper that translates workflow env inputs into deploy-script flags and executes the deploy sweep.
.github/workflows/standards-deploy.yml New scheduled + dispatch workflow that runs the fleet sweep using the org PAT.
test/scripts/standards-deploy-driver/driver.bats Bats coverage for argv mapping plus drift/no-op paths via a gh stub.
.github/workflows/standards-deploy-tests.yml Extends existing lint+bats gating to include the new driver script, tests, and workflow.

Comment thread scripts/standards-deploy-driver.sh Resolved
Comment thread .github/workflows/standards-deploy.yml Resolved
Comment thread .github/workflows/standards-deploy.yml Resolved
@donpetry-bot

donpetry-bot commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor
Superseded by automated re-review at dc0ed12dffd10160cd1b2689c9d10cffcfe709bf — click to expand prior review.

Review — fix requested (cycle 1/3)

The automated review identified the following issues. Please address each one:

Findings to fix

Automated review — NEEDS HUMAN REVIEW

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

Summary

Adds a scheduled (Mon 08:00 UTC) + workflow_dispatch driver that runs the existing deploy-standard-workflows.sh fleet sweep, opening standards-sync PRs for drifted repos (issue #851, Epic #850-A). The driver is deliberately thin — env→flag mapping only, no new deploy logic — and comes with a bats suite covering argv mapping plus drift/no-op paths against the real deploy script. Workflow security posture is good: schedule/dispatch-only triggers (no untrusted PR input), top-level 'permissions: {}' with job-level 'contents: read', SHA-pinned checkout action, inputs passed via env (no expression injection into run steps), and the established ORG_SCORECARD_TOKEN org PAT (already used by 10+ files in this repo) for cross-repo writes, exactly as the issue specified. The triage tier's low-risk read of the code itself is confirmed; escalation is solely due to unresolved review threads (gate 4).

Linked issue analysis

Issue #851 is substantively addressed: (1) scheduled + dispatch workflow standards-deploy.yml, cadence offset from the Friday compliance audit; (2) reuses the existing script/label — driver adds no deploy logic; (3) idempotency and SKIP_REPOS/SKIP_OVERRIDES remain in the deploy script, exercised by the no-op bats test; (4) dispatch supports fleet, single-repo, and single-workflow sweeps plus dry-run; (5) org PAT with least-privilege workflow permissions; (6) bats tests cover drift-detection and no-op paths as required by acceptance criteria, wired into the existing standards-deploy-tests.yml quality gate.

Findings

Blocking (process): 3 unresolved Copilot review threads. The dev-lead review-changes pass posted 'no changes needed' at 23:11:50 UTC, but Copilot's review landed at 23:14:06 UTC — so these comments were never triaged:

  1. scripts/standards-deploy-driver.sh:45 — Copilot suggests simplifying ${args[@]+"${args[@]}"}. Note: this is a deliberate defensive idiom for empty arrays under set -u on older bash; the code is correct as written. A reply/resolution (not necessarily a code change) is sufficient.
  2. .github/workflows/standards-deploy.yml:34 — default: 'false' on a type: boolean input should be the boolean literal false, not a quoted string.
  3. .github/workflows/standards-deploy.yml:53 — ${{ inputs.dry_run || 'false' }} mixes boolean/string types. It behaves correctly ('true'/'false' string reaches the driver in all trigger paths), but an explicit string mapping would be clearer.

Minor (non-blocking, reviewer observation): in test/scripts/standards-deploy-driver/driver.bats, the no-op assertion echo "$output" | grep -vq 'Would open PR' is a tautology (grep -v succeeds if ANY line doesn't match); ! grep -q was likely intended. Worth fixing while addressing the threads.

Secret scan: run_secret_scanning MCP tool unavailable in this run; gitleaks CI check passed. No secrets in the diff.

CI status

All checks green: Lint, ShellCheck, Agent Security Scan, Secret scan (gitleaks), CodeQL (actions), SonarCloud (quality gate passed, 0 issues/hotspots), Standards Deploy Tests (lint + bats incl. the new driver suite), Dependency Hardening Tests, AgentShield, npm audit. Remaining skips are ecosystem-not-present audits. mergeStateStatus BLOCKED only pending review.


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

Additional tasks

  1. Resolve all unresolved review thread comments from other reviewers
  2. Ensure all CI checks pass after your changes
  3. Rebase on the target branch if behind
  4. Do NOT modify files unrelated to the findings above

The review cascade will automatically re-review after new commits are pushed.

@codeant-ai

codeant-ai Bot commented Jul 22, 2026 •

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR 11eae23 Jul 22, 2026 · 02:44 02:47

Updated in place by CodeAnt AI · last 5 reviews

@codeant-ai codeant-ai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Jul 22, 2026
@don-petry
don-petry disabled auto-merge July 22, 2026 02:45
@don-petry don-petry added the dev-lead:hands-off Opt an item out of the dev-lead persona automation entirely label Jul 22, 2026
- driver: simplify exec to "${args[@]}" (empty-array-safe in modern bash;
  drops the redundant ${args[@]+...} guard and its shellcheck noise)
- workflow: use a boolean literal `default: false` for the type:boolean
  dry_run input (was quoted string)
- workflow: map DRY_RUN explicitly to the "true"/"false" strings the driver
  checks, instead of mixing boolean/string via `|| 'false'`

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CoxYr15rT5ceo7UKZ6r86Y
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 22, 2026
@don-petry
don-petry enabled auto-merge (squash) July 22, 2026 02:48
codeant (Major): `grep -vq 'Would open PR'` passes whenever ANY line does not
match, so the no-op test couldn't prove PR-absence. Use a true absence check
`! ... | grep -q` so a regression that plans a PR on the compliant path fails.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CoxYr15rT5ceo7UKZ6r86Y
@sonarqubecloud

Copy link
Copy Markdown

@don-petry
don-petry merged commit 855b846 into main Jul 22, 2026
27 checks passed
@don-petry
don-petry deleted the dev-lead/issue-851-20260721-2303 branch July 22, 2026 02:53

@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: dc0ed12dffd10160cd1b2689c9d10cffcfe709bf
Review mode: triage-approved (single reviewer)

Summary

Adds a scheduled (Mon 08:00 UTC) + workflow_dispatch driver that runs the existing deploy-standard-workflows.sh fleet sweep, opening standards-sync PRs for drifted repos (issue #851, Epic #850-A). The driver stays deliberately thin (env→flag mapping only) and ships with a bats suite covering argv mapping plus drift/no-op paths against the real deploy script. This is cycle 2: the prior review at cd60399 escalated solely on 3 unresolved Copilot threads (gate 4) plus a minor bats tautology — all four points are now fixed in commits ec5864a and dc0ed12, and every review thread is resolved.

Linked issue analysis

Issue #851 substantively addressed: (1) scheduled + dispatch workflow standards-deploy.yml, Monday cadence offset from the Friday compliance audit; (2) reuses the existing deploy script and standards-sync label — the driver adds no deploy logic; (3) idempotency and SKIP_REPOS/SKIP_OVERRIDES remain in the deploy script, exercised by the no-op bats test; (4) dispatch supports fleet, single-repo, single-workflow, and dry-run sweeps; (5) uses the established ORG_SCORECARD_TOKEN org PAT with least-privilege workflow permissions (top-level 'permissions: {}', job-level contents: read); (6) bats tests cover drift-detection and no-op paths, wired into the standards-deploy-tests.yml gate.

Findings

All prior-cycle findings resolved, no new issues:

  1. ✅ ${args[@]+"${args[@]}"} idiom simplified to plain "${args[@]}" (scripts/standards-deploy-driver.sh:45) — thread resolved; ShellCheck green on bash 5.x runners.
  2. ✅ default: 'false' string → boolean literal default: false on the dry_run input (standards-deploy.yml:34).
  3. ✅ ${{ inputs.dry_run || 'false' }} type-mixing replaced with explicit mapping ${{ inputs.dry_run == true && 'true' || 'false' }} (standards-deploy.yml:53).
  4. ✅ bats no-op tautology fixed: grep -vq → ! grep -q 'Would open PR' — a true absence check (driver.bats, commit dc0ed12).

The merge of main (11eae23) brings no conflicts with this PR's files. Security posture unchanged and good: schedule/dispatch-only triggers, no untrusted input interpolation (inputs pass via env), SHA-pinned checkout, established org PAT. All 4 review threads resolved; CodeRabbit approved; no unanswered human-reviewer questions.

Secret scan: run_secret_scanning MCP tool unavailable in this run; gitleaks CI check passed. No secrets in the diff.

CI status

All checks green at dc0ed12: Lint, ShellCheck, bats (incl. new driver suite), Agent Security Scan, Secret scan (gitleaks), CodeQL (actions), SonarCloud (quality gate passed), AgentShield, npm audit, Lint and bats. Remaining skips are ecosystem-not-present audits (pip/cargo/govulncheck/pnpm).


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

dev-lead:hands-off Opt an item out of the dev-lead persona automation entirely size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[#850 A] Automated standards-deploy driver (scheduled fleet sweep → standards-sync PRs)

3 participants