Skip to content

feat: implement issue #201 — [Fleet Monitor] petry-projects/repo-template — .github/workflows/ci.yml - #203

Merged
don-petry merged 2 commits into
mainfrom
dev-lead/issue-201-20260915-2120
Sep 15, 2026
Merged

don-petry merged 2 commits into
mainfrom
dev-lead/issue-201-20260915-2120

Conversation

@don-petry

@don-petry don-petry commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

User description

Closes #201

Implemented by dev-lead agent. Please review.


CodeAnt-AI Description

Cancel outdated CI runs for the same branch

What Changed

  • CI runs for the same branch now share a concurrency group, allowing a new push to cancel the previous in-flight run
  • Added regression tests to ensure the group uses the branch reference, excludes commit-specific identifiers, and keeps cancellation enabled

Impact

✅ Fewer failed superseded CI runs
✅ Faster feedback after repeated pushes
✅ Reduced duplicate CI workload

💡 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

  • Chores

    • Updated CI run grouping so newer pushes to the same branch or reference can cancel outdated in-progress runs.
  • Tests

    • Added regression coverage to verify CI concurrency grouping and cancellation behavior remain correctly configured.

@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

@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 Sep 15, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

Warning

Review limit reached

Next included review available in 53 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

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

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 785a4dad-1b97-48b8-a9e3-f57aafc41dc5

📥 Commits

Reviewing files that changed from the base of the PR and between c9f5a57 and a924f09.

📒 Files selected for processing (1)
  • tests/ci-concurrency-cancellation.bats

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 26b90b10-7f34-4c11-84cd-33919d0b20ff

📥 Commits

Reviewing files that changed from the base of the PR and between 3915b2a and c9f5a57.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • tests/ci-concurrency-cancellation.bats

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The CI workflow now keys concurrency groups by ref instead of ref and commit SHA. New Bats tests verify the concurrency block, ref-based group, absence of SHA keying, and cancellation setting.

Changes

CI concurrency cancellation

Layer / File(s) Summary
Ref-scoped concurrency configuration
.github/workflows/ci.yml
The concurrency group uses github.ref without github.sha. The comment documents the ref-scoped cancellation behavior.
Concurrency regression tests
tests/ci-concurrency-cancellation.bats
Helpers extract the top-level concurrency block. Five tests validate the group and cancel-in-progress: true setting.

Priority: ⬆️ High

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

Change: Bug fix · Severity of issue fixed: High

Merge Risk: ⚪ Minimal · up to c9f5a

