Skip to content

ci/eval/compare: ping maintainers of removed packages#438652

Merged
wolfgangwalther merged 4 commits intoNixOS:masterfrom
wolfgangwalther:ci-ping-dropped
Sep 1, 2025
Merged

ci/eval/compare: ping maintainers of removed packages#438652
wolfgangwalther merged 4 commits intoNixOS:masterfrom
wolfgangwalther:ci-ping-dropped

Conversation

@wolfgangwalther
Copy link
Contributor

This change pings maintainers of actually removed packages, aka where the package's expression is deleted.

This will not ping maintainers of packages that become invisible, because a (transitive) dependency of them is marked as insecure or broken.

Followed up by a few refactors that should work by now, some because of #426629.

Things done


Add a 👍 reaction to pull requests you find important.

This change pings maintainers of actually removed packages, aka where
the package's expression is deleted.

This will not ping maintainers of packages that become invisible,
because a (transitive) dependency of them is marked as insecure or
broken.
This should not be necessary anymore, because packages that fail to
evaluate should already be filtered out by the attrpath generation step
in main eval.
It makes no sense to check newly added attrpaths for maintainers on the
target branch - by definition these attrpaths won't exist, yet. We can
avoid falling back to `null` for these etc.
Simplification after the last step.
@nixpkgs-ci nixpkgs-ci 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. 6.topic: continuous integration Affects continuous integration (CI) in Nixpkgs, including Ofborg and GitHub Actions backport release-25.05 labels Aug 30, 2025
@wolfgangwalther wolfgangwalther marked this pull request as ready for review August 30, 2025 16:03
Copy link
Contributor

@MattSturgeon MattSturgeon left a comment

Choose a reason for hiding this comment

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

SGTM. Is it expected that we only tested prepare and not any of the pr.yml, push.yml, or merge-group.yml workflows?

@wolfgangwalther
Copy link
Contributor Author

Yes, the "Test" workflow only tests workflow files. That's because even if we ran it here, it would still use the ci/eval/compare code from the target branch in the pull_request event:

# Use the target branch to get accurate maintainer info
nix-build nixpkgs/trusted/ci --arg nixpkgs ./nixpkgs/trusted-pinned -A eval.compare \
--arg combinedDir "$(realpath ./combined)" \
--arg touchedFilesJson ./touched-files.json \
--argstr githubAuthorId "$AUTHOR_ID" \
--out-link comparison

It will always be the target branch, because that's where the maintainer info needs to come from. Thus, this kind of change can't be tested in the PR alone, it must be tested in a fork.

@nixpkgs-ci nixpkgs-ci bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Aug 30, 2025
Copy link
Member

@fabianhjr fabianhjr left a comment

Choose a reason for hiding this comment

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

Really like that it is both an devex improvement and a simplification of existing code

@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 2 This PR was reviewed and approved by two persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Aug 30, 2025
@wolfgangwalther wolfgangwalther merged commit 011f775 into NixOS:master Sep 1, 2025
36 of 38 checks passed
@wolfgangwalther wolfgangwalther deleted the ci-ping-dropped branch September 1, 2025 10:18
@nixpkgs-ci
Copy link
Contributor

nixpkgs-ci bot commented Sep 1, 2025

Successfully created backport PR for release-25.05:

@github-actions github-actions bot added the 8.has: port to stable This PR already has a backport to the stable release. label Sep 1, 2025
@wolfgangwalther
Copy link
Contributor Author

Tested in #438448, #438270, #438097, #438089 - works well.

@wolfgangwalther
Copy link
Contributor Author

Breaks in https://github.com/NixOS/nixpkgs/actions/runs/17377113706/job/49326131217, which is the staging-next PR.

Comment on lines -29 to -43
validPackageAttributes = builtins.filter (
pkg:
if (lib.attrsets.hasAttrByPath pkg.path pkgs) then
(
let
value = lib.attrsets.attrByPath pkg.path null pkgs;
in
if (builtins.tryEval value).success then
if value != null then true else builtins.trace "${pkg.name} exists but is null" false
else
builtins.trace "Failed to access ${pkg.name} even though it exists" false
)
else
builtins.trace "Failed to locate ${pkg.name}." false
) enrichedAttrs;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This part did not only filter out packages that failed to evaluate, but also null values. Need to add that part back.

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 8.has: port to stable This PR already has a backport to the stable release. 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. 12.approvals: 2 This PR was reviewed and approved by two persons.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants