NixOS / ofborg

@ofborg tooling automation https://monitoring.ofborg.org/dashboard/db/ofborg
https://ofborg.org
MIT License
232 stars 166 forks source link

ofborg/src/maintainers.nix: look up files pointed by "pos" attribute #669

Closed trofi closed 7 months ago

trofi commented 8 months ago

Sometimes most of attributes for a package are defined outside the file that defines it. Examples are openjdk and nix.

At least openjdk defined pos attribute to guide nix edit to open the right file. Let's extend ofborg to do the same.

Before the change (with pos applied to nix_2_3):

$ printf '[["nix_2_3"]]' > attrs.json; \
  printf '["pkgs/tools/package-management/nix/default.nix"]' > paths.json; \
  nix-instantiate --eval maintainers.nix --arg changedattrsjson ./attrs.json --arg changedpathsjson ./paths.json
{ }

After the change:

$ printf '[["nix_2_3"]]' > attrs.json; \
  printf '["pkgs/tools/package-management/nix/default.nix"]' > paths.json; \
  nix-instantiate --eval maintainers.nix --arg changedattrsjson ./attrs.json --arg changedpathsjson ./paths.json
{ flokli = <CODE>; raitobezarius = <CODE>; }
trofi commented 8 months ago

It should be nit pos of a pos but just pos. Converting to draft.

trofi commented 8 months ago

With https://github.com/NixOS/nixpkgs/pull/276892 applied confirmed that nix_2_3 attribute change resolves maintainers as expected. Updated the comment description to include the test.

Mindavi commented 7 months ago

Is nixos/released intentionally the target branch?

cole-h commented 7 months ago

Is nixos/released intentionally the target branch?

Yes, released is the default branch for this repository.