Skip to content

feat: implement issue #472 — [Fleet Monitor] petry-projects/broodly — .github/workflows/dependabot-automerge.yml - #473

Merged
don-petry merged 2 commits into
mainfrom
dev-lead/issue-472-20260806-0925
Aug 6, 2026
Merged

don-petry merged 2 commits into
mainfrom
dev-lead/issue-472-20260806-0925

Conversation

@don-petry

@don-petry don-petry commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

User description

Closes #472

Implemented by dev-lead agent. Please review.


CodeAnt-AI Description

Protect Dependabot auto-merge from workflow contract drift

What Changed

  • Added checks that the Dependabot auto-merge workflow uses the required pull_request_target trigger, shared reusable workflow, inherited secrets, and job permissions.
  • Added negative checks that detect removed settings, incorrect triggers, and workflows truncated to comments.
  • Runs the Dependabot contract test as part of CI.
  • Removed an unused workflow job pattern from the workflow validator.

Impact

✅ Fewer silent Dependabot auto-merge failures
✅ Earlier detection of corrupted workflow files
✅ Safer CI validation for automation permissions

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

Summary by CodeRabbit

  • Tests

    • Added automated validation for the Dependabot auto-merge workflow, covering triggers, workflow references, secrets, permissions, and malformed configurations.
    • Integrated the contract test into continuous integration.
  • Chores

    • Simplified workflow validation by removing an unused pattern.

… .github/workflows/dependabot-automerge.yml
@don-petry
don-petry requested a review from a team as a code owner August 6, 2026 09:35
@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.

@codeant-ai

codeant-ai Bot commented Aug 6, 2026 •

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR 1cfeb99 Aug 06, 2026 · 09:35 09:37

@codeant-ai

codeant-ai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing

@coderabbitai

coderabbitai Bot commented Aug 6, 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

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

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: 5fcf1fad-7c9d-4d5b-9ec2-52092ec0740e

📥 Commits

Reviewing files that changed from the base of the PR and between 1cfeb99 and 78f1397.

📒 Files selected for processing (1)
  • tests/scripts/dependabot-automerge-contract.test.sh
📝 Walkthrough

Walkthrough

The PR adds a Bash contract test for the Dependabot auto-merge workflow, runs it in the shell-tests CI job, and removes an unused workflow-validation regular expression.

Changes

Dependabot contract validation

Layer / File(s) Summary
Dependabot workflow contract test
tests/scripts/dependabot-automerge-contract.test.sh
The test validates the real workflow and negative fixtures for triggers, reusable workflow references, inherited secrets, job permissions, and comment-only truncation.
CI test wiring and validator cleanup
.github/workflows/ci.yml, scripts/validate-workflows.sh
The shell-tests job runs the contract test. The workflow validation script removes the unused JOB_DEF_RE variable.

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

Possibly related PRs

Suggested reviewers: donpetry-bot

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Linked Issues check ❓ Inconclusive The contract test validates the workflow, but the context does not show that the monitored workflow failures were fixed. Provide the failure cause and evidence that the workflow change resolves the warning, or link the test-only changes to a confirmed fix.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title identifies issue #472 and the monitored Dependabot workflow, so it clearly relates to the pull request changes.
Out of Scope Changes check ✅ Passed The CI change, contract test, and removal of an unused validation pattern are related to Dependabot workflow validation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 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-472-20260806-0925

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.

@codeant-ai codeant-ai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Aug 6, 2026
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — waiting on PR blockers (intent: review-changes)

PR: #473
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-06T10:06:12Z

@don-petry

Copy link
Copy Markdown
Contributor Author

Note

@don-petry I reviewed this PR and no code changes were needed, but it still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews), so I cannot mark it done yet. I'll re-check automatically.
Next attempt after: 2026-08-06T10:06:12Z

@don-petry
don-petry enabled auto-merge (squash) August 6, 2026 09:36

@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 removes an unused regular expression variable from scripts/validate-workflows.sh and introduces a new Bash test script tests/scripts/dependabot-automerge-contract.test.sh to enforce contract invariants for the dependabot-automerge workflow. The review feedback suggests two improvements to the new test script: safely capturing command substitution exit codes under set -e to prevent premature script termination, and using single quotes instead of double quotes for grep regular expressions to avoid unexpected shell expansion.

@don-petry
don-petry disabled auto-merge August 6, 2026 09:37

