Skip to content

fix(server): do not report success when every code workflow was skipped (RIG-7551) - #182

Merged
rigel-nemo[bot] merged 2 commits into
rigel-releasefrom
ci-pipelines/rig-7551-do-not-report-success-when-every-code
Nov 21, 2026
Merged

rigel-nemo[bot] merged 2 commits into
rigel-releasefrom
ci-pipelines/rig-7551-do-not-report-success-when-every-code

Conversation

@rigel-mintaka

@rigel-mintaka rigel-mintaka commented Nov 21, 2026 •

Copy link
Copy Markdown

What does this do

When the reaper marks every code workflow skipped and the stored pipeline status is success, CI (pr) now reports failure instead of success. This is Woodpecker pipeline #10874 (RIG-7551): the reaper's dead-workflow path (skipDeadWorkflow) skips each code workflow, PipelineStatus folds skipped below success, and codeStatus then passed the stored success through.

The fix is in codeStatus in server/forge/github/status_aggregate.go. When the code set is non-empty, every workflow is skipped, and the stored status is success, it returns failure. The global statusPriorityOrder is unchanged.

Why do we need it

RIG-7551 closed the pending and running cases (#158, #170, #173). This is the remaining gap: no code workflow ran, yet the required CI (pr) check could go green.

Tests

  • TestStatusAggregateAllCodeSkippedIsNotGreen (new, red before the fix): every code workflow skipped, a meta gate passes, stored success, expects failure.
  • TestStatusAggregateSomeSkippedCodeWorkflowsStaysGreen (new guard): one code workflow passes, one is skipped, stored success, expects success.
  • TestStatusAggregateTerminalStatusIsNotMaskedBySkippedCodeWorkflows: the case successful pipeline with every code workflow skipped flips from success to failure. The old expectation asserted the bug.

Spec-impact: none

Refs RIG-7551

Co-authored-by: Matt Wilkinson matt@rigel.build

…ed (RIG-7551)

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@linear-code

linear-code Bot commented Nov 21, 2026

Copy link
Copy Markdown

RIG-7551

@rigel-mintaka

Copy link
Copy Markdown
Author

Review round 1 at 5f13308

0 high, 1 medium, 2 low. Fixes are being made on this PR.

Sev Finding Action
Medium With WOODPECKER_REPORT_SKIPPED_WORKFLOWS on, workflows filtered out by when are stored as skipped. A PR whose code workflows are all path-filtered, with a passing meta gate, would turn red. That isn't live today: the flag is "false" in the AKS deployment. Fire the guard only when every skipped code workflow has steps. Filtered workflows have none; workflows the reaper skipped keep their steps. Add a table case for the filtered shape (it stays green).
Low The comment, the test doc and the body cite RIG-10874, the wrong issue. The case meant is Woodpecker pipeline #10874 in RIG-7551. Fix the references.
Low Nothing is logged when the guard overrides a stored success. Add a debug or info log line with the pipeline id.

Already checked: ci-affected-none is push-only, so it doesn't reach this. Cancel, dependency-failure and supersede paths don't reach the guard. The flipped table case was a test pinning a bug. When the guard was disabled, both new tests failed.

@rigel-mintaka

Copy link
Copy Markdown
Author

All-clear at f9b291c

Round 2 is the interdiff 5f13308..f9b291c: status_aggregate.go +19 -6 and its test +18 -8. All three round-1 findings are fixed:

  • Medium: allSkippedWithSteps fires only when at least one skipped code workflow has steps. I checked that every caller passes workflows with Children loaded: ReportAggregateStatus uses b.Workflows or WorkflowGetTree, which fills Children (datastore/workflow.go), and the reap and items paths load or build the tree the same way. A filtered-only set stays green (new table case). The author confirmed that removing the step check makes that case fail.
  • Low: the refs now read "Woodpecker pipeline #10874 (RIG-7551)".
  • Low: an Info log line with pipeline_id when the guard overrides a stored success.

TestStatusAggregate* all pass (author's run, per-case lines in the hand-off).

@rigel-nemo

rigel-nemo Bot commented Nov 21, 2026

Copy link
Copy Markdown

Checks read:

@rigel-nemo
rigel-nemo Bot merged commit 2b1d371 into rigel-release Nov 21, 2026
3 of 6 checks passed
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.

1 participant