Skip to content

feat: implement issue #941 — [Fleet Monitor] petry-projects/.github-private — .github/workflows/test-deletion-guard.yml - #942

Merged
don-petry merged 2 commits into
mainfrom
dev-lead/issue-941-20260626-0949
Jun 26, 2026
Merged

feat: implement issue #941 — [Fleet Monitor] petry-projects/.github-private — .github/workflows/test-deletion-guard.yml#942
don-petry merged 2 commits into
mainfrom
dev-lead/issue-941-20260626-0949

Conversation

@don-petry

@don-petry don-petry commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Closes #941

Implemented by dev-lead agent. Please review.

Summary by CodeRabbit

  • New Features

    • Added clearer handling for high-failure workflow reporting, including support for excluding intentional gate-style checks from failure summaries.
  • Bug Fixes

    • Improved failure tracking so only meaningful non-gate issues are surfaced in high-failure reports.
    • Ensured gate checks with true errors still appear, while low-confidence results are suppressed.

…rivate — .github/workflows/test-deletion-guard.yml
@don-petry
don-petry requested a review from a team as a code owner June 26, 2026 09:56
@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.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

More reviews will be available in 48 minutes and 58 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

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

🚦 How do rate 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 see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 50b2c295-f451-4024-ae8a-05a558fc2893

📥 Commits

Reviewing files that changed from the base of the PR and between 939dc1b and a52f0ca.

📒 Files selected for processing (2)
  • scripts/fleet_report.sh
  • tests/fleet_report.bats
📝 Walkthrough

Walkthrough

Fleet Monitor high-failure reporting now uses a shared helper that excludes configured gate workflows from rate-based tracking, keeps gate ERROR rows, downgrades low-count critical rows, and writes fleet_high_failure.json through that helper. Tests cover the new filtering rules and gate-workflow matching.

Changes

Fleet Monitor gate-workflow exclusion

Layer / File(s) Summary
Gate exclusion rules and tracking config
scripts/fleet_report.sh, AGENTS.md
FLEET_GATE_WORKFLOWS defaults to test-deletion-guard.yml holdout-guard.yml, and filter_high_failure applies the confidence downgrade, ERROR passthrough, gate exclusion, and failure-rate sorting. AGENTS.md records the gate-workflow exemption list.
High-failure export wiring
scripts/fleet_monitor.sh
fleet_monitor.sh now writes fleet_high_failure.json from filter_high_failure "$metrics_file" and notes that gate workflows are excluded from that export.
Filter test coverage
tests/fleet_report.bats
_mk_metrics creates TSV fixtures for the new filter_high_failure suite, which covers gate exclusion, basename matching, ERROR retention, low-confidence critical rows, and mixed tracked/untracked inputs.

Sequence Diagram(s)

sequenceDiagram
  participant fleet_monitor_sh as "scripts/fleet_monitor.sh"
  participant filter_high_failure as "filter_high_failure"
  participant jq as "jq"
  fleet_monitor_sh->>filter_high_failure: filter_high_failure "$metrics_file"
  filter_high_failure->>jq: parse TSV and build tracked JSON
  jq-->>filter_high_failure: filtered rows
  filter_high_failure-->>fleet_monitor_sh: JSON output
  fleet_monitor_sh->>fleet_monitor_sh: write fleet_high_failure.json
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

needs-human-review

🚥 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 is specific and matches the main change: Fleet Monitor handling for issue #941 on test-deletion-guard.yml.
Linked Issues check ✅ Passed The PR addresses the warning by excluding intentional gate workflows, including test-deletion-guard.yml, from high-failure tracking.
Out of Scope Changes check ✅ Passed The changes stay within Fleet Monitor filtering logic, related docs, and tests, without unrelated feature work.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev-lead/issue-941-20260626-0949

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
Collaborator Author

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

PR: #942
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-06-26T10:27:05Z

@don-petry

Copy link
Copy Markdown
Collaborator 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-06-26T10:27:05Z

@don-petry
don-petry enabled auto-merge (squash) June 26, 2026 09:57

@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 refactors the high-failure workflow filtering logic by extracting it into a reusable filter_high_failure function in scripts/fleet_report.sh and introducing FLEET_GATE_WORKFLOWS to exclude gate workflows from high-failure tracking. It also adds corresponding documentation in AGENTS.md and comprehensive unit tests in tests/fleet_report.bats. The review feedback suggests validating the positional parameter in filter_high_failure to prevent potential crashes under strict shell options, and adding error handling and cleanup for temporary files created with mktemp in the test helper.

