Skip to content

feat: implement issue #359 — [Fleet Monitor] petry-projects/ContentTwin — .github/workflows/dev-lead.yml - #361

Merged
don-petry merged 2 commits into
mainfrom
dev-lead/issue-359-20260718-0821
Jul 18, 2026
Merged

don-petry merged 2 commits into
mainfrom
dev-lead/issue-359-20260718-0821

Conversation

@don-petry

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

Copy link
Copy Markdown
Contributor

Closes #359

Implemented by dev-lead agent. Please review.

Summary by CodeRabbit

  • Tests
    • Added automated validation for the development lead workflow configuration.
    • Verifies supported event triggers, permissions, reusable workflow version, and agent channel remain compliant.
    • Confirms the workflow is valid YAML and excludes unsupported concurrency settings.

@don-petry
don-petry requested a review from a team as a code owner July 18, 2026 08:25
Copilot AI review requested due to automatic review settings July 18, 2026 08:25
@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 18, 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: 53 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: 77e2a0fb-b8db-45af-a0d7-9b750ecba2b8

📥 Commits

Reviewing files that changed from the base of the PR and between dfba9f5 and ccb9178.

📒 Files selected for processing (1)
  • scripts/tests/dev-lead-workflow.bats
📝 Walkthrough

Walkthrough

Adds a Bats test suite that parses .github/workflows/dev-lead.yml and enforces its trigger, permission, concurrency, reusable-workflow reference, and agent_ref invariants.

Changes

Dev-lead workflow validation

Layer / File(s) Summary
Workflow shape and trigger checks
scripts/tests/dev-lead-workflow.bats
Checks PyYAML availability, workflow existence and YAML validity, plus exact trigger types for all configured event keys.
Workflow policy and pinning checks
scripts/tests/dev-lead-workflow.bats
Checks empty top-level permissions, absent top-level concurrency, least-privilege job permissions, and matching dev-lead/stable workflow and agent references.

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

Possibly related PRs

  • petry-projects/ContentTwin#175: Adds a concurrency policy that conflicts with this suite’s assertion that dev-lead.yml has no top-level concurrency block.

Suggested reviewers: copilot

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR only adds workflow validation tests and does not address the workflow warning or failure-rate issue in #359. Update .github/workflows/dev-lead.yml or related logic to reduce the monitored failure rate below 10% and verify the warning clears.
✅ 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 clearly references the workflow file and issue #359, matching the main change.
Out of Scope Changes check ✅ Passed All changes are focused on the dev-lead workflow and its validation tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev-lead/issue-359-20260718-0821

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 — waiting on PR blockers (intent: review-changes)

PR: #361
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-07-18T08:56:36Z

@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-07-18T08:56:36Z

@don-petry
don-petry enabled auto-merge (squash) July 18, 2026 08:26

@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 suite in scripts/tests/dev-lead-workflow.bats to validate and guard the .github/workflows/dev-lead.yml workflow against configuration drift. The feedback recommends refactoring the inline Python one-liners within the tests to assign expressions to local variables before using them in assertions or string formatting, which prevents redundant calls and simplifies nested quote escaping.

Comment thread scripts/tests/dev-lead-workflow.bats
Comment thread scripts/tests/dev-lead-workflow.bats
Comment thread scripts/tests/dev-lead-workflow.bats
Comment thread scripts/tests/dev-lead-workflow.bats
@don-petry
don-petry disabled auto-merge July 18, 2026 08:27

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

Adds a Bats guard test to prevent “thin caller stub” drift in .github/workflows/dev-lead.yml, addressing issue #359 by locking the invariants that tend to cause startup-failure noise and inflated Fleet Monitor failure/cancellation rates.

Changes:

  • Introduces scripts/tests/dev-lead-workflow.bats to validate the dev-lead workflow YAML parses correctly.
  • Asserts key workflow invariants (event triggers, permissions layout, no repo-level concurrency, and stable channel pinning via uses: + matching agent_ref).

Comment thread scripts/tests/dev-lead-workflow.bats Outdated
Comment thread scripts/tests/dev-lead-workflow.bats Outdated

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

🧹 Nitpick comments (1)
scripts/tests/dev-lead-workflow.bats (1)

36-37: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Echo $output to expose swallowed Python assertion failures.

When using run in Bats, standard output and standard error are captured into the $output variable. Because these tests only assert [ "$status" -eq 0 ], if the Python script fails (e.g., due to an AssertionError indicating drift or a YAML syntax error), the actual error message and traceback are swallowed. They won't be displayed in the CI logs, leaving developers blind to the specific cause of the failure.

Echoing $output immediately before asserting the status ensures the error details are visible. Bats will automatically hide this output when tests pass and display it only when they fail.

  • scripts/tests/dev-lead-workflow.bats#L36-L37: Insert echo "$output" between the run command and the [ "$status" -eq 0 ] assertion to expose tracebacks on failure.
  • scripts/tests/dev-lead-workflow.bats#L43-L57: Insert echo "$output" before the status check to expose AssertionError failures.
  • scripts/tests/dev-lead-workflow.bats#L61-L68: Insert echo "$output" before the status check.
  • scripts/tests/dev-lead-workflow.bats#L78-L85: Insert echo "$output" before the status check.
  • scripts/tests/dev-lead-workflow.bats#L89-L98: Insert echo "$output" before the status check.
  • scripts/tests/dev-lead-workflow.bats#L102-L112: Insert echo "$output" before the status check.
  • scripts/tests/dev-lead-workflow.bats#L116-L128: Insert echo "$output" before the status check.
🤖 Prompt for 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.

In `@scripts/tests/dev-lead-workflow.bats` around lines 36 - 37, Expose captured
command output before each status assertion in
scripts/tests/dev-lead-workflow.bats: add echo "$output" after the run command
and before the assertion at ranges 36-37, 43-57, 61-68, 78-85, 89-98, 102-112,
and 116-128. Apply this consistently to every affected test while preserving the
existing status checks.
🤖 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.

Nitpick comments:
In `@scripts/tests/dev-lead-workflow.bats`:
- Around line 36-37: Expose captured command output before each status assertion
in scripts/tests/dev-lead-workflow.bats: add echo "$output" after the run
command and before the assertion at ranges 36-37, 43-57, 61-68, 78-85, 89-98,
102-112, and 116-128. Apply this consistently to every affected test while
preserving the existing status checks.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5c74824b-7b8a-4852-8479-57868f4066bb

📥 Commits

Reviewing files that changed from the base of the PR and between 1309867 and dfba9f5.

📒 Files selected for processing (1)
  • scripts/tests/dev-lead-workflow.bats

@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) July 18, 2026 08:32
@don-petry
don-petry disabled auto-merge July 18, 2026 08:33
@sonarqubecloud

Copy link
Copy Markdown

@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 18, 2026 08: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: LOW
Reviewed commit: ccb91784686aaae9dec4168446237ee5a22cb732
Review mode: triage-approved (single reviewer)

Summary

Test-only PR adding scripts/tests/dev-lead-workflow.bats: 8 bats drift-guards locking the dev-lead.yml thin-caller stub invariants (triggers, empty top-level permissions, no per-repo concurrency, job least-privilege permissions, dev-lead/stable channel pin, matching agent_ref). Matches the remediation plan on issue #359 and mirrors prior guards (#330, #333). All CI green, all review threads resolved.

Linked issue analysis

Issue #359 is a Fleet Monitor warning (11.5% failure rate on dev-lead.yml). Per the implementation plan posted on the issue, the stub is canonical-correct and not repo-adjustable; the flagged failure class is startup-failure drift. This PR implements exactly the planned remediation — a regression guard preventing drift reintroduction, mirroring the accepted fixes for the same class in add-to-project (#330) and pr-review-mention (#333). Note: the guard prevents drift-caused failures but does not itself lower a failure rate originating elsewhere; the plan documents that any persisting rate issue belongs to dev-lead-reusable.yml in .github-private as follow-up.

Findings

  • No security concerns: test-only addition, no workflow/production changes, no new dependencies, no secrets. Gitleaks CI check passed (secret-scan MCP tool not available in this environment; noted, non-blocking).
  • Test code is sound: handles the YAML 1.1 'on:'-parsed-as-True key, asserts exact trigger/permission/channel invariants, and the CI Test job passing confirms the guards hold against the current workflow.
  • Gemini's refactor suggestions (assign expressions to local variables in the inline Python) were applied in commit ccb9178 — verified in the head diff.
  • Copilot's two resolved nitpicks (also lock the pull_request branch filter; assert secrets: inherit) are reasonable optional hardening for a follow-up, but non-blocking.
  • Triage-approved mode: triage's low-risk assessment is confirmed correct.

CI status

All checks green: CI (Lint, Format, Test, Secret scan/gitleaks), CodeQL, SonarCloud (quality gate passed, 0 new issues, 0 hotspots), AgentShield, CodeRabbit, PR Review Agent, dependency-audit (ecosystem-specific jobs skipped as expected). Mergeable; merge state BLOCKED only 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 3a6b282 into main Jul 18, 2026
22 checks passed
@don-petry
don-petry deleted the dev-lead/issue-359-20260718-0821 branch July 18, 2026 08:39
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.

[Fleet Monitor] petry-projects/ContentTwin — .github/workflows/dev-lead.yml

3 participants