-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[staging] merge from staging-next (#370761)
- Loading branch information
Showing
4,752 changed files
with
6,329 additions
and
5,595 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Process reviewers for a PR, reading line-separated usernames on stdin, | ||
# returning a JSON suitable to be consumed by the API endpoint to request reviews: | ||
# https://docs.github.com/en/rest/pulls/review-requests?apiVersion=2022-11-28#request-reviewers-for-a-pull-request | ||
|
||
set -euo pipefail | ||
|
||
log() { | ||
echo "$@" >&2 | ||
} | ||
|
||
if (( "$#" < 3 )); then | ||
log "Usage: $0 BASE_REPO PR_NUMBER PR_AUTHOR" | ||
exit 1 | ||
fi | ||
|
||
baseRepo=$1 | ||
prNumber=$2 | ||
prAuthor=$3 | ||
|
||
tmp=$(mktemp -d) | ||
trap 'rm -rf "$tmp"' exit | ||
|
||
declare -A users=() | ||
while read -r handle && [[ -n "$handle" ]]; do | ||
users[$handle]= | ||
done | ||
|
||
# Cannot request a review from the author | ||
if [[ -v users[${prAuthor,,}] ]]; then | ||
log "One or more files are owned by the PR author, ignoring" | ||
unset 'users[${prAuthor,,}]' | ||
fi | ||
|
||
gh api \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
"/repos/$baseRepo/pulls/$prNumber/reviews" \ | ||
--jq '.[].user.login' > "$tmp/already-reviewed-by" | ||
|
||
# And we don't want to rerequest reviews from people who already reviewed | ||
while read -r user; do | ||
if [[ -v users[${user,,}] ]]; then | ||
log "User $user is a code owner but has already left a review, ignoring" | ||
unset 'users[${user,,}]' | ||
fi | ||
done < "$tmp/already-reviewed-by" | ||
|
||
for user in "${!users[@]}"; do | ||
if ! gh api \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
"/repos/$baseRepo/collaborators/$user" >&2; then | ||
log "User $user is not a repository collaborator, probably missed the automated invite to the maintainers team (see <https://github.com/NixOS/nixpkgs/issues/234293>), ignoring" | ||
unset 'users[$user]' | ||
fi | ||
done | ||
|
||
# Turn it into a JSON for the GitHub API call to request PR reviewers | ||
jq -n \ | ||
--arg users "${!users[*]}" \ | ||
'{ | ||
reviewers: $users | split(" "), | ||
}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,46 @@ | ||
# This module defines a small NixOS configuration. It does not | ||
# contain any graphical stuff. | ||
|
||
{ config, lib, ... }: | ||
|
||
with lib; | ||
|
||
{ | ||
documentation.enable = mkDefault false; | ||
|
||
documentation.doc.enable = mkDefault false; | ||
|
||
documentation.info.enable = mkDefault false; | ||
|
||
documentation.man.enable = mkDefault false; | ||
|
||
documentation.nixos.enable = mkDefault false; | ||
|
||
# Perl is a default package. | ||
environment.defaultPackages = mkDefault [ ]; | ||
|
||
environment.stub-ld.enable = mkDefault false; | ||
|
||
# The lessopen package pulls in Perl. | ||
programs.less.lessopen = mkDefault null; | ||
lib, | ||
... | ||
}: | ||
let | ||
inherit (lib) mkDefault; | ||
in | ||
{ | ||
documentation = { | ||
enable = mkDefault false; | ||
doc.enable = mkDefault false; | ||
info.enable = mkDefault false; | ||
man.enable = mkDefault false; | ||
nixos.enable = mkDefault false; | ||
}; | ||
|
||
environment = { | ||
# Perl is a default package. | ||
defaultPackages = mkDefault [ ]; | ||
stub-ld.enable = mkDefault false; | ||
}; | ||
|
||
programs = { | ||
# The lessopen package pulls in Perl. | ||
less.lessopen = mkDefault null; | ||
command-not-found.enable = mkDefault false; | ||
}; | ||
|
||
# This pulls in nixos-containers which depends on Perl. | ||
boot.enableContainers = mkDefault false; | ||
|
||
programs.command-not-found.enable = mkDefault false; | ||
|
||
services.logrotate.enable = mkDefault false; | ||
|
||
services.udisks2.enable = mkDefault false; | ||
|
||
xdg.autostart.enable = mkDefault false; | ||
xdg.icons.enable = mkDefault false; | ||
xdg.mime.enable = mkDefault false; | ||
xdg.sounds.enable = mkDefault false; | ||
services = { | ||
logrotate.enable = mkDefault false; | ||
udisks2.enable = mkDefault false; | ||
}; | ||
|
||
xdg = { | ||
autostart.enable = mkDefault false; | ||
icons.enable = mkDefault false; | ||
mime.enable = mkDefault false; | ||
sounds.enable = mkDefault false; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.