New commits on the same ref now cancel stale CI runs, with tests guarding the configuration. No current merge-blocking risk is identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title identifies the affected CI workflow and linked issue. It is related to the changes but does not specify the concurrency cancellation update, so it is broad rather than fully descriptive.
Linked Issues check ✅ Passed Issue #201 identifies .github/workflows/ci.yml concurrency cancellation as the coding target. The workflow now uses group: ci-${{ github.ref }} without github.sha and keeps `cancel-in-progress: …
Out of Scope Changes check ✅ Passed The pull request changes only the workflow concurrency key and its explanatory comment, plus a regression test for issue #201. These changes directly support the monitored workflow failure objective. …
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. (1 skipped: 1 …
✨ 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-201-20260915-2120

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 commented Sep 15, 2026 •

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR c9f5a57 Sep 15, 2026 · 21:28 21:29

@codeant-ai

codeant-ai Bot commented Sep 15, 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

@codeant-ai codeant-ai Bot added the size:M This PR changes 30-99 lines, ignoring generated files label Sep 15, 2026
@don-petry

Copy link
Copy Markdown
Contributor Author

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

PR: #203
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-09-15T21:58:30Z

@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-09-15T21:58:30Z

@don-petry
don-petry enabled auto-merge (squash) September 15, 2026 21:28
@don-petry

Copy link
Copy Markdown
Contributor Author

No description provided.

@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 new BATS test file, tests/ci-concurrency-cancellation.bats, which acts as a compliance regression guard to ensure that the GitHub Actions CI workflow configuration (ci.yml) implements concurrency cancellation correctly (specifically, that it is keyed by github.ref, does not contain github.sha, and has cancel-in-progress enabled). Feedback suggests making the regular expression for checking cancel-in-progress more robust to handle quotes and inline comments.

Comment thread tests/ci-concurrency-cancellation.bats Outdated
Comment thread tests/ci-concurrency-cancellation.bats Outdated
@don-petry
don-petry disabled auto-merge September 15, 2026 21:29
coderabbitai[bot]
coderabbitai Bot previously approved these changes Sep 15, 2026
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — fix-reviews (applied)

Changes committed and pushed.

@donpetry-bot

donpetry-bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor
Superseded by automated re-review at a924f09188e748ea8639b27761f2629451246482 — 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: c9f5a57722f67164a9c8b36443762203fb7f322b
Cascade: triage → deep (triage: haiku 4.5 [sonnet 5] → deep: opus 4.8 [sonnet 5] + duck: o4-mini → audit: fable 5)

Summary

The production fix in ci.yml is correct: dropping github.sha from the concurrency group lets cancel-in-progress actually supersede stale in-flight runs for the same ref (issue #201). However, the new BATS regression guard meant to pin that fix contains a confirmed logic bug — group_value() does not strip inline YAML comments, so the 'keyed by github.ref' assertion matches text in a comment rather than the real group expression, letting a future regression pass. No security surface and no deterministic hard-stops fired, so this stays MEDIUM, but the guard is ineffective as written and should be fixed before merge.

Findings

  • major: group_value() returns the raw text after 'group:', including any inline YAML comment. The 'concurrency group is keyed by github.ref' test does grep -qE 'github\.ref' on that string, so a group like group: ci-static # github.ref is required passes even though the real key is ci-static and never uses github.ref. Reproduced locally with the file's own awk/grep/sed logic: group_value() => 'ci-static # github.ref is required...' and the github.ref assertion PASSED against the comment. The guard is defeated for exactly the future edit it exists to catch. Fix: strip inline comments in group_value (e.g. sed -E 's/[[:space:]]+#.*$//' after extracting, taking care not to clobber a legitimate '#' inside a quoted expression) so assertions run against the actual group value only.
  • minor: The 'cancel-in-progress is enabled' assertion matches only cancel-in-progress: true with no trailing content, so a quoted value ('true'/"true") or an inline comment would produce a false negative (flagged by gemini-code-assist). Once comment-stripping is added to the block/value helpers, relax this regex to tolerate quotes and trailing comments.
  • info: The core change in ci.yml (group: ci-${{ github.ref }}, cancel-in-progress: true) is correct and matches the sibling-workflow convention of keying concurrency by a stable identity. Embedding github.sha previously put every commit in its own group, defeating cancellation. No correctness concern in the production workflow itself. [auditable: repro confirmed]

Reviewed by the PR-review cascade (triage: haiku 4.5 [sonnet 5] → deep: opus 4.8 [sonnet 5] + duck: o4-mini → audit: 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.

@sonarqubecloud

Copy link
Copy Markdown

@don-petry
don-petry disabled auto-merge September 15, 2026 21:34
@don-petry

Copy link
Copy Markdown
Contributor Author

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

Agent reasoning
Issues addressed: 0
- Quality gate: PASSED (0 new issues, 0 security hotspots) — no actionable findings
Files changed: none
Tier 1 blockers noted: 3 cancelled dev-lead checks (appear intentional per [skip ci-relay] tag)
Skipped (informational): 1 (Gemini suggestion to enhance regex — not a blocker)
```
**No changes required.** The PR is ready; the SonarCloud bot found no issues to address.

@don-petry
don-petry enabled auto-merge (squash) September 15, 2026 21:35

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

Summary

The production fix is correct and minimal: ci.yml's concurrency group drops ${{ github.sha }} and keys by ${{ github.ref }} alone with cancel-in-progress: true, so a new push to a ref now supersedes the stale in-flight run instead of letting both complete (root cause of the 58.9% failure rate flagged by Fleet Monitor in issue #201). Both findings from the prior cascade review at c9f5a57 are resolved in the follow-up commit and were re-verified by direct repro: (1) major — group_value() now strips inline YAML comments, so the adversarial case 'group: ci-static # github.ref is required' correctly FAILS the github.ref assertion instead of passing on comment text; (2) minor — the cancel-in-progress assertion now tolerates quoted values and trailing inline comments with no false negative. No new issues introduced; the only commit since the prior review touches the bats guard exclusively.

Linked issue analysis

Issue #201 ([Fleet Monitor] ci.yml, CRITICAL, 58.9% failure / 33 of 56 runs, p50 28s fast-failure signature) is substantively addressed. Embedding github.sha in the concurrency group put every commit in its own group, so cancel-in-progress could never match an in-flight run for the same ref; burst pushes on automation branches then ran superseded commits to completion as failures. Keying by github.ref matches every sibling workflow's stable-identity convention, and the new bats regression guard pins the fix (group exists, keyed by github.ref, no github.sha, cancel-in-progress true) with comment-stripping so a commented-out or comment-decorated key can never satisfy an assertion.

Findings

  • Prior major finding (inline-comment bypass in group_value) — RESOLVED: verified by running the guard's own awk/grep/sed logic; real ci.yml yields group_value 'ci-${{ github.ref }}' (passes), adversarial 'ci-static # github.ref is required' yields 'ci-static' (correctly fails).
  • Prior minor finding (over-strict cancel-in-progress regex) — RESOLVED: quoted value with trailing comment ('"true" # keep') now passes; no false negative.
  • Both inline review threads (gemini-code-assist, codeant-ai) are resolved and outdated.
  • Secret scan: the run_secret_scanning MCP tool is not available in this environment; the gitleaks CI check is green and the diff contains no credential-like content.
  • No security surface touched: permissions: {} unchanged, no new actions or third-party workflows, no secrets handling.

CI status

All required checks green: SonarCloud ✓, CodeQL ✓, agent-shield / AgentShield ✓, dependency-audit / Detect ecosystems ✓. Also green: build-and-test, coverage, Analyze (actions), Secret scan (gitleaks), SonarCloud Code Analysis, pr-auto-review dispatch, CodeRabbit. The three CANCELLED entries (dev-lead / dispatch, ci-relay, resume) are non-required agent-orchestration jobs — the fix commit intentionally carried [skip ci-relay]. mergeStateStatus BLOCKED reflects only the pending required review.


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 401e957 into main Sep 15, 2026
23 of 26 checks passed
@don-petry
don-petry deleted the dev-lead/issue-201-20260915-2120 branch September 15, 2026 21:37

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

Summary

Confirmation review (triage-approved) of the fix for Fleet Monitor issue #201. The PR removes ${{ github.sha }} from ci.yml's concurrency group (now keyed by github.ref only) so cancel-in-progress can actually supersede stale in-flight runs, and adds tests/ci-concurrency-cancellation.bats as a regression guard. The root-cause analysis is sound: embedding the sha placed every commit in its own concurrency group, defeating cancellation and inflating the failure rate (58.9%) during push bursts. The new group key matches the stable-identity pattern used by every sibling workflow in the repo. The bats guard is well-constructed — it scopes assertions to the top-level concurrency block, strips comment lines and inline comments so comment text cannot satisfy a guard, asserts github.ref is present, github.sha is absent, and cancel-in-progress is true (tolerating quoting and trailing comments). No permissions, secrets, or action-pinning changes; no security smells.

Linked issue analysis

Linked issue #201 ([Fleet Monitor] ci.yml, 58.9% failure rate, CRITICAL) is substantively addressed. The failure signature (fast failures during push bursts, superseded runs never cancelled) is traced to the sha-embedded concurrency group; keying by ref restores cancel-in-progress semantics. A regression test pins the fix so the sha cannot be reintroduced silently.

Findings

No blocking findings.

  • Prior-cycle review feedback is resolved: both review threads (gemini: quoted-true tolerance; codeant-ai: inline-comment stripping in group_value) are marked resolved and the corresponding fixes are present in the final test file.
  • Secret scan: the run_secret_scanning MCP tool is not available in this run; the gitleaks CI check passed (SUCCESS) and the diff introduces no credentials or secret-adjacent content.
  • Minor note (non-blocking): on pull_request events github.ref resolves to refs/pull/N/merge, which is the standard, correct grouping for per-PR cancellation.

CI status

All substantive checks green at a924f09188e748ea8639b27761f2629451246482: build-and-test, coverage, CodeQL, Analyze (actions), SonarCloud (quality gate passed), Secret scan (gitleaks), agent-shield, dependency-audit — all SUCCESS. The few CANCELLED entries (dev-lead dispatch/ci-relay/resume) are superseded orchestration runs with later SUCCESS duplicates, not CI failures.


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

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

Summary

Confirmation review (triage-approved). The PR rekeys ci.yml's concurrency group from ref+sha to ref only, so cancel-in-progress can supersede stale in-flight runs — the exact root cause of the ~59% failure rate in issue #201 (every commit previously landed in its own group, so burst pushes ran superseded runs to failure). A bats regression guard pins the fix: group keyed by github.ref, no github.sha in the group, cancel-in-progress true. The guard is robust — assertions are scoped to the top-level concurrency block, comment lines and inline comments are stripped so comment text cannot satisfy a check, and quoted true is accepted. Both prior bot review threads (quoted-true false negative; inline-comment bypass) are resolved with fixes present in the current diff. Triage assessment confirmed.

Linked issue analysis

Linked issue #201 ([Fleet Monitor] ci.yml CRITICAL, 58.9% failure rate) is substantively addressed: the concurrency key embedding github.sha defeated cancel-in-progress; keying by github.ref alone restores supersession, and the new tests/ci-concurrency-cancellation.bats prevents regression. The issue is already closed; the PR body's Closes #201 is a no-op against a closed issue.

Findings

No blocking findings. Secret-scan MCP tool unavailable in this run (noted, not blocking); gitleaks CI check passed and the diff contains no secret-like content. The change touches only the concurrency block of ci.yml plus a new test file — no permissions, secrets, or third-party action changes. Minor non-blocking observation: pushes to main now also cancel in-flight main runs, which is the org-standard pattern used by sibling workflows.

CI status

All validation checks green: build-and-test, CodeQL, Analyze (actions), SonarCloud quality gate, Secret scan (gitleaks), coverage, AgentShield, CodeRabbit, pr-auto-review. CANCELLED entries are superseded dev-lead orchestration runs with later SUCCESS runs of the same jobs.


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:M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fleet Monitor] petry-projects/repo-template — .github/workflows/ci.yml

2 participants