Skip to content

Commit 33dda43

Browse files
committed
Carry the gating's reasoning in the PR, not in comments
The job and step names already say what each one does. The reasoning for why it's safe (fail-safe lists, job-level skips that report as passing, Race Detection's always()) is in the pull request and the first commit's message.
1 parent 8cc62b4 commit 33dda43

1 file changed

Lines changed: 2 additions & 38 deletions

File tree

‎.github/workflows/test.yml‎

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,52 +7,23 @@ on:
77
# request opened against its parent branch is exactly the one that
88
# most needs checking, and it was getting none.
99
pull_request:
10-
# The full suite every night, whatever changed. Pull requests run only what
11-
# their change can affect (see `changes` below), and the vulnerability
12-
# database moves without any commit: govulncheck lives in this workflow, so
13-
# without a schedule a new advisory surfaced only when someone next pushed.
1410
schedule:
1511
- cron: '23 5 * * *'
1612
workflow_dispatch:
1713

18-
# A new push to a pull request supersedes the run in flight. Pushes to main,
19-
# the schedule and dispatches never cancel, and each gets a group of its own:
20-
# a group holds one running and one pending run, so a shared one would let a
21-
# newer main push replace a queued nightly run even with cancel-in-progress off.
2214
concurrency:
2315
group: ${{ github.event_name == 'pull_request' && format('test-pr-{0}', github.event.pull_request.number) || format('test-run-{0}', github.run_id) }}
2416
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
2517

2618
permissions: {}
2719

2820
jobs:
29-
# What this run has to check. Only a pull request is ever narrowed: a push
30-
# to main, the nightly schedule and a dispatch always answer "everything".
31-
#
32-
# go anything outside the two lists below: the whole suite.
33-
# tests only skill or eval files: Tests and Integration Tests, which read
34-
# the embedded skill, its drift fixtures and the eval patterns. Lint,
35-
# Security, CLI Surface Check and the race shards cannot see a
36-
# Markdown or YAML change, so they skip.
37-
# (neither) only prose that nothing builds, embeds or tests: Tests runs its
38-
# naming check and nothing else.
39-
#
40-
# Fail-safe by construction. A path narrows the run only if it is listed
41-
# here, so a file nobody thought about runs everything, and this file is on
42-
# neither list, so a change to the gating runs everything too.
43-
#
44-
# Required checks keep reporting. The gated jobs below skip with a job-level
45-
# `if`, and GitHub counts a job skipped by its condition as a passing check.
46-
# A workflow-level `paths` filter would not run the workflow at all and would
47-
# leave every required check pending forever. And a classifier that fails or
48-
# answers nothing narrows nothing: the gates test `!= 'false'`, under
49-
# `!cancelled()`, so an empty answer runs the job.
5021
changes:
5122
name: Classify changes
5223
runs-on: ubuntu-latest
5324
permissions:
5425
contents: read
55-
pull-requests: read # dorny/paths-filter enumerates PR files via the REST API
26+
pull-requests: read
5627
outputs:
5728
go: ${{ steps.decide.outputs.go }}
5829
tests: ${{ steps.decide.outputs.tests }}
@@ -62,9 +33,6 @@ jobs:
6233
if: github.event_name == 'pull_request'
6334
uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
6435
with:
65-
# `every`: a file counts for a filter only if it matches all of that
66-
# filter's patterns, so '**' plus negations reads "any file outside
67-
# these lists".
6836
predicate-quantifier: every
6937
filters: |
7038
go:
@@ -92,7 +60,6 @@ jobs:
9260
exit 0
9361
fi
9462
95-
# A classifier that cannot tell must not be allowed to say "skip".
9663
for answer in "$GO" "$TESTS"; do
9764
case "$answer" in
9865
true|false) ;;
@@ -117,8 +84,6 @@ jobs:
11784
name: Tests
11885
runs-on: ubuntu-latest
11986
needs: changes
120-
# Always runs: the naming check covers Markdown, so a prose-only change
121-
# still has something here to answer for. Only the Go steps are gated.
12287
if: ${{ !cancelled() }}
12388
permissions:
12489
contents: read
@@ -305,8 +270,7 @@ jobs:
305270
runs-on: ubuntu-latest
306271
needs: [changes, race-shard]
307272
# always(), or a failed shard would skip this job — and a skipped required
308-
# check is not a failed one. The one skip that is meant: a pull request
309-
# whose change the shards cannot see, where they skipped by design too.
273+
# check is not a failed one.
310274
if: ${{ always() && needs.changes.outputs.go != 'false' }}
311275
permissions:
312276
contents: read

0 commit comments

Comments
 (0)