Skip to content

Commit 111d68f

Browse files
committed
Resolve merge conficts from main
2 parents f2c7c29 + 28f5d27 commit 111d68f

File tree

186 files changed

+587
-468
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

186 files changed

+587
-468
lines changed

.cloudbuild/samples_build.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
steps:
2-
- name: gcr.io/cloud-devrel-public-resources/java8
2+
- name: gcr.io/cloud-devrel-public-resources/java11
33
entrypoint: ls
44
args: [
55
'-alt',
66
]
7-
- name: gcr.io/cloud-devrel-public-resources/java8
7+
- name: gcr.io/cloud-devrel-public-resources/java11
88
entrypoint: curl
99
args: [
1010
'--header',
1111
'Metadata-Flavor: Google',
1212
'http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/email'
1313
]
14-
- name: gcr.io/cloud-devrel-public-resources/java8
14+
- name: gcr.io/cloud-devrel-public-resources/java11
1515
entrypoint: pwd
16-
- name: gcr.io/cloud-devrel-public-resources/java8
16+
- name: gcr.io/cloud-devrel-public-resources/java11
1717
entrypoint: bash
1818
args: [
1919
'.kokoro/build.sh'
@@ -22,7 +22,7 @@ steps:
2222
- 'JOB_TYPE=samples'
2323
- 'GOOGLE_CLOUD_PROJECT=cloud-java-ci-sample'
2424
- 'KOKORO_GITHUB_PULL_REQUEST_NUMBER=$_PR_NUMBER'
25-
- name: gcr.io/cloud-devrel-public-resources/java8
25+
- name: gcr.io/cloud-devrel-public-resources/java11
2626
entrypoint: echo
2727
args: [
2828
'Sample job succeeded',

.github/dependabot.yml

+13-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,16 @@ updates:
1717
# If a security vulnerability comes in, we will be notified about
1818
# it via template in the synthtool repository.
1919
ignore:
20-
- dependency-name: "*"
20+
- dependency-name: "*"
21+
- dependency-name: "*"
22+
23+
# rules for the `grpc-experimental` branch
24+
- package-ecosystem: maven
25+
directory: "/"
26+
schedule:
27+
interval: daily
28+
commit-message:
29+
# Prefix all commit messages with "deps: "
30+
prefix: "deps"
31+
open-pull-requests-limit: 10
32+
target-branch: "grpc-experimental"

.github/scripts/update_generation_config.sh

+55-8
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,23 @@ function update_config() {
2828
sed -i -e "s/^${key_word}.*$/${key_word}: ${new_value}/" "${file}"
2929
}
3030

31+
# Update an action to a new version in GitHub action.
32+
function update_action() {
33+
local key_word=$1
34+
local new_value=$2
35+
local file=$3
36+
echo "Update ${key_word} to ${new_value} in ${file}"
37+
# use a different delimiter because the key_word contains "/".
38+
sed -i -e "s|${key_word}@v.*$|${key_word}@v${new_value}|" "${file}"
39+
}
40+
3141
# The parameters of this script is:
3242
# 1. base_branch, the base branch of the result pull request.
3343
# 2. repo, organization/repo-name, e.g., googleapis/google-cloud-java
3444
# 3. [optional] generation_config, the path to the generation configuration,
3545
# the default value is generation_config.yaml in the repository root.
46+
# 4. [optional] workflow, the library generation workflow file,
47+
# the default value is .github/workflows/hermetic_library_generation.yaml.
3648
while [[ $# -gt 0 ]]; do
3749
key="$1"
3850
case "${key}" in
@@ -48,6 +60,10 @@ case "${key}" in
4860
generation_config="$2"
4961
shift
5062
;;
63+
--workflow)
64+
workflow="$2"
65+
shift
66+
;;
5167
*)
5268
echo "Invalid option: [$1]"
5369
exit 1
@@ -71,21 +87,34 @@ if [ -z "${generation_config}" ]; then
7187
echo "Use default generation config: ${generation_config}"
7288
fi
7389

90+
if [ -z "${workflow}" ]; then
91+
workflow=".github/workflows/hermetic_library_generation.yaml"
92+
echo "Use default library generation workflow file: ${workflow}"
93+
fi
94+
7495
current_branch="generate-libraries-${base_branch}"
7596
title="chore: Update generation configuration at $(date)"
7697

77-
# try to find a open pull request associated with the branch
98+
git checkout "${base_branch}"
99+
# Try to find a open pull request associated with the branch
78100
pr_num=$(gh pr list -s open -H "${current_branch}" -q . --json number | jq ".[] | .number")
79-
# create a branch if there's no open pull request associated with the
101+
# Create a branch if there's no open pull request associated with the
80102
# branch; otherwise checkout the pull request.
81103
if [ -z "${pr_num}" ]; then
82104
git checkout -b "${current_branch}"
105+
# Push the current branch to remote so that we can
106+
# compare the commits later.
107+
git push -u origin "${current_branch}"
83108
else
84109
gh pr checkout "${pr_num}"
85110
fi
86111

112+
# Only allow fast-forward merging; exit with non-zero result if there's merging
113+
# conflict.
114+
git merge -m "chore: merge ${base_branch} into ${current_branch}" "${base_branch}"
115+
87116
mkdir tmp-googleapis
88-
# use partial clone because only commit history is needed.
117+
# Use partial clone because only commit history is needed.
89118
git clone --filter=blob:none https://github.com/googleapis/googleapis.git tmp-googleapis
90119
pushd tmp-googleapis
91120
git pull
@@ -94,25 +123,43 @@ popd
94123
rm -rf tmp-googleapis
95124
update_config "googleapis_commitish" "${latest_commit}" "${generation_config}"
96125

97-
# update gapic-generator-java version to the latest
126+
# Update gapic-generator-java version to the latest
98127
latest_version=$(get_latest_released_version "com.google.api" "gapic-generator-java")
99128
update_config "gapic_generator_version" "${latest_version}" "${generation_config}"
100129

101-
# update libraries-bom version to the latest
130+
# Update composite action version to latest gapic-generator-java version
131+
update_action "googleapis/sdk-platform-java/.github/scripts" \
132+
"${latest_version}" \
133+
"${workflow}"
134+
135+
# Update libraries-bom version to the latest
102136
latest_version=$(get_latest_released_version "com.google.cloud" "libraries-bom")
103137
update_config "libraries_bom_version" "${latest_version}" "${generation_config}"
104138

105-
git add "${generation_config}"
139+
git add "${generation_config}" "${workflow}"
106140
changed_files=$(git diff --cached --name-only)
107141
if [[ "${changed_files}" == "" ]]; then
108142
echo "The latest generation config is not changed."
109143
echo "Skip committing to the pull request."
144+
else
145+
git commit -m "${title}"
146+
fi
147+
148+
# There are potentially at most two commits: merge commit and change commit.
149+
# We want to exit the script if no commit happens (otherwise this will be an
150+
# infinite loop).
151+
# `git cherry` is a way to find whether the local branch has commits that are
152+
# not in the remote branch.
153+
# If we find any such commit, push them to remote branch.
154+
unpushed_commit=$(git cherry -v "origin/${current_branch}" | wc -l)
155+
if [[ "${unpushed_commit}" -eq 0 ]]; then
156+
echo "No unpushed commits, exit"
110157
exit 0
111158
fi
112-
git commit -m "${title}"
159+
113160
if [ -z "${pr_num}" ]; then
114161
git remote add remote_repo https://cloud-java-bot:"${GH_TOKEN}@github.com/${repo}.git"
115-
git fetch -q --unshallow remote_repo
162+
git fetch -q remote_repo
116163
git push -f remote_repo "${current_branch}"
117164
gh pr create --title "${title}" --head "${current_branch}" --body "${title}" --base "${base_branch}"
118165
else

.github/sync-repo-settings.yaml

+13-13
Original file line numberDiff line numberDiff line change
@@ -109,22 +109,23 @@ branchProtectionRules:
109109
- cla/google
110110
- 'Kokoro - Test: Java GraalVM Native Image'
111111
- 'Kokoro - Test: Java 17 GraalVM Native Image'
112-
- pattern: 2.15.x
112+
- pattern: grpc-experimental
113113
isAdminEnforced: true
114114
requiredApprovingReviewCount: 1
115115
requiresCodeOwnerReviews: true
116116
requiresStrictStatusChecks: false
117117
requiredStatusCheckContexts:
118-
- dependencies (17)
119-
- lint
120-
- clirr
121-
- units (8)
122-
- units (11)
123-
- 'Kokoro - Test: Integration'
124-
- cla/google
125-
- 'Kokoro - Test: Java GraalVM Native Image'
126-
- 'Kokoro - Test: Java 17 GraalVM Native Image'
127-
- pattern: 2.17.x
118+
- dependencies (17)
119+
- lint
120+
- clirr
121+
- units (8)
122+
- units (11)
123+
- 'Kokoro - Test: Integration'
124+
- cla/google
125+
- 'Kokoro - Test: Java GraalVM Native Image'
126+
- 'Kokoro - Test: Java 17 GraalVM Native Image'
127+
- javadoc
128+
- pattern: 2.15.x
128129
isAdminEnforced: true
129130
requiredApprovingReviewCount: 1
130131
requiresCodeOwnerReviews: true
@@ -139,8 +140,7 @@ branchProtectionRules:
139140
- cla/google
140141
- 'Kokoro - Test: Java GraalVM Native Image'
141142
- 'Kokoro - Test: Java 17 GraalVM Native Image'
142-
- javadoc
143-
- pattern: grpc-experimental
143+
- pattern: 2.17.x
144144
isAdminEnforced: true
145145
requiredApprovingReviewCount: 1
146146
requiresCodeOwnerReviews: true

.github/workflows/ci.yaml

+9-1
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,23 @@ jobs:
5959
env:
6060
JOB_TYPE: test
6161
windows:
62+
# Building using Java 11 and run the tests with Java 8 runtime
6263
runs-on: windows-latest
6364
steps:
6465
- name: Support longpaths
6566
run: git config --system core.longpaths true
6667
- uses: actions/checkout@v4
6768
- uses: actions/setup-java@v4
6869
with:
69-
distribution: temurin
7070
java-version: 8
71+
distribution: temurin
72+
- name: "Set jvm system property environment variable for surefire plugin (unit tests)"
73+
run: echo "SUREFIRE_JVM_OPT=-Djvm=${JAVA_HOME}\bin\java" >> $GITHUB_ENV
74+
shell: bash
75+
- uses: actions/setup-java@v4
76+
with:
77+
distribution: temurin
78+
java-version: 11
7179
- run: java -version
7280
- run: .kokoro/build.bat
7381
env:

.github/workflows/hermetic_library_generation.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
with:
3838
fetch-depth: 0
3939
token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
40-
- uses: googleapis/sdk-platform-java/.github/scripts@v2.50.0
40+
- uses: googleapis/sdk-platform-java/.github/scripts@v2.53.0
4141
if: env.SHOULD_RUN == 'true'
4242
with:
4343
base_ref: ${{ github.base_ref }}

.github/workflows/unmanaged_dependency_check.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ jobs:
1414
shell: bash
1515
run: .kokoro/build.sh
1616
- name: Unmanaged dependency check
17-
uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.40.0
17+
uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.43.0
1818
with:
1919
bom-path: google-cloud-datastore-bom/pom.xml

.kokoro/build.sh

+12
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,18 @@ javadoc)
6060
RETURN_CODE=$?
6161
;;
6262
integration)
63+
# Kokoro integration tests use both JDK 11 and JDK 8. Integration
64+
# tests require JDK 11 export as JAVA env variable to run cloud datastore
65+
# emulator (https://cloud.google.com/sdk/docs/release-notes#39300_2022-07-12).
66+
# For Java 8 environment, we will still run the tests using Java 8 with
67+
# SUREFIRE_JVM_OPT for Maven surefire plugin:
68+
# https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jvm
69+
if [[ -n "${JAVA11_HOME}" && -n "${JAVA8_HOME}" ]]
70+
then
71+
export JAVA=${JAVA11_HOME}/bin/java
72+
export SUREFIRE_JVM_OPT=-Djvm=${JAVA8_HOME}/bin/java
73+
fi
74+
6375
mvn -B ${INTEGRATION_TEST_ARGS} \
6476
-ntp \
6577
-Penable-integration-tests \

.kokoro/common.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function retry_with_backoff {
5252
return $exit_code
5353
}
5454

55-
## Helper functionss
55+
## Helper functions
5656
function now() { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n'; }
5757
function msg() { println "$*" >&2; }
5858
function println() { printf '%s\n' "$(now) $*"; }

.kokoro/presubmit/graalvm-native-17.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Configure the docker image for kokoro-trampoline.
44
env_vars: {
55
key: "TRAMPOLINE_IMAGE"
6-
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.40.0"
6+
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.43.0"
77
}
88

99
env_vars: {

.kokoro/presubmit/graalvm-native.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Configure the docker image for kokoro-trampoline.
44
env_vars: {
55
key: "TRAMPOLINE_IMAGE"
6-
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.40.0"
6+
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.43.0"
77
}
88

99
env_vars: {

.kokoro/presubmit/integration.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ env_vars: {
3535
env_vars: {
3636
key: "SECRET_MANAGER_KEYS"
3737
value: "java-it-service-account"
38-
}
38+
}

0 commit comments

Comments
 (0)