DBZ-4112 Handle large comparison results from GH API
This commit is contained in:
parent
657c5540b3
commit
6a68e65200
@ -14,7 +14,6 @@ FILTERS="jenkins-jobs/scripts/config/FilteredNames.txt"
|
|||||||
mkdir -p $DIR
|
mkdir -p $DIR
|
||||||
|
|
||||||
CONTRIBUTORS_NAMES="$DIR/$2-DEBEZIUM_CONTRIBUTORS_LIST.txt"
|
CONTRIBUTORS_NAMES="$DIR/$2-DEBEZIUM_CONTRIBUTORS_LIST.txt"
|
||||||
CONTRIBUTORS_LIST_JSON="$DIR/CONTRIBUTORS.json"
|
|
||||||
CONTRIBUTORS_LIST_TXT="$DIR/DEBEZIUM_CONTRIBUTORS.txt"
|
CONTRIBUTORS_LIST_TXT="$DIR/DEBEZIUM_CONTRIBUTORS.txt"
|
||||||
CONTRIBUTORS_ALIASES="$DIR/Aliases.txt"
|
CONTRIBUTORS_ALIASES="$DIR/Aliases.txt"
|
||||||
CONTRIBUTORS_FILTERS="$DIR/FilteredNames.txt"
|
CONTRIBUTORS_FILTERS="$DIR/FilteredNames.txt"
|
||||||
@ -25,11 +24,16 @@ declare -a DEBEZIUM_REPOS=("debezium" "debezium-connector-db2" "debezium-connect
|
|||||||
|
|
||||||
for REPO in "${DEBEZIUM_REPOS[@]}";
|
for REPO in "${DEBEZIUM_REPOS[@]}";
|
||||||
do
|
do
|
||||||
curl --silent -X "GET" "https://api.github.com/repos/debezium/$REPO/compare/$1...$2" | jq '.commits[] | {name: .commit.author.name, github_url: .author.html_url}' >> "$CONTRIBUTORS_LIST_JSON"
|
page_count=$(curl --silent -I "https://api.github.com/repos/debezium/$REPO/compare/$1...$2?page=1&per_page=100" | tr "," $'\n' | grep 'rel="last"' | cut -f1 -d';' | tr "?&" $'\n' | grep -e "^page" | cut -f2 -d=)
|
||||||
|
if [[ -z $page_count ]]; then
|
||||||
|
curl --silent -X "GET" "https://api.github.com/repos/debezium/$REPO/compare/$1...$2" | jq '.commits[] | {name: .commit.author.name, github_url: .author.html_url}' | jq -r '.github_url + " " + .name' >> "$CONTRIBUTORS_NAMES"
|
||||||
|
else
|
||||||
|
for (( i = 1; i < "$((page_count + 1))"; i++ )); do
|
||||||
|
curl --silent -X "GET" "https://api.github.com/repos/debezium/$REPO/compare/$1...$2?page=$i&per_page=100" | jq '.commits[] | {name: .commit.author.name, github_url: .author.html_url}' | jq -r '.github_url + " " + .name' >> "$CONTRIBUTORS_NAMES"
|
||||||
|
done
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
jq -r '.github_url + " " + .name' $CONTRIBUTORS_LIST_JSON > $CONTRIBUTORS_NAMES
|
|
||||||
|
|
||||||
while IFS=" " read -r URL NAME;
|
while IFS=" " read -r URL NAME;
|
||||||
do
|
do
|
||||||
NAME=`echo "$NAME" | tr "/" " "`
|
NAME=`echo "$NAME" | tr "/" " "`
|
||||||
|
Loading…
Reference in New Issue
Block a user