Skip to content

Commit

Permalink
chore: update codegen to use single googleapis commitish. (#2726)
Browse files Browse the repository at this point in the history
First step to solve #2722.
This should be the minimum set of changes to unblock release with hermetic build changes.
Further cleanup are needed to simplify this workflow. Will raise separate pr.
  • Loading branch information
zhumin8 authored Mar 26, 2024
1 parent 75230b2 commit 7dfb4de
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions spring-cloud-generator/scripts/generate-library-list.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ git clone https://github.com/googleapis/google-cloud-java.git
cd ./google-cloud-java
git checkout $commitish

# read googleapis committish used in hermetic build
googleapis_committish=$(yq -r ".googleapis_commitish" generation_config.yaml)
echo "googleapis_committish: ${googleapis_committish}"

cd ${SPRING_GENERATOR_DIR}
# start file, always override is present
filename=${SPRING_GENERATOR_DIR}/scripts/resources/library_list.txt
Expand Down Expand Up @@ -76,12 +80,6 @@ for d in ./google-cloud-java/*java-*/; do
version_number=$(echo $version_folder | sed 's#.*/##')
googleapis_folder="$googleapis_path/$version_number"

# get commitish from git log
# criteria: changes happen before tag, touches path, and with changes in googleapis/googleapis
cd $d || { echo "Failed to get into directory $d"; exit 1; }
googleapis_committish=$(git log $commitish -- "$version_folder" | grep -m 1 'Source-Link:.*googleapis/googleapis.*' | sed 's#^.*/commit/##')
cd ~- || { echo "Failed to get back to previous directory"; exit 1; }

echo "$api_shortname, $googleapis_folder, $distribution_name, $googleapis_committish, $monorepo_folder" >> $filename
count=$((count+1))
done
Expand Down

0 comments on commit 7dfb4de

Please sign in to comment.