Skip to content

[fix] issue #694: CI failure bot stays silent when no actual failures found#697

Open
BHARATH0153 wants to merge 6 commits into
openwisp:masterfrom
BHARATH0153:fix/ci-bot-silent-no-failures
Open

[fix] issue #694: CI failure bot stays silent when no actual failures found#697
BHARATH0153 wants to merge 6 commits into
openwisp:masterfrom
BHARATH0153:fix/ci-bot-silent-no-failures

Conversation

@BHARATH0153

@BHARATH0153 BHARATH0153 commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Checklist

  • I have read the OpenWISP Contributing Guidelines.
  • I have manually tested the changes proposed in this pull request.
  • I have written new test cases for new code and/or updated existing tests for changes to existing code.
  • I have updated the documentation.

Closes #694

changes

Used solution 1 from the issue description — the bot now stays silent when there are no actual failures to report.

Two changes:

  1. analyze_failure.py — skips analysis when the logs have no ##[error] markers or only contain boilerplate like "No failed jobs found"
  2. reusable-bot-ci-failure.yml — the Post Comment step checks for ##[error] in the logs before posting. If nothing found, no comment.

@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR prevents the CI failure bot from posting "No Failures Found" comments by adding early-exit guards in the Python analysis script (skip when processed error_log is empty or when re-read failed_logs.txt matches "no failures / logs unavailable / could not fetch" patterns) and by gating the workflow's "Post Comment" step to only run when failed_logs.txt contains the ##[error] marker.

Sequence Diagram(s)

sequenceDiagram
  participant Workflow
  participant analyze_failure_py as analyze_failure.py
  participant failed_logs as failed_logs.txt
  participant LLM
  Workflow->>analyze_failure_py: invoke analysis (with failed_logs.txt, error_log)
  analyze_failure_py->>failed_logs: read and process error_log
  analyze_failure_py-->>analyze_failure_py: early return if error_log empty/whitespace
  alt tests_failed == false and transient_only == false
    analyze_failure_py->>failed_logs: re-open and scan failed_logs.txt for "no failures/logs unavailable/could not fetch"
    failed_logs-->>analyze_failure_py: pattern matched?
    analyze_failure_py-->>Workflow: print notice and return (skip LLM) if matched
  else
    analyze_failure_py->>LLM: invoke LLM analysis
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • nemesifier

Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Bug Fixes ❌ Error Fix adds logic to skip analysis for "No failed jobs found" patterns, but no regression tests were added. Diff shows only code changes, zero test changes. Add tests mocking get_error_logs() returning the three no-failure patterns with tests_failed=False, verifying main() exits early without posting comments.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title follows the required [fix] format, clearly references issue #694, and accurately summarizes the main change: preventing the CI failure bot from posting comments when no actual failures are found.
Description check ✅ Passed The description covers all required template sections: checklist completed, reference to issue #694, and clear explanation of the two changes made to implement solution 1 from the linked issue.
Linked Issues check ✅ Passed The PR successfully implements solution 1 from issue #694 [#694]: both analyze_failure.py and reusable-bot-ci-failure.yml changes prevent posting comments when no failures are detected, meeting the primary objective.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the requirements of issue #694 [#694]; modifications to analyze_failure.py and reusable-bot-ci-failure.yml target the no-failure code path logic without introducing unrelated changes.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@coderabbitai coderabbitai Bot added bug github_actions Pull requests that update GitHub Actions code helper-bots Helper bots, release management automation labels Jun 6, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 6, 2026
…s detected

Two-layer guard: skip analysis in analyze_failure.py when logs
contain no error markers, and skip the Post Comment step in
reusable-bot-ci-failure.yml when no errors are found.

Closes openwisp#694
@BHARATH0153 BHARATH0153 force-pushed the fix/ci-bot-silent-no-failures branch from ac968a1 to 20ed4ce Compare June 6, 2026 02:49
@BHARATH0153

Copy link
Copy Markdown
Contributor Author

@nemesifier please review whenever possible thanks!

This reverts commit 4c80968.
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 6, 2026
@BHARATH0153 BHARATH0153 force-pushed the fix/ci-bot-silent-no-failures branch from fee1dac to beea942 Compare June 6, 2026 17:33
@BHARATH0153 BHARATH0153 closed this Jun 6, 2026
@BHARATH0153 BHARATH0153 reopened this Jun 6, 2026
@BHARATH0153 BHARATH0153 closed this Jun 6, 2026
@openwisp-companion

Copy link
Copy Markdown

The CI is failing due to transient infrastructure issues (not related to your code). I have restarted the failed jobs automatically (1/3).

@BHARATH0153 BHARATH0153 reopened this Jun 6, 2026
@openwisp-companion

Copy link
Copy Markdown

The CI is failing due to transient infrastructure issues (not related to your code). I have restarted the failed jobs automatically (2/3).

Comment thread .github/actions/bot-ci-failure/analyze_failure.py Outdated
@coveralls

coveralls commented Jun 8, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 97.629%. remained the same — BHARATH0153:fix/ci-bot-silent-no-failures into openwisp:master

Comment thread .github/actions/bot-ci-failure/analyze_failure.py Outdated
@BHARATH0153 BHARATH0153 force-pushed the fix/ci-bot-silent-no-failures branch from 44734ac to f607473 Compare June 9, 2026 05:44
@BHARATH0153 BHARATH0153 requested a review from nemesifier June 9, 2026 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug github_actions Pull requests that update GitHub Actions code helper-bots Helper bots, release management automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] CI failure bot posts "No Failures Found" instead of staying silent

3 participants