**Investigation:**
- According to
[here](https://github.com/microsoft/playwright/actions/runs/8351676198),
the job got cancelled, because someone force-pushed and another commit
took priority.
- We have `if: always()` for uploading the blobs, even if they are
cancelled. We expect, that the task before (`npx playwright test`)
finished writing the blob, but it didn't - cancelled in between. We
still upload - a broken one.
- We download the broken zip and it breaks from there on.
Proposed change: Instead of uploading always, upload if it did not get
cancelled.
Quoting from the GitHub Actions docs about `always()`:
> Warning: Avoid using always for any task that could suffer from a
critical failure, for example: getting sources, otherwise the workflow
may hang until it times out. If you want to run a job or step regardless
of its success or failure, use the recommended alternative: if: `${{
!cancelled() }}`
This is phase 1/2 where it changes our code to use this new condition.
The actual roll-out happens once it works for us.
Relates https://github.com/microsoft/playwright/issues/29451
* Before the change if if uploaded artifact path contained just one file
it would be [archived
directly](694cdabd8b/src/search.ts (L142-L151)),
but if there is a sister folder it would be an archive of the entire
dir. According to the action docs "If a wildcard pattern is used, the
path hierarchy will be preserved after the first wildcard pattern", so
hopefully it means that the directory is always compressed even if there
is a single file in it.
* Use `overwrite: true` to have only one artifact with pull request
number.
`actions/upload-artifact@v4` comes with the following [breaking
change](https://github.com/actions/upload-artifact?tab=readme-ov-file#breaking-changes):
"Due to how Artifacts are created in this new version, it is no longer
possible to upload to the same named Artifact multiple times. You must
either split the uploads into multiple Artifacts with different names,
or only upload once. Otherwise you will encounter an error."
Due to that we cannot copy multiple blob report folders into the same
artifact name and rely on the action to merge them. Instead, as
suggested by their migration guide, we upload each blob report into a
uniquely named artifact with prefix `blob-report-` and then download all
of them into same directory.
This version change also affects how we store pull_request_number.txt
into an artifact. Previously we relied on the fact that uploading
artifact with the same name would silently override existing one, but
now it's an error. To overcome that, we upload PR number file into
uniquely named artifacts `pull-request-*` and later extract them into
same location with `unzip -n` which will never override existing file,
so we end up with single `pull_request_number.txt`.
Reference #28800
We used to have this historically due to bots which were running on
Node.js 14. Node.js 14 was shipping NPM 7 back in the days.
Now all bots are on >= Node.js 16 so we can remove this legacy code.
- remove error details from the reports
- collapse flaky tests by default
- limit comment to 65365 character
GitHub API has comment length limit 65536 chars:
```
Unhandled error: HttpError: Validation Failed: {"resource":"IssueComment","code":"unprocessable","field":"data","message":"Body is too long (maximum is 65536 characters)"}
```