Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib.maintainers: maintainer is now a set #34842

Closed
wants to merge 3 commits into from
Closed

Conversation

FRidh
Copy link
Member

@FRidh FRidh commented Feb 11, 2018

This commit allows values in lib.maintainers to be not only a string,
but also a set. This gives the possibility to obtain the GitHub handle
of maintainers by evaluation, and the possibility to add additional
means for contacting maintainers.

This is based on the suggestion made in
#18352 (comment).

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@FRidh
Copy link
Member Author

FRidh commented Feb 11, 2018

  • Hydra may be affected because the maintainers field is now not a list of strings but a list of sets
  • I can undo the indentation of the list of maintainers for now to prevent merge conflicts
  • fix meta-checking
  • maintainers/scripts/hydra-eval-failures.py

This commit allows values in lib.maintainers to be not only a string,
but also a set. This gives the possibility to obtain the GitHub handle
of maintainers by evaluation, and the possibility to add additional
means for contacting maintainers.

This is based on the suggestion made in
NixOS#18352 (comment).
@vcunat
Copy link
Member

vcunat commented Feb 11, 2018

  • fix meta-checking

... but I'm personally not yet sure that this is a good approach. For example, we're growing per-package resources needed for evaluation all the time, and growing the number of packages as well. Evaluation is something we do really often, even if it's typically partial.

@FRidh
Copy link
Member Author

FRidh commented Feb 11, 2018

Evaluation of meta is fixed.

... but I'm personally not yet sure that this is a good approach. For example, we're growing per-package resources needed for evaluation all the time, and growing the number of packages as well. Evaluation is something we do really often, even if it's typically partial.

This may indeed require additional resources. I would have to test whether it is anything significant. I do think we should have this information available. An alternative would be to simply list the different fields instead of computing them as is done now.

@vcunat
Copy link
Member

vcunat commented Feb 11, 2018

Yes, I'd consider just committing the textually transformed code, probably depending on the real measurements.

@vcunat
Copy link
Member

vcunat commented Feb 11, 2018

I hope there are no other tools depending on the "type" of *.meta.maintainers ...

@grahamc
Copy link
Member

grahamc commented Feb 11, 2018

IIRC Hydra looks at the maintainer list and will need a patch. I think I remember @edolstra saying to do it and he'd take care of the patching.

@grahamc
Copy link
Member

grahamc commented Feb 11, 2018

This seems overly complicated to me. Why do we need that all that funky _structuredMaintainers and ... business? I would just change lib/maintainers.nix to return a attrset of attrsets.

2017-11-16 13:51:55     gchristensen    I propose we make a branch where we just do it, create a jobset to see just how it breaks hydra and then see what we do
2017-11-16 13:51:56     niksnut fixing hydra will take 5 minutes
2017-11-16 13:51:57     MoreTea cool.
2017-11-16 13:52:26     gchristensen    or maybe niksnut knows how it breaks hydra and knows it won't be so terrible for people who use it
2017-11-16 13:52:41     niksnut I think it will just ignore it
2017-11-16 13:52:46     MoreTea clever pointed me to where it's actually used.
2017-11-16 13:52:47     gchristensen    perfect!
2017-11-16 13:53:02     MoreTea So I'll create two PR's then, one for the update of lib/maintainers.nix, and one for hydra ;)
2017-11-16 13:53:04     MoreTea thanks!
2017-11-16 13:54:18     niksnut MoreTea: I can fix hydra, it's probably a lot easier for me
2017-11-16 13:54:29     niksnut unless you want to do some C++ hacking

@FRidh
Copy link
Member Author

FRidh commented Feb 11, 2018

Thanks @grahamc.

So, the goal is indeed to have a set of sets, instead of what is in this PR. Regardless, I think this PR can be used to test the required changes to Hydra. Therefore, I propose

  1. use this PR (merge it or keep this branch) so
  2. we can fix Hydra
  3. and then rewrite this PR or Structured maintainers #31739 to have the set of sets.

@FRidh FRidh mentioned this pull request Feb 11, 2018
1 task
@grahamc
Copy link
Member

grahamc commented Feb 12, 2018

@GrahamcOfBorg eval

@0x4A6F 0x4A6F mentioned this pull request Feb 14, 2018
8 tasks
@Mic92
Copy link
Member

Mic92 commented Feb 15, 2018

Please also include @0x4A6F handle in this pr

@grahamc
Copy link
Member

grahamc commented Feb 15, 2018

Honestly, I think the best thing to do is just break hydra and make the change all at once. Then we can get it in and call it done. Eelco didn't seem concerned about this approach, as far as I could tell.

@vcunat
Copy link
Member

vcunat commented Feb 15, 2018

Does that mean we have to backport the schema change to 17.09? (I'm not sure how much Hydra breaks.)

@grahamc
Copy link
Member

grahamc commented Feb 15, 2018

I don't know, but I doubt it. My impression is the patch for Hydra would be pretty simple.

@Profpatsch
Copy link
Member

Would it rustle your jimmies if I reformatted the whole thing to be a uniform, extensible object?

{ foo = {
  name = "Profpatsch";
  email = "my@email.com";
  github = "Profpatsch";
  wiki = "Profpatsch";
}; }

This way there is no special-casing necessary and other fields can be added once the need arises (and tooling doesn’t have to make sense of every single field).

@FRidh
Copy link
Member Author

FRidh commented Feb 27, 2018

@Profpatsch eventually every maintainer should indeed be described by such a set, see the struct. I did not want to make this change until Hydra supports it.

Profpatsch added a commit to Profpatsch/nixpkgs that referenced this pull request Mar 4, 2018
Based on NixOS#34842, the
nix-instantiate output was pretty-printed and the validity of the github handles
manually verified, by automatically checking whether the user handles exist on
github (https://github.com/userhandle, status 200 or 404).
Each handle under 5 characters was manually checked (because the collision
probability with non-maintainer accounts is high), each missing entry was
manually researched.

The script used is kept in `maintainers/scripts` as an example of how to work
with the mainainers list through nix’ JSON interface.
Profpatsch added a commit that referenced this pull request Mar 4, 2018
Based on #34842, the
nix-instantiate output was pretty-printed and the validity of the github handles
manually verified, by automatically checking whether the user handles exist on
github (https://github.com/userhandle, status 200 or 404).
Each handle under 5 characters was manually checked (because the collision
probability with non-maintainer accounts is high), each missing entry was
manually researched.

The script used is kept in `maintainers/scripts` as an example of how to work
with the mainainers list through nix’ JSON interface.
@Profpatsch
Copy link
Member

@FRidh Graham said we should just go forward with changing to an attrset, Eelco will follow with hydra; #36119 used this PR as basis and corrected all wrong github handles.

@Profpatsch Profpatsch closed this Mar 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants