Skip to content

Commit 1ffd3d5

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents 2e6e135 + dfee164 commit 1ffd3d5

File tree

2 files changed

+7
-19
lines changed

2 files changed

+7
-19
lines changed

.github/scripts/hermetic_library_generation.sh

+5-17
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
#!/bin/bash
22
set -e
33
# This script should be run at the root of the repository.
4-
# This script is used to, when a pull request changes the generation
5-
# configuration (generation_config.yaml by default):
6-
# 1. Find whether the last commit in this pull request contains changes to
7-
# the generation configuration and exit early if it doesn't have such a change
8-
# since the generation result would be the same.
9-
# 2. Compare generation configurations in the current branch (with which the
4+
# This script is used to, when a pull request changes any file in the repo:
5+
# 1. Compare generation configurations in the current branch (with which the
106
# pull request associated) and target branch (into which the pull request is
117
# merged);
12-
# 3. Generate changed libraries using library_generation image;
13-
# 4. Commit the changes to the pull request, if any.
14-
# 5. Edit the PR body with generated pull request description, if applicable.
8+
# 2. Generate changed libraries using library_generation image;
9+
# 3. Commit the changes to the pull request, if any.
10+
# 4. Edit the PR body with generated pull request description, if applicable.
1511

1612
# The following commands need to be installed before running the script:
1713
# 1. git
@@ -67,13 +63,6 @@ message="chore: generate libraries at $(date)"
6763

6864
git checkout "${target_branch}"
6965
git checkout "${current_branch}"
70-
# if the last commit doesn't contain changes to generation configuration,
71-
# do not generate again as the result will be the same.
72-
change_of_last_commit="$(git diff-tree --no-commit-id --name-only HEAD~1..HEAD -r)"
73-
if [[ ! ("${change_of_last_commit}" == *"${generation_config}"*) ]]; then
74-
echo "The last commit doesn't contain any changes to the generation_config.yaml, skipping the whole generation process." || true
75-
exit 0
76-
fi
7766
# copy generation configuration from target branch to current branch.
7867
git show "${target_branch}":"${generation_config}" > "${baseline_generation_config}"
7968
config_diff=$(diff "${generation_config}" "${baseline_generation_config}" || true)
@@ -87,7 +76,6 @@ docker run \
8776
-u "$(id -u):$(id -g)" \
8877
-v "$(pwd):${workspace_name}" \
8978
gcr.io/cloud-devrel-public-resources/java-library-generation:"${image_tag}" \
90-
--baseline-generation-config-path="${workspace_name}/${baseline_generation_config}" \
9179
--current-generation-config-path="${workspace_name}/${generation_config}"
9280

9381

generation_config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
gapic_generator_version: 2.42.0
2-
googleapis_commitish: 19577edb4d439db98d2fb1f6f48f2e1b29fba099
3-
libraries_bom_version: 26.43.0
2+
googleapis_commitish: 6f289d775912966eb0cf04bda91e5e355c998d30
3+
libraries_bom_version: 26.38.0
44
libraries:
55
- api_shortname: spanner
66
name_pretty: Cloud Spanner

0 commit comments

Comments
 (0)