Repository navigation
Commit a2e9438
CI: Unify the automation comments into a single PR comment (#82249)
* CI: Add a shared action for a single PR automation comment
Every automation posts its own comment today, so a pull request collects
three to five bot comments before a human says anything.
Add tools/pr-meta, an action that maintains one comment split into
marker-delimited sections. Each producer owns one section and rewrites
only its own, so the comment reads the same however the workflows
interleave.
Writers hold a shared concurrency group rather than verifying their own
write, which cannot detect a lost update: two writers reading the same
body both succeed, and the first section is gone. queue: max is required
there, since the default cancels a pending writer once a third arrives.
actionlint does not know the queue key. Its last release predates the
feature and rhysd/actionlint#654 is open, so suppress that one message.
The action imports nothing: depending on @actions/core would mean a full
npm install in every writer job just to edit a comment.
* CI: Report the bundle size in the shared PR comment
compressed-size-action sets its rendered markdown as an output before it
decides whether to comment, so use-check diverts the comment into a check
run and the body still reaches the shared comment.
use-check is conditional on the pull request not being from a fork. A
fork's token cannot create a check, and unlike its comment path, its
check path does not catch that failure and would fail the job.
* Report Flaky Tests: Render the report instead of commenting
The action now writes markdown to output-path and no longer talks to
GitHub, so the report joins the shared PR comment. Its repo-token input
and its GitHub API client go with it.
The workflow only invoked the action when a report artifact existed, so a
clean run could never clear a stale report. The writer job now runs on
every pull request and treats the missing artifact as an empty section.
* CI: Post the performance results on the pull request
The results were only ever written to the job summary, buried in the logs
of a workflow run. Limiting the number of bot comments was the stated
reason for not posting them, which the shared comment removes.
Each shard already renders a summary, so upload those and merge them in
the results job, keeping the heading and preamble they share once.
* CI: Check the type label in the workflow itself
github-action-required-labels cannot report through the shared comment:
its failure path exposes only a status, never the rendered message or the
labels it matched. Turning its comment off also disables the branch that
deletes its own warning once the labels are fixed, which would strand a
warning on every pull request that ever had one.
The rule is one label matching ^\[Type\], so read the labels directly. Read
them at the point of writing rather than from the event payload, since
runs queue behind each other and an older one can arrive after a newer one
already fixed them.
Also fire on opened and reopened. A pull request opened without a type
label got no warning until some unrelated event happened.
* Project Automation: Expose the contributor prompts as outputs
Both first-time contributor tasks posted their own comment: a welcome on
the pull request, and a prompt to link a WordPress.org profile once it
merged. They now set outputs and the workflow posts them, so both join the
shared PR comment.
The account link task runs on push, whose payload carries no pull request
number, so it exposes the one it resolved alongside the prompt. Its writer
needs that for the comment and for the concurrency group both.
* Changelogs: Reference the pull request
* PR meta: Add publishConfig and emoji section headings
Every other tools/* workspace carries publishConfig despite being
private, and the repo-wide lint rule requires it.
Lead each heading with an emoji so a reader can pick their section out of
a comment holding seven of them without reading any of the others.
* PR meta: Wrap the comment title in emoji
Marks the comment as automation at a glance, matching the section
headings below it.
* PR meta: Collapse the long sections behind a fold
Performance tables and flaky test traces would otherwise push the rest of
the comment out of view.
The fold sits outside the section delimiters, alongside the heading and
the footer. Everything between them is read back as the body, so a fold
kept inside would nest into itself on every write.
* PR meta: Do not let a failed check clear a section
Three ways a section was cleared by something other than a result:
Every write re-renders every section, footers included, so a writer for a
PR-state section needs the head too. Without it, updating Labels dropped
the 'not the current head' marker from a stale Bundle size, presenting an
old result as current.
The label reporter ran even when the check step failed, where a missing
body file means 'labels are fine', so a failed API call erased a warning
nothing had disproved.
The flaky renderer treated every readdir failure as a clean run. Only a
missing directory means clean; anything else now surfaces.
* PR meta: Skip the write when the head cannot be read
Swallowing that failure re-rendered every section without a head, which
strips the 'not the current head' footer from stale results and presents
them as current. Letting it reach the outer handler skips the write
instead, and adds the first tests covering the action's entry point.
Also drop the two dependencies report-flaky-tests no longer uses,
consolidate its unreleased changelog entries now that it renders rather
than comments, and document the automation action's new outputs.
* PR meta: Truncate between blocks, and fail a broken flaky run
Truncation cut at a fixed offset, so a cut landing inside a stack trace
left the fence open and rendered the note and its link as code. It now
cuts at a paragraph break and closes whatever fences and disclosures the
cut left open.
The flaky renderer logged its errors and left the step green, which looks
exactly like a clean run, so the writer downstream cleared a report that
nothing had disproved. It now fails the step, and the writer runs only
when the job producing the report succeeded.
Also update the README, package description and action description, which
still described the action as posting a comment.
Co-authored-by: manzoorwanijk <manzoorwanijk@git.wordpress.org>
Co-authored-by: ciampo <mciampini@git.wordpress.org>1 parent 87dfece commit a2e9438
40 files changed
Lines changed: 2131 additions & 306 deletions
File tree
- .github
- workflows
- packages
- project-management-automation
- lib/tasks
- first-time-contributor-account-link
- test
- first-time-contributor-label
- test
- report-flaky-tests
- src
- __tests__
- __snapshots__
- tools/pr-meta
- src
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
10 | 14 | | |
11 | 15 | | |
12 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
49 | 51 | | |
| 52 | + | |
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
| |||
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
| 73 | + | |
70 | 74 | | |
71 | 75 | | |
72 | 76 | | |
73 | 77 | | |
74 | 78 | | |
75 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
220 | | - | |
221 | 219 | | |
222 | 220 | | |
223 | 221 | | |
| |||
275 | 273 | | |
276 | 274 | | |
277 | 275 | | |
278 | | - | |
| 276 | + | |
279 | 277 | | |
280 | 278 | | |
281 | 279 | | |
282 | | - | |
283 | 280 | | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
5 | 13 | | |
6 | 14 | | |
7 | 15 | | |
8 | 16 | | |
9 | 17 | | |
10 | 18 | | |
11 | 19 | | |
| 20 | + | |
12 | 21 | | |
13 | 22 | | |
14 | 23 | | |
| 24 | + | |
15 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
16 | 33 | | |
17 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
18 | 37 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
266 | 274 | | |
267 | 275 | | |
268 | 276 | | |
| |||
331 | 339 | | |
332 | 340 | | |
333 | 341 | | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
334 | 374 | | |
335 | 375 | | |
336 | 376 | | |
| |||
340 | 380 | | |
341 | 381 | | |
342 | 382 | | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
0 commit comments