Skip to content

Commit b844cba

Browse files
committed
workflows/eval: Use maintainer GitHub IDs for review requests of changed 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.
1 parent b9d800d commit b844cba

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

.github/workflows/eval.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,11 +267,18 @@ jobs:
267267
-f "labels[]=$toAdd"
268268
done < <(comm -13 before after)
269269
270+
# maintainers.json contains GitHub IDs. Look up handles to request reviews from.
271+
# There appears to be no API to request reviews based on GitHub IDs
272+
jq -r 'keys[]' comparison/maintainers.json \
273+
| while read -r id; do gh api /user/"$id"; done \
274+
| jq -s '{ reviewers: map(.login) }' \
275+
> reviewers.json
276+
270277
# Request reviewers from maintainers of changed output paths
271278
GH_TOKEN=${{ steps.app-token.outputs.token }} gh api \
272279
--method POST \
273280
/repos/${{ github.repository }}/pulls/${{ github.event.number }}/requested_reviewers \
274-
--input <(jq '{ reviewers: keys }' comparison/maintainers.json)
281+
--input reviewers.json
275282
276283
env:
277284
GH_TOKEN: ${{ github.token }}

ci/eval/compare/maintainers.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ let
9292
builtins.map (
9393
pkg:
9494
builtins.map (maintainer: {
95-
handle = lib.toLower maintainer.github;
95+
id = maintainer.githubId;
9696
packageName = pkg.name;
9797
dueToFiles = pkg.filenames;
9898
}) pkg.maintainers
@@ -103,9 +103,9 @@ let
103103
ping: collector:
104104
collector
105105
// {
106-
"${ping.handle}" = [
106+
"${toString ping.id}" = [
107107
{ inherit (ping) packageName dueToFiles; }
108-
] ++ (collector."${ping.handle}" or [ ]);
108+
] ++ (collector."${toString ping.id}" or [ ]);
109109
}
110110
) { } listToPing;
111111

0 commit comments

Comments
 (0)