ci: add keep-sorted workflow; format and sort top-level/python-packages.nix#391087
ci: add keep-sorted workflow; format and sort top-level/python-packages.nix#391087infinisil merged 5 commits intoNixOS:masterfrom
Conversation
0bbc741 to
6c66651
Compare
6c66651 to
7d938c7
Compare
7d938c7 to
e7e4f67
Compare
e7e4f67 to
a9b37bf
Compare
ce86a99 to
9735ecf
Compare
infinisil
left a comment
There was a problem hiding this comment.
In the future I hope that we can migrate all lists of packages to something like pkgs/by-name, but for now this looks like a good alternative.
LGTM, I'll merge!
|
Oh, conflict to resolve. It would also be good to add the formatting commit to |
Signed-off-by: Paul Meyer <katexochen0@gmail.com>
9735ecf to
afc776a
Compare
Yes, getting this in without a conflict isn't easy. 😅 |
Signed-off-by: Paul Meyer <katexochen0@gmail.com>
Signed-off-by: Paul Meyer <katexochen0@gmail.com>
Signed-off-by: Paul Meyer <katexochen0@gmail.com>
Signed-off-by: Paul Meyer <katexochen0@gmail.com>
afc776a to
fd14c06
Compare
I hope we can do so, but keep-sorted can do much more! It can sort markdown tables, large lists of buildInputs, ... |
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin release-24.11
git worktree add -d .worktree/backport-391087-to-release-24.11 origin/release-24.11
cd .worktree/backport-391087-to-release-24.11
git switch --create backport-391087-to-release-24.11
git cherry-pick -x 5f6f5e13ae0b6960cbf1be8aeb3d0048285a08d1 cb755af53647e28dd54d576c074ac8de7ad6fc73 60b30dd3164e656eb5ca049064781d14999fc77c 3b0f56da6197c20bbd56132654a9a1a424ddf743 fd14c067813572afc03ddbf7cdedc3eab5a59954 |
We should do a manual backport as well to avoid merge conflicts when backporting python packages. |
|
I'm wondering, is there any point to including the "fixed" ordering in the CI log: I think it would be enough to report the underlined path, and maybe the affected region. The gigantic "new_content" field below that is not really helping, at least for python-packages.nix. Maybe it helps on smaller files? |
|
Also, now that we have three workflows that install stuff via pinned nixpkgs, we often get 429 rate limited on the tarball for that nixpkgs revision. https://github.com/NixOS/nixpkgs/actions/runs/14143005549/job/39626911331?pr=341767 |
@FliegendeWurst any idea how to fix this? |
|
I see three options:
Option 1 could still lead to failures, but is less likely. |
|
I think we should run more workflows in one job in general. We seem to have quite a few workflows, where the time it takes to run the actual check is far less than the time it takes to set up the whole job, check out the repo, etc. - quite a waste of resources, imho. Imho, all the "checks" could go into one workflow, because they are only breaking very rarely anyway. We might need to be smart about it, so that all the checks are still run, even if one of the prior steps fails This will also make the huge job list for each PR less cluttered. |
We could use oras to install binaries in a content addressed way, storing them in ghcr.io (which has far less rate limiting). |

keep-sorted is a language-agnostic formatter that sorts lines between two markers in a larger file.
This is a first step to use keep-sorted to enforce sorting in nixpkgs, adding a CI job and sorting python-packages.nix (as it had a quite uniform structure already). The nixfmt format comes in handy here, as the way blocks are formatted make it really easy for keep-sorted.
As the workflow has pull_request_target trigger, it won't run on this PR, I've tested it on my fork: https://github.com/katexochen/nixpkgs/actions/runs/13934128359/job/38998162445?pr=1
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.