@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 `@tests/scripts/dependabot-automerge-contract.test.sh`:
- Around line 42-44: Add a negative fixture in the contract test setup that
removes only the required reusable-workflow uses entry while leaving the rest of
the workflow valid. Invoke check_contract against this fixture and assert it
fails, covering the validation around the existing reusable-reference grep and
ensuring the positive fixture remains unchanged.
- Around line 38-54: Rewrite the contract checks around the workflow’s parsed
structure rather than independent grep matches: validate that top-level on
contains only the required pull_request_target trigger and rejects push or
pull_request, then inspect jobs.dependabot-automerge specifically for the
reusable workflow reference, secrets: inherit, and job-level permissions
granting contents: read and pull-requests: read. Add invalid fixtures covering
prohibited top-level triggers and matching fields placed on unrelated jobs.
🪄 Autofix

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: d600680a-012c-4d34-a995-2bb732aaee9c

📥 Commits

Reviewing files that changed from the base of the PR and between 75f6a84 and 1cfeb99.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml
  • scripts/validate-workflows.sh
  • tests/scripts/dependabot-automerge-contract.test.sh
💤 Files with no reviewable changes (1)
  • scripts/validate-workflows.sh

@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 6, 2026 09:47
@sonarqubecloud

sonarqubecloud Bot commented Aug 6, 2026

Copy link
Copy Markdown

@don-petry
don-petry disabled auto-merge August 6, 2026 09:49
@donpetry-bot

Copy link
Copy Markdown
Contributor

Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-08-06T10:49:51Z.

@don-petry

Copy link
Copy Markdown
Contributor Author

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

Agent reasoning
Issues addressed: 0
- Quality Gate passed (informational status only)
Files changed: none
Skipped (informational): Quality Gate status report
```
The PR is ready — no bot-driven fixes required. ✅

@don-petry
don-petry enabled auto-merge (squash) August 6, 2026 09:50

@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: LOW
Reviewed commit: 78f1397c2c463042a0bc62bb293807b7ef9aecb7
Review mode: triage-approved (single reviewer)

Summary

Adds a contract test locking the dependabot-automerge.yml stub invariants (pull_request_target trigger, org reusable uses:, secrets: inherit, job-level permissions), wires it into CI, and removes an unused regex from validate-workflows.sh. Directly addresses Fleet Monitor issue #472 (failures caused by the stub being truncated to its comment header). Test-only substance with a one-line CI hook; all validation checks green and all review threads resolved.

Linked issue analysis

Closes #472 ([Fleet Monitor] 12.5% failure rate on .github/workflows/dependabot-automerge.yml, caused by the stub being truncated to its comment header on a sibling branch). The PR is a substantive fix: the new contract test rejects exactly that corruption (comment-only fixture) plus four other contract-drift mutations (wrong trigger, missing secrets: inherit, missing job-level permissions:, missing reusable uses:) that the existing structural guards (validate-workflows.sh, workflow-integrity.test.sh) cannot catch. YAML is parsed structurally (PyYAML) rather than grepped, avoiding false positives — which also resolves the main advisory-bot suggestions from the earlier review round.

Findings

No blocking findings.

  • tests/scripts/dependabot-automerge-contract.test.sh (new): well-structured — positive assertion on the real stub plus 5 negative mutation fixtures in a temp dir with EXIT-trap cleanup; set -euo pipefail; structural YAML validation including the YAML-1.1 on→True key quirk. Prior bot feedback (structural parsing, missing uses: negative fixture) was incorporated in the head commit; all 6 review threads are resolved.
  • .github/workflows/ci.yml: one benign step added to the existing workflow-validation job invoking the new test. No new triggers, permissions, or secret usage.
  • scripts/validate-workflows.sh: removes JOB_DEF_RE, verified unreferenced anywhere in the script at the head commit — safe dead-code removal.
  • Secret scan: run_secret_scanning MCP tool not available in this environment; noted per policy. The gitleaks CI check is green and the diff introduces no secret material.

CI status

All code-validation checks green at head SHA 78f1397: TypeScript, Go, Shell Tests (exercises the new contract test), CodeQL (actions/go/js-ts), SonarCloud quality gate, gitleaks secret scan, dependency-audit, agent-shield, workflow review. The only non-green runs are two cancelled dev-lead / dispatch and dev-lead / ci-relay jobs — superseded agent-orchestration relays, not validation checks. The earlier advisory-bot rate-limit hold (reset 2026-08-06T10:49:51Z) has expired; gemini-code-assist, codeant-ai, and coderabbitai all completed reviews with resolved threads.


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

@don-petry
don-petry merged commit a514635 into main Aug 6, 2026
24 of 26 checks passed
@don-petry
don-petry deleted the dev-lead/issue-472-20260806-0925 branch August 6, 2026 11:39
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.

[Fleet Monitor] petry-projects/broodly — .github/workflows/dependabot-automerge.yml

2 participants