mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-03-08 05:44:08 +01:00
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. |
||
|---|---|---|
| .. | ||
| .editorconfig | ||
| .gitignore | ||
| .npmrc | ||
| bot.js | ||
| commits.js | ||
| get-teams.js | ||
| merge.js | ||
| package-lock.json | ||
| package.json | ||
| prepare.js | ||
| README.md | ||
| reviews.js | ||
| run | ||
| shell.nix | ||
| withRateLimit.js | ||
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-shellin./ci/github-script. - Ensure
ghis 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".