Skip to content

fix(server): keep reaper skips killed unless a dependency was lost (RIG-7551) - #184

Merged
rigel-nemo[bot] merged 1 commit into
rigel-releasefrom
ci-pipelines/rig-7551-keep-reaper-skips-killed-unless-a
Nov 21, 2026
Merged

rigel-nemo[bot] merged 1 commit into
rigel-releasefrom
ci-pipelines/rig-7551-keep-reaper-skips-killed-unless-a

Conversation

@rigel-mintaka

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

Copy link
Copy Markdown

What does this do

Fix-forward for #183 review round 1 (#183 (comment)). The reaper now picks the step state for a dependency skip from the skip reason:

  • Verdict forbids the workflow: every dependency reached success or failure, and runs_on rejects that outcome. The reaper writes killed steps, as the scheduler's markSkipped does.
  • Lost dependency, or a pending timeout: the reaper writes canceled steps, which marks lost work.
  • A permitted runs_on whose dependency succeeded and then timed out ends error. Only its dependents get canceled steps.

The codeStatus guard still reports failure for a stored success with a canceled step. A user cancel of running work stores killed. A cancel of only-pending workflows stores canceled, which is rewritten before the rollup. Neither changes the verdict.

Known gap

  • WorkflowSupersedePending is unchanged. It can still leave pending-skipped steps under a success pipeline. This is safe today because only pull events get the workflow tree, and orion cancels only main pipelines.
  • A default dependent of a scheduler-skipped workflow keeps canceled steps, by ruling: work that never ran stays canceled. Orion has no failure-only workflows.

Why do we need it

#183 merged before this round landed. Without this PR, rigel-release can report a green PR over a reaper-skipped code workflow whose dependency was legitimately forbidden, which turns a healthy PR red. This fixes that and keeps the RIG-7551 loss signal.

Tests

  • TestReapOrphanedWorkflows: verdict-forbidden writes killed; lost dependency, killed dependency, and the permitted timeout write canceled.
  • TestReapPendingTimeoutNextPass: the same rule across passes.
  • TestStatusAggregateReapedCodeWorkflowUnderSuccessIsNotGreen: killed and stepless shapes stay green.

CGO_ENABLED=0 go test passes for forge/github, pipeline, and pipeline/metadata on the merged base. Datastore, queue, web, api, and session cannot run here (no C compiler). The base fails the same packages.

Release and pin

No fork release cut and no orion pin bump. #183 is not in any pinned release, so this rides the next fork release.

Spec-impact: none

Checks skipped: fork has no local hook runner

Refs RIG-7551

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

…IG-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-nemo

rigel-nemo Bot commented Nov 21, 2026

Copy link
Copy Markdown

Checks read:

@rigel-nemo
rigel-nemo Bot merged commit 4094957 into rigel-release Nov 21, 2026
3 of 4 checks passed
@rigel-mintaka

Copy link
Copy Markdown
Author

Review round 2 at bcd39be (posted after merge)

The code is correct. Every branch of the skip rule is tested, and the tests fail red on the base reaper. There are 0 high, 1 medium and 1 low finding, and both are in the PR body. I edited the #184 and #183 bodies to fix them.

# Sev Finding Action
1 Medium The body did not name supersede as a known gap. WorkflowSupersedePending can still leave pending-skipped steps under a success pipeline. That is safe today only because pull events alone get the workflow tree, and orion cancels only main pipelines. #183's body still claimed supersede stores a non-success status. Added a Known gap section to #184. Pointed #183's body to #184.
2 Low Two wrong sentences. A permitted runs_on timeout ends error, not canceled; only its dependents get canceled steps. A cancel of only-pending workflows stores canceled, which is rewritten before the rollup. Corrected in the #184 body.

Accepted: a default dependent of a scheduler-skipped workflow keeps canceled steps by the ruling ("never-run keeps canceled"). Orion has no failure-only workflows. The Known gap section names it.

Round-1 M2 and L4 are fixed. The skip reason is now truthful.

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