Commit graph

20 commits

Author SHA1 Message Date
Wolfgang Walther 0dff5ad6c5
workflows/check: use regular checkout
The filtered checkout we used before was a nice idea, but only worked
for small numbers of commits in a PR. It would fetch the whole history
initially, but only fetch objects on demand. This turns out to be much
too slow in a PR with 18 commits, regularly hitting the 10 minute
timeout, even when running it locally.

The new approach uses regular checkouts again. In contrast to the old
style, before we switched to the filtered checkout, this only fetches
exactly the commits we need - and all of them at once. This is
significantly faster than both other approaches, and scales much better.
A bigger number of commits doesn't have much of an effect, if any at
all.
2025-08-13 14:02:39 +02:00
Wolfgang Walther 0d6945991c
ci/github-script/labels: limit cutoff to max 1 day (#426946) 2025-07-21 06:13:11 +00:00
Wolfgang Walther 7f9f7a20b0
ci/github-script/labels: limit cutoff to max 1 day
It has only happened once, but the GitHub API suddenly returned a
workflow run from a few weeks back. This lead to quickly hitting the
rate limit for search requests.

Prevent this from happening by going back a day max for the "recently
updated" case. After roughly a day, every PR will have been touched by
the regular batch processing anyway.

Also save a few API requests, by taking bigger chunks of the search
result.
2025-07-20 21:53:21 +02:00
Wolfgang Walther 524a47b2b4
ci/github-script/commits: harden code block rendering
To avoid rendering issues when diffing a markdown file with these
markers in context, just increase the markers length.
2025-07-20 16:06:25 +02:00
Wolfgang Walther 4a0c2c58a2
Revert "ci/github-script/commits: keep formatting for diffs of markdown blocks"
This reverts commit b19798c8b0.

It lead to messed up formatting of the diff.
2025-07-20 16:04:23 +02:00
Wolfgang Walther 486756d85c
ci/github-script/commits: shorten and clarify review comment
Also following the one-sentence-per-line rule now.
2025-07-16 15:47:19 +02:00
Wolfgang Walther c4496912fd
ci/github-script/commits: fix job_url
This broke when we moved the check-cherry-picks workflow into the bigger
PR workflow. At this time, the "workflow run" became the whole PR
workflow, which includes many more than just 1 job, thus the assumption
in `jobs[0]` doesn't hold anymore.
2025-07-16 15:47:18 +02:00
Wolfgang Walther 1fbcad0434
ci/github-script/commits: block on errors
Most of the checks we do for cherry-picks are dismissable warnings, with
one exception: When a commit hash has been found, but this hash is not
available in any of the pickable branches, we raise this with
severity=error. This should also *block* the merge and not be
dismissable. That's because this is a fixable issue in every case.
2025-07-16 15:47:17 +02:00
Wolfgang Walther b19798c8b0
ci/github-script/commits: keep formatting for diffs of markdown blocks
Previously, when the diff contained a context line with ```, this would
end the code block and entirely break the markdown rendering.

Now we use the html code blocks provided by `core.summary` and properly
escape the content, so that it never escapes via html tags.
2025-07-16 12:15:07 +02:00
Wolfgang Walther 40dcbb1483
ci/github-script/commits: ignore whitespace on diff
This reduces noise that the cherry-pick reviews produce when formatting
related conflicts had to be resolved. We only do this in the
length-limited review comment, though. All changes, including
whitespace, can still be double-checked in the job log if needed.
2025-07-16 11:59:28 +02:00
Wolfgang Walther 84925b35c4
ci/github-script/commits: add comment about --creation-factor 2025-07-16 11:58:08 +02:00
Wolfgang Walther b46cb23251
ci/github-script/commits: init from ci/check-cherry-picks
This turns the check-cherry-pick script into a github-script based
JavaScript program. This makes it much easier to extend to check reverts
or merge commits later on.
2025-07-16 11:50:13 +02:00
Wolfgang Walther 2433050fb7
ci/github-script: use real @actions/core
This allows building markdown summaries, which is hard to mock.
2025-07-15 15:09:02 +02:00
Wolfgang Walther cdd1931ace
ci/github-script: add gh dependency to dev shell 2025-07-15 12:19:41 +02:00
Wolfgang Walther d71b8c3680
ci/github-script: allow running without dry mode 2025-07-14 13:49:41 +02:00
Wolfgang Walther 97d4103946
ci/github-script: allow running for single PR
Makes specific tests in the upstream repo easier to do.
2025-07-14 13:49:40 +02:00
Wolfgang Walther 2192c5b6e8
ci/github-script: extract common withRateLimit.js
This can and should be re-used across different scripts.
2025-07-14 13:49:39 +02:00
Wolfgang Walther d11eba1e1d
ci/github-script: default to commonjs
Since all github-scripts need to be written in commonjs, we now default
to it by not setting package.json. Support from editors for .js files is
slightly better than .cjs. To still allow using module imports in the
test runner script, we trick node into loading the script itself as a
module again via `--import ./run`.
2025-07-14 10:35:18 +02:00
Wolfgang Walther aaaabe0cb7
ci/github-script: add commander CLI interface
This makes it easier to add additional features.
2025-07-14 10:35:17 +02:00
Wolfgang Walther 6f6c625026
ci/github-script: move from ci/labels
This just moves things around to use less specific naming - `labels` is
only *one* script that can potentially be run locally while still being
written in github-script. Later, we can add more.
2025-07-14 10:35:13 +02:00