check-meta: wrap maintainers attribute to include team members#402991
check-meta: wrap maintainers attribute to include team members#402991winterqt merged 2 commits intoNixOS:masterfrom
Conversation
|
We should remove this consumer that was added in #394797: https://github.com/NixOS/nixpkgs/blob/master/ci/eval/compare/maintainers.nix#L58 Apart from that, we can close the Repology and s.n.o. PRs, since the behavior is now compatible with both of them. |
numinit
left a comment
There was a problem hiding this comment.
Is the hasNoMaintainers predicate in check-meta now redundant, or do we still need to check both maintainers and teams?
|
I think leave it, I don't think it passes through in this state. |
I was hoping this workaround would be temporary, until all consumers of meta.maintainers adopt the new teams attribute. |
|
That's what I was thinking as well. |
|
OK. Regardless we should just make sure that we don't duplicate pings, because it will (in the current state). Long term I definitely agree with s.n.o listing teams. However, I don't think Repology much cares. The maintainers attribute is an external API contract that we have effectively created with them to display maintainers, so "maintainers are just inclusive of members of all teams" is the way to avoid breaking it. And we should generally try to avoid breaking external API contracts. Speaking of which, we may want to also deduplicate maintainers in the eval in case someone is on more than one team maintaining something. |
|
We could wrap everything with |
|
Fair point. It is likely not necessary since that is a N^2. (I think what we can easily dedup is more important anyway, like the eval script, since currently I think it's adding teams to maintainers which already take the teams into account?) |
I think this still applies. At present it'd be concatenating maintainers (which are inclusive of teams) with all the teams. |
|
It's been a week. I'm not getting repology notifications for a number of packages any more. This is breaking my workflow. I think I've been patient, when you decided against a revert and for inheriting team members into maintainer. Frankly, this is how it should've been from the start. But can we please get on with this? |
This is a work-around that resolves the issues that spawned from NixOS#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 NixOS#394797. Signed-off-by: Fernando Rodrigues <alpha@sigmasquadron.net>
We need to pass through the maintainers and teams positions from the original meta so pings work correctly, since check-meta clobbers the original attribute positions in them. Tested with `maintainers/scripts/get-maintainer-pings-between.sh` on a handful of major packages maintained by both individuals and teams.
|
Did some prodding at it tonight to make sure this does not break anything that depends on it (notably, maintainer pings). Also added a comment asking to please not break this again since it is an external API and Repology depends on it. |
| maintainers = | ||
| attrs.meta.maintainers or [ ] | ||
| ++ concatMap (team: team.members or [ ]) attrs.meta.teams or [ ]; |
There was a problem hiding this comment.
Maybe add this? Unsure if it's common enough to be worth the complexity, though... probably not.
| maintainers = | |
| attrs.meta.maintainers or [ ] | |
| ++ concatMap (team: team.members or [ ]) attrs.meta.teams or [ ]; | |
| maintainers = | |
| lib.unique (attrs.meta.maintainers or [ ] | |
| ++ concatMap (team: team.members or [ ]) attrs.meta.teams or [ ]); |
There was a problem hiding this comment.
I saw it come up in a couple of the places I tried. Another idea is a listToAttrs, but that'll probably be slightly heavier on memory since we'll just throw out the attrset anyway. May be worth a shot, though, since it's not N^2 at least?
There was a problem hiding this comment.
I mean, we could always just punt it back onto the consumer -- we already had this potential duplication pre-meta.teams, so it wouldn't be a change, just a nicety.
There was a problem hiding this comment.
I noticed that this change introduced duplication in the qgis package: team.members seem to be first added to qgis.unwrapped and then again in the main derivation because qgis inherits its meta.
There was a problem hiding this comment.
Now that Nix has tracing support, it'll be interesting to use it to test dedup while computing meta. It's what I was mostly missing here.
| ((drv.meta or { }).maintainersPosition or null) | ||
| ((drv.meta or { }).teamsPosition or null) |
There was a problem hiding this comment.
Why not
| ((drv.meta or { }).maintainersPosition or null) | |
| ((drv.meta or { }).teamsPosition or null) | |
| (builtins.unsafeGetAttrPos "maintainers" (drv.meta or { })) | |
| (builtins.unsafeGetAttrPos "teams" (drv.meta or { })) |
? Ideally we wouldn't add (slight!) extra eval overhead just for CI scripts (which AFAIU check-meta will do).
There was a problem hiding this comment.
The new maintainers attribute was actually clobbering the original one's position, so it would return check-meta.nix every time rather than the real declaring file. I needed a way to pull the location of the original maintainers (pre-teams concatenation) out of there, and just did the same with teams. If it's written this way, it'll return a position pointing to check-meta.nix.
check-meta.nix is a little counterintuitive, but it's a bunch of // attrset updates that both prefers certain things in the meta and overrides other things in it. Maintainers is written as one of the overrides so I made sure we're holding onto the original.
|
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-402991-to-release-24.11 origin/release-24.11
cd .worktree/backport-402991-to-release-24.11
git switch --create backport-402991-to-release-24.11
git cherry-pick -x d807892d1f42210129f9fc18f81e5f828150cf4d 92bd743239823dc7c80572539528398f722a9278 |
|
(Why remove from the stdenv board?) Also, I didn't know we backported this change to 24.11. oof. |
|
I removed it from Stdenv and CUDA because this isn't part of their projects. The projects are added automatically if we touch certain files during treewides. We also didn't backport this; it was another mishap caused by changing files in the |
|
Makes sense. Ah, right, forgot about that. Sorry! |
|
Thanks for the work and the merge, y'all. |
The idea for the automated backport label whenever you touch Thus, I opened #405159 to do just that. |
This is a work-around that resolves the issues that spawned from #400458 by adding the team members from teams declared in
meta.teamstometa.maintainers, effectively restoring the original behaviour of themaintainersattribute, and thus allowing downstreams to keep consumingmeta.maintainerswithout any extra changes to supportmeta.teams.Follow-up to #394797.
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.