Comment thread scripts/fleet_report.sh Outdated
Comment thread tests/fleet_report.bats
@don-petry
don-petry disabled auto-merge June 26, 2026 09:57
@don-petry

Copy link
Copy Markdown
Collaborator Author

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

Agent reasoning
Issues addressed: 0
No actionable issues found — Quality Gate passed with 0 new issues and 0 security hotspots.
Files changed: (none)
Tier 1 blockers: 0
```
The PR is in good standing. All quality checks pass, and no code fixes are required.

@don-petry
don-petry enabled auto-merge (squash) June 26, 2026 09:58

@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 `@scripts/fleet_report.sh`:
- Around line 14-15: Clarify the behavior of FLEET_GATE_WORKFLOWS in
fleet_report.sh: the current default-expansion makes the env var a full-list
override, so setting it replaces the built-in test-deletion-guard.yml and
holdout-guard.yml entries. Update the nearby comment and/or variable handling in
fleet_report.sh so it explicitly documents that permanent gates must be added to
the default list, or introduce a separate additive env var instead of relying on
FLEET_GATE_WORKFLOWS alone.

In `@tests/fleet_report.bats`:
- Around line 311-312: Update the Bats cases around filter_high_failure so they
assert the helper succeeds before inspecting $output; each run of
filter_high_failure should be followed by a check that $status is 0, then the
existing jq length assertion. Apply this to every affected case in
tests/fleet_report.bats so the tests fail if filter_high_failure returns a
non-zero exit even when it emits JSON-like output.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b31b3123-39bb-4e61-8a1a-855e8a6c261c

📥 Commits

Reviewing files that changed from the base of the PR and between b6de921 and 939dc1b.

📒 Files selected for processing (4)
  • AGENTS.md
  • scripts/fleet_monitor.sh
  • scripts/fleet_report.sh
  • tests/fleet_report.bats

Comment thread scripts/fleet_report.sh Outdated
Comment thread tests/fleet_report.bats
@don-petry
don-petry disabled auto-merge June 26, 2026 10:01
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 26, 2026
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-reviews (applied)

Changes committed and pushed.

@sonarqubecloud

Copy link
Copy Markdown

@don-petry

Copy link
Copy Markdown
Collaborator Author

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

No changes were needed for this PR.

@don-petry
don-petry enabled auto-merge (squash) June 26, 2026 10:09

@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: a52f0ca2d2e090538450605b9b5d464a43ebc78b
Cascade: triage → deep (triage: haiku 4.5 → deep: opus 4.8 + duck: o4-mini → audit: fable 5)

Summary

PR #941 extracts the inline high-failure jq filter from fleet_monitor.sh into a tested filter_high_failure() in fleet_report.sh (sourced at fleet_monitor.sh:24) and adds a documented gate-workflow exclusion (FLEET_GATE_WORKFLOWS, default test-deletion-guard.yml + holdout-guard.yml) so intentional guard failures stop creating false-positive Fleet Monitor trackers; ERROR rows for gates still surface. No security surface (CI/monitoring shell only; jq uses --arg so no injection; no auth/secrets/DB). All CI checks green and downstream impact is (none). The triage signals (gemini mktemp error-handling + BATS cleanup robustness) and all four advisory comments are already fixed in the current head: f="${1:-}" with a guard returning 1, mktemp || exit in _mk_metrics, full-list-override comment clarified, and [ status -eq 0 ] added to every new test; CodeRabbit marked its threads addressed and dismissed its changes-requested.

Findings

  • MINOR: Test helper temp files leak on assertion failure: _mk_metrics creates a mktemp file but rm -f "$m" runs only after assertions, so a failing @test aborts before cleanup, leaving a file in /tmp. Test-only, error-path-only, negligible in CI; a BATS teardown() or trap-based cleanup would close it. Not blocking. (tests/fleet_report.bats:289)
  • INFO: run_secret_scanning MCP tool not available in this environment; relied on the green gitleaks CI check. No credential-like content in the diff (shell filter logic + tests + docs).

Reviewed by the PR-review cascade (triage: haiku 4.5 → deep: opus 4.8 + duck: o4-mini → audit: fable 5). Reply if you need a human review.

@don-petry
don-petry merged commit 96919a1 into main Jun 26, 2026
29 of 30 checks passed
@don-petry
don-petry deleted the dev-lead/issue-941-20260626-0949 branch June 26, 2026 11: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/.github-private — .github/workflows/test-deletion-guard.yml

2 participants