Skip to content

Commit

Permalink
workflows/eval: Use maintainer GitHub IDs for review requests of chan…
Browse files Browse the repository at this point in the history
…ged packages

The handles can change over time and there's nothing guaranteeing the
ones in the maintainer list are up-to-date. In comparison GitHub IDs
never change.
  • Loading branch information
infinisil committed Dec 18, 2024
1 parent b9d800d commit b844cba
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/eval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,18 @@ jobs:
-f "labels[]=$toAdd"
done < <(comm -13 before after)
# maintainers.json contains GitHub IDs. Look up handles to request reviews from.
# There appears to be no API to request reviews based on GitHub IDs
jq -r 'keys[]' comparison/maintainers.json \
| while read -r id; do gh api /user/"$id"; done \
| jq -s '{ reviewers: map(.login) }' \
> reviewers.json
# Request reviewers from maintainers of changed output paths
GH_TOKEN=${{ steps.app-token.outputs.token }} gh api \
--method POST \
/repos/${{ github.repository }}/pulls/${{ github.event.number }}/requested_reviewers \
--input <(jq '{ reviewers: keys }' comparison/maintainers.json)
--input reviewers.json
env:
GH_TOKEN: ${{ github.token }}
Expand Down
6 changes: 3 additions & 3 deletions ci/eval/compare/maintainers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ let
builtins.map (
pkg:
builtins.map (maintainer: {
handle = lib.toLower maintainer.github;
id = maintainer.githubId;
packageName = pkg.name;
dueToFiles = pkg.filenames;
}) pkg.maintainers
Expand All @@ -103,9 +103,9 @@ let
ping: collector:
collector
// {
"${ping.handle}" = [
"${toString ping.id}" = [
{ inherit (ping) packageName dueToFiles; }
] ++ (collector."${ping.handle}" or [ ]);
] ++ (collector."${toString ping.id}" or [ ]);
}
) { } listToPing;

Expand Down

0 comments on commit b844cba

Please sign in to comment.