Repository navigation
Commit 05a7fcf
committed
ci: check the analyses reached code scanning
What the workflow declares and what code scanning received are different
claims, and only the second is evidence. A scan that runs and uploads
nothing, or whose category merges with another tool's so that both are
filed as one, is invisible to anything that reads the workflow file.
A third job waits for both uploads and asserts that the commit this run
scanned carries analyses under exactly the three expected categories,
retrying while indexing catches up. It holds read on security-events, not
write: it must not be able to delete what it is checking. It runs unless
the run was cancelled, because needs: alone would skip it when a scan
fails, and a skipped job reports success to whatever requires it.
verify-analyses.test.sh stands gh in front of canned analyses and pins the
verdict for each way the expected set can be wrong: a category filed on an
earlier commit or another ref, a set split over pages, indexing that lands
an attempt late, a call that fails once, a call that fails every time, and
an API that stops answering after it has answered. An error on one attempt
has to be retried; an error on every attempt still fails the job. The
interval between attempts is recorded rather than waited out, and the test
cannot speak to a body written to recognise its own launch and skip in the
job, which review decides rather than a sibling test.
An API that never answered is reported as such rather than as an empty
set of analyses, and the fixtures carry an unexpected category at each end
of the sort order and a substitution at each end, where a comparison that
tolerates a longer list, or counts rather than compares, would pass. A
commit sharing seven hex with the scanned one carries the whole expected
set in another, and a category differing only in case appears beside the
expected one as well as in its place, so an abbreviated match and a
case-folded comparison are each red.
The analyses are read with --paginate: the ref lists every analysis ever
filed on it, newest first, and this pull request's ref passed a hundred in
a little over a day, so a single page is a truncated answer that hides an
older commit's analyses.
Signed-off-by: Nikita Kalyazin <nikita.kalyazin@e2b.dev>1 parent a00522e commit 05a7fcf
5 files changed
Lines changed: 373 additions & 10 deletions
File tree
- .github
- scripts
- workflows
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
| 62 | + | |
60 | 63 | | |
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
64 | 67 | | |
65 | 68 | | |
| 69 | + | |
66 | 70 | | |
67 | 71 | | |
68 | 72 | | |
| |||
84 | 88 | | |
85 | 89 | | |
86 | 90 | | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
91 | 99 | | |
92 | 100 | | |
| 101 | + | |
93 | 102 | | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | 103 | | |
99 | 104 | | |
100 | 105 | | |
101 | 106 | | |
102 | 107 | | |
103 | 108 | | |
104 | 109 | | |
| 110 | + | |
105 | 111 | | |
106 | 112 | | |
107 | 113 | | |
108 | 114 | | |
109 | 115 | | |
110 | 116 | | |
111 | 117 | | |
| 118 | + | |
112 | 119 | | |
113 | 120 | | |
114 | 121 | | |
| |||
478 | 485 | | |
479 | 486 | | |
480 | 487 | | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
481 | 524 | | |
482 | 525 | | |
483 | 526 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
0 commit comments