Repository navigation
Commit 23c7d78
Name Each Job That Posts the Required Check Off a Pull Request Run (#3799)
## Summary
In `spec/audit.py`, `check_interface` skipped the D1.5 every-event
finding for the whole workflow once any one job used the
pull_request-only name expression. A second job could still post the
required check on a non-PR run, and nothing flagged it.
The check now reads each job's `name:` together with its job key. A
job's name off a pull_request run is its literal name, or the `||`
fallback string when the name uses the pull_request-only expression.
Some workflows are triggered by events other than `pull_request`. In
those, every job whose off-PR name equals the required check gets its
own DRIFT, and the finding names that job. The other jobs no longer
affect it.
The existing missing-name DRIFT keeps its develop behaviour. It covers
names that are neither a literal nor the pull_request-only expression,
and it still flags an expression whose two branches are both the
required name on a pull_request-only workflow. It now runs alongside the
per-job check rather than ahead of it.
- **A job falling back to the required name, with no gated job.** It
reports both findings, and both are true. The PR run never posts the
check, and a non-PR run does.
- **An expression whose two branches are both the required name, on a
dispatch-triggered workflow.** It reports only its per-job finding. That
job does post the check on the PR run, so the missing-name finding would
be false there.
Repro on a constructed stub triggered by `pull_request` and
`workflow_dispatch`:
- **A literal sibling.** One job is named by the D1.5 expression, and a
second carries the literal `Check pull request workflow status job`.
This returned `[]` before the change. It now returns one DRIFT naming
the second job.
- **A fallback sibling.** The second job is named `${{ github.event_name
== 'pull_request' && 'Other job' || 'Check pull request workflow status
job' }}`. This also returned `[]` before the change. It now returns one
DRIFT naming that job.
Unchanged: a gated job alone raises no finding. A literal name on a
pull_request-only workflow raises no finding either.
## Tests
New `INTERFACE_CASES` rows in `tests/test_audit_helpers.py`:
- A literal sibling beside a gated job.
- A fallback sibling beside a gated job.
- Two literal jobs, one finding each.
- A fallback-only job, both findings.
- An every-event expression on a dispatch-triggered workflow, one
finding.
- A fallback job beside an every-event expression naming another check,
both findings.
Two new tests assert which job each finding names, and that the dispatch
every-event case reports its per-job finding rather than the generic
one. Run against develop's `spec/audit.py`, every new row fails except
the dispatch every-event row. That row keeps develop's count, so its
message test is what pins it. The last row also fails if the suppression
stops checking for the required name.
`spec/audit.py --selftest` and the full `OPERATIONS.md` "Local
Verification" block pass.
Closes on promotion: #3334
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>1 parent a8346fe commit 23c7d78
2 files changed
Lines changed: 112 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
972 | 972 | | |
973 | 973 | | |
974 | 974 | | |
975 | | - | |
976 | | - | |
977 | | - | |
978 | | - | |
979 | | - | |
980 | | - | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
981 | 979 | | |
982 | | - | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
983 | 998 | | |
984 | 999 | | |
985 | 1000 | | |
986 | 1001 | | |
987 | 1002 | | |
988 | 1003 | | |
989 | | - | |
990 | | - | |
991 | | - | |
992 | | - | |
993 | | - | |
| 1004 | + | |
994 | 1005 | | |
995 | 1006 | | |
996 | 1007 | | |
997 | | - | |
| 1008 | + | |
998 | 1009 | | |
999 | 1010 | | |
1000 | 1011 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
186 | 251 | | |
187 | 252 | | |
188 | 253 | | |
| |||
633 | 698 | | |
634 | 699 | | |
635 | 700 | | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
636 | 724 | | |
637 | 725 | | |
638 | 726 | | |
| |||
0 commit comments