Skip to content

Commit 32c301d

Browse files
committed
ci(observability-map): stop the nightly corpus depending on the paths filter
`needs: changes` carries an implicit success() that outranks the event test in the `if`, so a failed or skipped filter job silently skipped the nightly mutation corpus and the tree-drift scan stopped without saying so. Adding a status-check function to the `if` drops the implicit success() and lets the event test decide alone. The filter job now runs only for pull requests, the sole path that reads its output. Pull request gating is unchanged.
1 parent 61fe11d commit 32c301d

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

.github/workflows/observability-map.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ jobs:
2626
# evaluates it once per workflow. This narrows it again for the corpus job alone.
2727
changes:
2828
name: 🔍 Which paths moved
29+
# Only the pull request path reads this job's output. On a schedule the action has no base to
30+
# diff, warns that `before` is missing and reports the files in the last commit on main, which
31+
# nothing then consults. Skipping it there keeps the nightly off a job it does not need.
32+
if: github.event_name == 'pull_request'
2933
runs-on: warp-ubuntu-latest-x64-2x
3034
outputs:
3135
package: ${{ steps.filter.outputs.package }}
@@ -63,7 +67,20 @@ jobs:
6367
mutation-corpus:
6468
name: 🧬 Mutation corpus
6569
needs: changes
66-
if: github.event_name != 'pull_request' || needs.changes.outputs.package == 'true'
70+
# `!cancelled()` is here for the nightly, not for tidiness. `needs` carries an implicit
71+
# success() on the job it names, and that implicit test outranks the `||` below: with a plain
72+
# condition, a `changes` job that failed or was skipped skips this one, so the nightly would
73+
# stop scanning for tree drift and report nothing about having stopped. A status-check function
74+
# in the `if` is what drops the implicit success(), so the event test below decides alone.
75+
# `!cancelled()` rather than `always()` because `cancel-in-progress` above is a real path and a
76+
# superseded run should not finish this job.
77+
#
78+
# Pull request behaviour is deliberately unchanged: on a PR a failed `changes` leaves
79+
# `needs.changes.outputs.package` empty, so the corpus still skips. The nightly is the backstop
80+
# for that, which is the same trade the paths gate already makes for routes-only pull requests.
81+
if: >-
82+
!cancelled() &&
83+
(github.event_name != 'pull_request' || needs.changes.outputs.package == 'true')
6784
runs-on: warp-ubuntu-latest-x64-4x
6885
steps:
6986
- name: ⬇️ Checkout repo

0 commit comments

Comments
 (0)