Skip to content

check-meta: add a teams attribute#394797

Merged
RossComputerGuy merged 5 commits intoNixOS:masterfrom
RossComputerGuy:feat/meta-teams
Apr 20, 2025
Merged

check-meta: add a teams attribute#394797
RossComputerGuy merged 5 commits intoNixOS:masterfrom
RossComputerGuy:feat/meta-teams

Conversation

@RossComputerGuy
Copy link
Member

Things done

This is something I've had in mind for some time. It'd be great for meta to be aware of teams so if a package is only owned by a team or set of teams, the maintainers could be pulled from the members list of each team. This could go onto the package search and make it possible to see which team owns a package.

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added the 6.topic: stdenv Standard environment label Mar 31, 2025
@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Mar 31, 2025
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Apr 2, 2025
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Apr 3, 2025
@SigmaSquadron

This comment was marked as outdated.

Copy link
Contributor

@SigmaSquadron SigmaSquadron left a comment

Choose a reason for hiding this comment

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

Nevermind, I did miss something obvious, sorry! This seems like a good change. I'm wondering if we can also add the members of a team to meta.maintainers automatically so team-maintained packages don't appear as unmaintained to consumers of meta.maintainers in a follow-up PR.

@RossComputerGuy
Copy link
Member Author

That's all good heh. Yeah, this is going to be rolled out slowly. Once this lands, there'll be communication to the consumers of meta.maintainers to look into using it. I believe we already have that done via hasNoMaintainers covering teams (visible in the diff of this PR).

@github-actions github-actions bot added the 8.has: documentation This PR adds or changes documentation label Apr 6, 2025
@github-actions github-actions bot added 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Apr 6, 2025
@RossComputerGuy RossComputerGuy moved this to In Progress in Stdenv Apr 6, 2025
@RossComputerGuy
Copy link
Member Author

Do note that due to GitHub limitations, a good chunk of the codeowners unfortunately were not pinged, and as such really can't be blamed for missing it.

That is more of with #400458 rather than this PR. I did mention this PR several times in the NixOS Stdenv Matrix chat, though nobody objected to it. I did see that over 14 people saw it on that chat several days before this merged so it's not like this was going to happen without prior knowledge.

@winterqt
Copy link
Member

winterqt commented Apr 30, 2025

It applies to @mweinelt specifically, though, as ci/ is owned by the security team, and this PR touched that directory.

@RossComputerGuy
Copy link
Member Author

Huh, though the bot could've pinged 5 more people right? There's a cap of 15 reviewers, at least through the web UI, and there was 10 people in total pinged. At least philiptaron was pinged so that brings down the number of people who needed to be pinged. Not sure why touching ci/eval didn't ping more people though.

@numinit
Copy link
Contributor

numinit commented Apr 30, 2025

@winterqt That is a good point, and strange that didn't happen. I'd have thought codeowner pings would have handled it, but alas. ci is listed in the owners file, so I was under the assumption that the right people had been pinged. ☹️

