Skip to content

Noop on no failure in detective workflows#606

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/fix-noop-on-no-failure
Closed

Noop on no failure in detective workflows#606
Copilot wants to merge 2 commits intomainfrom
copilot/fix-noop-on-no-failure

Conversation

Copy link
Contributor

Copilot AI commented Mar 8, 2026

The PR Actions Detective can post a comment even when a workflow run has no failed jobs (example). Although the trigger workflow filters on conclusion == 'failure', the detective prompts did not explicitly require a no-op when all listed jobs are non-failing.

What changed

  • Agent prompts (.github/workflows/gh-aw-pr-actions-detective.md, .github/workflows/gh-aw-branch-actions-detective.md): after listing job conclusions in Step 1, explicitly call noop when no jobs have a failure conclusion.
  • Workflow lock files (.github/workflows/gh-aw-*-detective.lock.yml): regenerated metadata to reflect the prompt updates.
  • Workflow READMEs (gh-agent-workflows/pr-actions-detective/README.md, gh-agent-workflows/branch-actions-detective/README.md): document noop as a supported safe output for the no-failure case.

Fixes #605


The body of this PR is automatically managed by the Trigger Update PR Body workflow.

When the PR Actions Detective or Branch Actions Detective runs against a
workflow run that has no failed jobs, the agent now calls noop instead of
posting a comment or creating an issue. This prevents noisy output on
successful runs.

Fixes: Noop on no failure

Co-authored-by: strawgate <6384545+strawgate@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix noop behavior when no failure occurs Noop on no failure in detective workflows Mar 8, 2026
@strawgate strawgate marked this pull request as ready for review March 8, 2026 22:46
@coderabbitai
Copy link

coderabbitai bot commented Mar 8, 2026

📝 Walkthrough

Walkthrough

This PR modifies multiple GitHub Actions Detective workflow files to add an early-exit condition. When enumerating jobs from a workflow run, if no job has a failure conclusion, the workflows now invoke a noop operation with the message "No failed jobs in workflow run; nothing to report" and halt further processing. This prevents unnecessary log downloads and analysis steps. The corresponding documentation files have been updated to reflect this new noop output behavior across the branch, PR, and CI detective workflows.

Possibly related PRs

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed PR fully addresses issue #605: explicit noop directives added to agent prompts when no jobs have failure conclusions, preventing unwanted comments on successful runs.
Out of Scope Changes check ✅ Passed All changes are scoped to the stated objectives: agent prompt updates, README documentation, and lock file regeneration via make compile.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch copilot/fix-noop-on-no-failure
  • 🛠️ Update Documentation: Commit on current branch
  • 🛠️ Update Documentation: Create PR

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/gh-aw-pr-actions-detective.md (1)

97-103: ⚠️ Potential issue | 🟠 Major

Add --paginate to fetch all jobs before checking for failures.

The gh api call on line 100 only retrieves the first page of results (default 30 jobs). Without the --paginate flag, failing jobs on subsequent pages will be missed, causing the noop guard to incorrectly report success on genuinely failing runs. Add --paginate to ensure all jobs are fetched before deciding whether to proceed.

Suggested fix
-   ```bash
-     gh api repos/${{ github.repository }}/actions/runs/{run_id}/jobs \
-       --jq '.jobs[] | {id: .id, name: .name, conclusion: .conclusion, html_url: .html_url}'
-    ```
+   ```bash
+     gh api --paginate repos/${{ github.repository }}/actions/runs/{run_id}/jobs \
+       --jq '.jobs[] | {id: .id, name: .name, conclusion: .conclusion, html_url: .html_url}'
+    ```
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/gh-aw-pr-actions-detective.md around lines 97 - 103, The
gh api call that lists jobs (the command invoking gh api with the jq filter
'.jobs[] | {id: .id, name: .name, conclusion: .conclusion, html_url:
.html_url}') only fetches the first page; add the --paginate flag to that gh api
invocation so all jobs are returned before evaluating conclusions, and keep the
noop guard that emits "No failed jobs in workflow run; nothing to report" but
run it against the full paginated result set.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In @.github/workflows/gh-aw-pr-actions-detective.md:
- Around line 97-103: The gh api call that lists jobs (the command invoking gh
api with the jq filter '.jobs[] | {id: .id, name: .name, conclusion:
.conclusion, html_url: .html_url}') only fetches the first page; add the
--paginate flag to that gh api invocation so all jobs are returned before
evaluating conclusions, and keep the noop guard that emits "No failed jobs in
workflow run; nothing to report" but run it against the full paginated result
set.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9e89b929-a963-4ed2-94c6-f3d7efbba3cb

📥 Commits

Reviewing files that changed from the base of the PR and between cc886c4 and 0239153.

📒 Files selected for processing (7)
  • .github/workflows/gh-aw-branch-actions-detective.lock.yml
  • .github/workflows/gh-aw-branch-actions-detective.md
  • .github/workflows/gh-aw-pr-actions-detective.lock.yml
  • .github/workflows/gh-aw-pr-actions-detective.md
  • .github/workflows/gh-aw-pr-ci-detective.lock.yml
  • gh-agent-workflows/branch-actions-detective/README.md
  • gh-agent-workflows/pr-actions-detective/README.md

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m requesting changes because the new early-exit rule can suppress legitimate failure triage.

  • In .github/workflows/gh-aw-pr-actions-detective.md:103 and .github/workflows/gh-aw-branch-actions-detective.md:112, the new guard noops when no job has conclusion failure, but failed runs can still occur via non-failure terminal conclusions (for example timeout/cancel-style outcomes), which would now be silently skipped.
  • The same new noop decision is made immediately after a single gh api .../actions/runs/{run_id}/jobs call; without explicit pagination, large runs can miss later failed jobs and incorrectly noop.

Please broaden the failure-condition check and ensure the jobs set is fully enumerated before deciding to noop.


What is this? | From workflow: Trigger PR Review

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

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.

Noop on no failure

2 participants