nixpkgs/ci/github-script
Wolfgang Walther 366992025d ci/github-script/bot: improve parallelism
We used to employ the worst strategy for parallelism possibly: The rate
limiter capped us at one concurrent request per second, while 100+ items
were handled in parallel. This lead to every item taking the full
duration of the job to proceed, making the data fetched at the beginning
of the job stale at the end. This leads to smaller hiccups when
labeling, or to the merge-bot posting comments after the PR has already
been closed.

GitHub allows 100 concurrent requests, but considers it a best practice
to serialize them. Since serializing all of them causes problems for us,
we should try to go higher.

Since other jobs are running in parallel, we use a conservative value of
20 concurrent requests here. We also introduce the same number of
workers going through the list of items, to make sure that each item is
handled in the shortest time possible from start to finish, before
proceeding to the next. This gives us roughly 2.5 seconds per individual
item - but speeds up the overall execution of the scheduled job to 20-30
seconds from 3-4 minutes before.

(cherry picked from commit 810b9ba51d)
2025-11-04 15:43:33 +00:00
..
.editorconfig ci/github-script: default to commonjs 2025-07-15 12:57:57 +00:00
.gitignore ci/github-script/commits: init from ci/check-cherry-picks 2025-07-16 10:26:08 +00:00
.npmrc ci/github-script: use real @actions/core 2025-07-16 10:26:08 +00:00
bot.js ci/github-script/bot: improve parallelism 2025-11-04 15:43:33 +00:00
commits.js ci/github-script/commits: split review function into separate file 2025-08-25 12:05:51 +00:00
get-teams.js ci/github-script/teams: use consistent style 2025-10-28 17:04:27 +01:00
merge.js [Backport release-25.05] ci/github-script/merge: fix with deleted users (#458079) 2025-11-03 11:24:43 +00:00
package-lock.json ci/github-script: use real @actions/core 2025-07-16 10:26:08 +00:00
package.json ci/github-script: use real @actions/core 2025-07-16 10:26:08 +00:00
prepare.js workflows/check: don't check github api for owners file 2025-09-30 10:38:14 +00:00
README.md ci/github-script/commits: init from ci/check-cherry-picks 2025-07-16 10:26:08 +00:00
reviews.js ci,workflows: deal with ghost reviews 2025-08-25 13:29:21 +00:00
run workflows/bot: rename from labels 2025-11-01 15:02:00 +00:00
shell.nix ci/github-script: add gh dependency to dev shell 2025-07-15 12:57:57 +00:00
withRateLimit.js ci/github-script/bot: improve parallelism 2025-11-04 15:43:33 +00:00

GitHub specific CI scripts

This folder contains actions/github-script-based JavaScript code. It provides a nix-shell environment to run and test these actions locally.

To run any of the scripts locally:

  • Enter nix-shell in ./ci/github-script.
  • Ensure gh is authenticated.

Check commits

Run ./run commits OWNER REPO PR, where OWNER is your username or "NixOS", REPO is the name of your fork or "nixpkgs" and PR is the number of the pull request to check.

Labeler

Run ./run labels OWNER REPO, where OWNER is your username or "NixOS" and REPO the name of your fork or "nixpkgs".