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

maintainers: prefix number with underscore #95553

Merged
merged 4 commits into from Aug 18, 2020
Merged

maintainers: prefix number with underscore #95553

merged 4 commits into from Aug 18, 2020

Conversation

zowoq
Copy link
Contributor

@zowoq zowoq commented Aug 16, 2020

This is the same pattern that is already used for packages, I think it makes sense to reuse it here.

_0x0 = callPackage ../tools/misc/0x0 { };
_3llo = callPackage ../tools/misc/3llo { };
_3mux = callPackage ../tools/misc/3mux { };
_1password = callPackage ../applications/misc/1password { };
_1password-gui = callPackage ../tools/security/1password-gui {
electron = electron_9;
};
_6tunnel = callPackage ../tools/networking/6tunnel { };
_9pfs = callPackage ../tools/filesystems/9pfs { };

GitHub doesn't allow usernames with underscores so these won't collide with another user.

Copy link
Member

@samueldr samueldr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is necessary. Though, other Nixpkgs maintainers can agree or disagree, and my judgement shouldn't be a blocker.

The reason it is required for packages is that on the command-line, --attr can't work with leading numbers:

~/tmp/nixpkgs/nixpkgs 1 $ nix-build -A 0x0
error: syntax error, unexpected INT, at /Users/samuel/tmp/nixpkgs/nixpkgs/pkgs/top-level/all-packages.nix:531:3

(You can modify all-packages.nix to provide a 0x0 if you want, but the result is the same if it isn't there.)

I don't think we're expected to interact with maintainers using --attr; at the time we will, this could be re-considered. After all, this is a relatively minor mechanical change, so hopefully this is a triviality.

In addition, handle is not forcibly the same as a GitHub alias. It is possible a user uses Nixpkgs without a GitHub account, even contributes without a GitHub account (yes, technically things are in place for that), and has a prefixed underscore for their handle. In that instance it becomes a bit annoying :) Though we're erring in the world of aggravating edge cases, so don't mind that last point too much.

@samueldr samueldr dismissed their stale review August 16, 2020 03:24

Should have read the other discussion

@samueldr
Copy link
Member

Sorry, now I see why this is relevant. And this is using an existing precedent.

@jonringer
Copy link
Contributor

cc @0x4A6F @1000101

@mmahut
Copy link
Member

mmahut commented Aug 16, 2020

Oh, not this again, I feel like I spend hours on discussing this trivial case. I don't think
this is a solution, unless it is agreed as a standard (which is in packages names, because there is a real
technical reason for this, not that someone is not paying and testing their changes introducing introduces a bug).

But if feel like this is a trip wire, let's create a meta data check in ofborg, that will be beneficial in the future as well.

@zowoq
Copy link
Contributor Author

zowoq commented Aug 16, 2020

let's create a meta data check in ofborg

Not exactly easy to actually get it done and we might end up moving some checks away from ofborg anyway.

Copy link
Member

@1000101 1000101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine by me. It's been fun, but became very tiring eventually. It pisses off too many people and since there is no simple solution, it's not worth arguing over.

Let's change it and, ideally, document the need for an underscore somewhere - maybe here?

@FRidh
Copy link
Member

FRidh commented Aug 17, 2020

I suggest also mapping over the keys and asserting none start with a number.

Copy link
Member

@0x4A6F 0x4A6F left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the common pattern with maintainers; [ _0x4A6F ];.

@zowoq
Copy link
Contributor Author

zowoq commented Aug 17, 2020

I suggest also mapping over the keys and asserting none start with a number.

Can you elaborate please?

@jonringer
Copy link
Contributor

jonringer commented Aug 17, 2020

I'm assuming having CI do something to the effect of:

  lib.mapAttrs (name: value:  assert (builtins.match "^([0-9]).*") name == null; value) lib.maintainers

where there's a check that a new maintainer doesn't start with a number.

@zowoq
Copy link
Contributor Author

zowoq commented Aug 17, 2020

I don't think adding it to ofborg is a productive use of time as there has been some discussions about moving things away from ofborg. Bus factor is also an issue so I don't want to add more things there anyway.

I don't want to add it as a check that runs on hydra as that depends on someone noticing and caring about it enough to unbreak it, I think we have enough things already that we don't know are broken until after a PR is merged (e.g. the manuals).

I'm happy to implement this and other maintainer checks (e.g. check github has a matching githubId) via an action that actually catches the errors before merge, when we can actually use actions.

@jonringer
Copy link
Contributor

jonringer commented Aug 18, 2020

I'm happy to implement this and other maintainer checks (e.g. check github has a matching githubId) via an action that actually catches the errors before merge, when we can actually use actions.

I think this would be easy enough to implement as a github action. But I'm not sure what we want to do as a community.

@zowoq
Copy link
Contributor Author

zowoq commented Aug 18, 2020

Just to be clear about the current status of actions: we can't use them at the moment.

We were using two actions but they were removed because they caused too much disruption. We're now waiting for a couple of things to be resolved before we try them again, I don't really have a timeframe for when that will happen.

I'd want to have those actions running for a couple of weeks without causing any problems before we start adding more.

I see this PR as a slight improvement over the status quo even without a way of enforcing it, I don't think having a check should be a blocker.

@FRidh
Copy link
Member

FRidh commented Aug 18, 2020

I am not suggesting an explicit test, but having the map @jonringer wrote directly in the maintainers file. Eval errors are noticed.

@jonringer
Copy link
Contributor

how did you want to expose this? doing the evaluation on just lib.maintainers would mean evaluating all 1000+ entries any time you want to access a given maintainer. Something like lib.maintainers._verifyNames? Couldn't think of any good names

@FRidh
Copy link
Member

FRidh commented Aug 18, 2020

Actually, lib/tests/release.nix is already executed by ofborg and that includes lib/tests/maintainers.nix. That will be cheaper than directly in maintainer-list.nix.

@zowoq
Copy link
Contributor Author

zowoq commented Aug 18, 2020

Sorry but I'm not going to implement what has been requested.

Should I close this PR?

@jonringer
Copy link
Contributor

I think the PR is fine as is.

The check can happen in a different PR

@1000101
Copy link
Member

1000101 commented Aug 18, 2020

Sorry but I'm not going to implement what has been requested.

Should I close this PR?

Don't you dare! 😄

@FRidh FRidh merged commit fe7bab3 into NixOS:master Aug 18, 2020
@zowoq zowoq deleted the rename-maintainers branch August 18, 2020 09:52
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

8 participants