That aside, I am up for doing whatever we think is best as a project. This change was meant to reduce boilerplate and ultimately ping @NixOS/* down the line. If we didn't pull in the right people, well, we should just make sure everyone is aware next time.

@RossComputerGuy
Copy link
Member Author

I did notice a PR that also should've pinged codeowners, #400408, but it didn't. Not sure what happened there, but it looks like maybe the ping bot or GitHub itself is flaky with pings?

@numinit
Copy link
Contributor

numinit commented Apr 30, 2025

I think I may have figured it out: see OWNERS and the docs. It's subtle: ci was listed without a trailing slash, so it doesn't apply recursively. @NixOS/stdenv was pinged since /pkgs/stdenv/generic/check-meta.nix was touched, that's why @philiptaron got pinged, but changing something in a subdirectory of ci didn't ping the people on the list for ci.

In this example, @doctocat owns any files in the build/logs directory at the root of the repository and any of its subdirectories.

Note the difference between this and:

In this example, @octocat owns any file in a /logs directory such as /build/logs, /scripts/logs, and /deeply/nested/logs.

So it may be a matter of adding a trailing / or a /**.

winterqt pushed a commit that referenced this pull request May 7, 2025
This is a work-around that resolves the issues that spawned from #400458 by adding the team members from teams declared in `meta.teams` to `meta.maintainers`, effectively restoring the original behaviour of the `maintainers` attribute, and thus allowing downstreams to keep consuming `meta.maintainers` without any extra changes to support `meta.teams`.

Follow-up to #394797.

Signed-off-by: Fernando Rodrigues <[email protected]>
@wolfgangwalther
Copy link
Contributor

So it may be a matter of adding a trailing / or a /**.

No, that's unrelated. The codeowners file works as expected.

The reason is, because changes to this PR were added incrementally. In the beginning, not so many files were touched, yet, so the codeowners ping worked. After a while, there were too many codeowners to ping, thus the last run of CodeOwners / Request has this output:

Too many reviewers (hsjobeki ericson2314 philiptaron emilazy getpsyched risicle lesuisse reckenrode fricklerhandwerk mweinelt wolfgangwalther artturin infinisil), skipping review requests

The limit is set to 10 btw. - this limit is not a hard limit by GitHub, but one imposed by us. The idea is that once you touch as many files, it doesn't make sense to ping a ton of code owners, but the authors should explicitly select their reviewers instead.

It's unfortunate that the "request code owner reviews" job is still showing "green / succeed" in the checklist in this case. We had it failing before, but it was changed to succeed in #375354. Neither is perfect. Ideally, we'd have a "skipped" appearance, but that's not easily possible - I tried, but failed, so far.

If it were up to me these changes would be reverted in full pending further work and sufficient discussion and review.

Supportive of reverting this before branch-off.

What's the state here, will this be kept or reverted?

@wolfgangwalther wolfgangwalther requested review from a team and infinisil May 8, 2025 07:44
@wolfgangwalther
Copy link
Contributor

For completeness-sake, I now pinged the code owners of /ci manually. I wasn't aware of this PR until I diffed stable and unstable on the ci/ folder and came up surprised for a difference.

winterqt added a commit to winterqt/nixpkgs that referenced this pull request May 8, 2025
See [0] for context. Before this change, @NixOS/Security et al. would
only get pinged if a change was done one level deep in the `ci`
subdirectory, but adding a trailing `/` should make it recursive [1] [2].

[0]: NixOS#394797 (comment)
[1]: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#codeowners-syntax
[2]: NixOS#394797 (comment)
@winterqt winterqt mentioned this pull request May 8, 2025
13 tasks
@winterqt
Copy link
Member

winterqt commented May 8, 2025

Oh, what lovely timing. lol.

What's the state here, will this be kept or reverted?

See #402991, the change is effectively unnoticeable now, as meta.maintainers now contains meta.teams entries.

@wolfgangwalther
Copy link
Contributor

It seems this broke more, see #412184.

@SigmaSquadron
Copy link
Contributor

Seems like that check was already broken, and this simply brought it to light by making the check more explicitly broken.

@LordGrimmauld
Copy link
Contributor

Seems like that check was already broken, and this simply brought it to light by making the check more explicitly broken.

The check wasn't super broken. The check only listed things as unmaintained if explicit maintainers = [] was set, with the intention of not flagging trivial builders or fixed output derivations. Arguably packages with no meta.maintainers set should have been reported as unmaintained - but objectively the correct thing to do here would have been to try and restore as close to old behavior as possible, which would have been:

  (attrs ? meta.maintainers || attrs ? meta.teams) && (attrs.meta.maintainers or [] == []) && (attrs.meta.teams or [] == [])

bacchanalia added a commit to awakesecurity/nixpkgs that referenced this pull request Jul 1, 2025
…w meta.teams attribute

Follow-up to NixOS#394797.

Signed-off-by: Fernando Rodrigues <[email protected]>

partial cherry-pick of 05580f4
bacchanalia added a commit to awakesecurity/nixpkgs that referenced this pull request Jul 2, 2025
…to the new meta.teams attribute

Follow-up to NixOS#394797.

Signed-off-by: Fernando Rodrigues <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: continuous integration Affects continuous integration (CI) in Nixpkgs, including Ofborg and GitHub Actions 6.topic: stdenv Standard environment 8.has: documentation This PR adds or changes documentation 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.