Skip to content

ci(brain): skip the health report when the run itself was cancelled - #882

Open
gHashTag wants to merge 1 commit into
mainfrom
ci/report-not-on-cancel
Open

gHashTag wants to merge 1 commit into
mainfrom
ci/report-not-on-cancel

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

Closes #881. Part of #851.

What was wrong

brain-health-report in brain-ci.yml ran on if: always(). It reported DAMAGE and ran exit 1 unless all six needs were success, and on a pull request it then posted "🚨 CRITICAL: Brain Health Below Threshold … This PR cannot be merged".

A cancelled need is not success, so when a newer push cancelled a run, the report treated the cancel as brain damage. On #870:

  • run 37228527559 was cancelled while its stress test was running (20:58:18Z);
  • the report ran at 21:10:15Z, failed, and posted this comment;
  • the replacing run 37234155119 was green in every job.

main's brain-ci.yml has no concurrency: block, so today this happens only on a manual cancel. #870 adds cancel-in-progress for pull requests, which would make it happen on every push during a run.

The change

One line: if: always() → if: ${{ !cancelled() }}, with a comment. cancelled() is true only when the workflow run was cancelled, so the report still runs after a need fails, and still goes red and posts.

Scope

Of the 10 jobs on main with a job-level always(), this is the only one that requires success from its needs. fpga-ci.yml and fpga-regression.yml have summary jobs that exit 1 only on == 'failure', which a cancelled need does not match. No step-level always() step posts a comment. Scan: a text scan of .github/workflows at 57de4a1.

Checked locally

Shown by CI, 2026-10-04

Four brain-ci runs. The two cancelled ones were cancelled at the same point, while the stress test was running, which is where #870's run was cancelled.

run ref what happened 📋 Brain Health Report
37239407266 main (always()) cancelled during the stress test ran and failed: [ "cancelled" == "success" ] → DAMAGE → exit 1. This is the defect, reproduced.
37239404431 this branch cancelled during the stress test never started: 0 steps, no runner. GitHub lists it as cancelled (not skipped, as I first predicted).
37239392265 this PR not cancelled, all needs green ran, success
37239915168 exp/report-fail-ab = this branch + a forced exit 1 in Build Check not cancelled, one need failed ran and failed: [ "failure" == "success" ] → DAMAGE → exit 1. A real failure is still red.

The two dispatched runs could not post a comment, because the notification step runs only on pull_request. What these runs show is the report's result, which is the step's precondition.

exp/report-fail-ab is a throwaway branch with one commit (88bc1eb). It is not for merge.

Not measured

  • The case where a need hits its own timeout-minutes. The workflow is not cancelled then, so the report runs, but I did not check which result the need gets.
  • A cancel that lands before detect-build finishes. The report on main then takes its "skipped" branch and passes (inferred from run 37227380293, not reproduced). This PR does not change that branch.

🤖 Generated with Claude Code

brain-health-report ran on always(), required all six needs to be
`success`, and otherwise exited 1 and posted "CRITICAL: Brain Health
Below Threshold ... cannot be merged". A cancelled need is not
`success`, so a run replaced by a newer push turned into DAMAGE: run
37228527559 on #870 (stress test cancelled by the next push, report
red 12 minutes later, comment at 21:10:18Z), while the replacing run
37234155119 was green throughout.

!cancelled() keeps the report running after a failed need and skips it
only when the workflow run was cancelled. Of the 10 job-level always()
jobs on main this is the only one that tests for `success`; the
fpga-ci and fpga-regression summaries exit only on `failure`.

Closes #881. Part of #851.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown

X Brain Health Check

Score: 100.0/100
Status: 🟢 HEALTHY
Threshold: 80/100

X Brain is above merge threshold

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown

🧪 Brain Stress Test Results

Score: not measured (no stress test prints a Score: line)
Status: 🟢 PASS
Threshold: 270/300

X Stress test passed

@dmitrii-f-t27
dmitrii-f-t27 force-pushed the ci/report-not-on-cancel branch from 52793eb to facf048 Compare October 10, 2026 00:42
dmitrii-f-t27 pushed a commit that referenced this pull request Oct 10, 2026
Positive control for #882: with the report on !cancelled(), a failed
need must still run the report and turn it red. Not for merge; the
branch is deleted after the run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tri-claw

tri-claw Bot commented Oct 10, 2026

Copy link
Copy Markdown

Summary by t27-bees

This change prevents the Brain Health Report job from running when the workflow run itself is cancelled (e.g., superseded by a newer push). Previously if: always() caused the report to execute after a cancellation, incorrectly treating cancelled dependencies as failures and posting a blocking "CRITICAL" comment on the PR.

Worth a look

  • .github/workflows/brain-ci.yml:499 — The new condition if: ${{ !cancelled() }} skips the report when the run is cancelled, but it still runs when a need fails (since cancelled() only reflects the workflow run state, not individual needs). This matches the intent, but verify that a need hitting its own timeout-minutes (which does not cancel the workflow) still triggers the report as expected.

Read: 1 files, +4 -1, the whole diff. Head facf048. Model: openai-compatible/nvidia/nemotron-3-ultra-550b-a55b. Commands: @t27-bees review | summary | help | pause | resume. Free for every repository.

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.

brain-ci: a cancelled run posts a false "CRITICAL: Brain Health Below Threshold"

1 participant