Skip to content

Commit a4f2a6c

Browse files
authored
Merge branch 'main' into cindy/vector-search-1
2 parents 7c46b40 + 12b8f12 commit a4f2a6c

File tree

20 files changed

+130
-71
lines changed

20 files changed

+130
-71
lines changed

.github/scripts/update_generation_config.sh

Lines changed: 55 additions & 8 deletions
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/workflows/hermetic_library_generation.yaml

Lines changed: 1 addition & 1 deletion
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.51.0
4141
if: env.SHOULD_RUN == 'true'
4242
with:
4343
base_ref: ${{ github.base_ref }}

.github/workflows/unmanaged_dependency_check.yaml

Lines changed: 1 addition & 1 deletion
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.41.0
1818
with:
1919
bom-path: google-cloud-datastore-bom/pom.xml

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

Lines changed: 1 addition & 1 deletion
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.41.0"
77
}
88

99
env_vars: {

.kokoro/presubmit/graalvm-native.cfg

Lines changed: 1 addition & 1 deletion
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.41.0"
77
}
88

99
env_vars: {

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
# Changelog
22

3+
## [2.25.1](https://github.com/googleapis/java-datastore/compare/v2.25.0...v2.25.1) (2024-12-13)
4+
5+
6+
### Bug Fixes
7+
8+
* **deps:** Update the Java code generator (gapic-generator-java) to 2.51.0 ([106ee4d](https://github.com/googleapis/java-datastore/commit/106ee4dd7ca4dd9e59a5419f59b8625680e60f15))
9+
10+
11+
### Dependencies
12+
13+
* Update sdk platform java dependencies ([#1685](https://github.com/googleapis/java-datastore/issues/1685)) ([4372350](https://github.com/googleapis/java-datastore/commit/4372350117ba57903f510512a383339b6a4ea47c))
14+
15+
## [2.25.0](https://github.com/googleapis/java-datastore/compare/v2.24.3...v2.25.0) (2024-12-11)
16+
17+
18+
### Features
19+
20+
* Introduce `java.time` methods and variables ([#1671](https://github.com/googleapis/java-datastore/issues/1671)) ([5a78a80](https://github.com/googleapis/java-datastore/commit/5a78a8075867f4b2fc598f0423bd2ab65b559856))
21+
22+
23+
### Dependencies
24+
25+
* Update dependency com.google.cloud:gapic-libraries-bom to v1.48.0 ([#1605](https://github.com/googleapis/java-datastore/issues/1605)) ([5c6a678](https://github.com/googleapis/java-datastore/commit/5c6a67844f7b5d4c7001cccd1bed3d0d56be6e90))
26+
27+
28+
### Documentation
29+
30+
* Update gapic upgrade installation instructions ([#1677](https://github.com/googleapis/java-datastore/issues/1677)) ([b3fbfcc](https://github.com/googleapis/java-datastore/commit/b3fbfcc9654bc63bf0d8f3025641d8c50a24ef97))
31+
332
## [2.24.3](https://github.com/googleapis/java-datastore/compare/v2.24.2...v2.24.3) (2024-11-18)
433

534

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
1919
<dependency>
2020
<groupId>com.google.cloud</groupId>
2121
<artifactId>libraries-bom</artifactId>
22-
<version>26.50.0</version>
22+
<version>26.51.0</version>
2323
<type>pom</type>
2424
<scope>import</scope>
2525
</dependency>
@@ -41,28 +41,28 @@ If you are using Maven without the BOM, add this to your dependencies:
4141
<dependency>
4242
<groupId>com.google.cloud</groupId>
4343
<artifactId>google-cloud-datastore</artifactId>
44-
<version>2.24.1</version>
44+
<version>2.25.0</version>
4545
</dependency>
4646

4747
```
4848

4949
If you are using Gradle 5.x or later, add this to your dependencies:
5050

5151
```Groovy
52-
implementation platform('com.google.cloud:libraries-bom:26.50.0')
52+
implementation platform('com.google.cloud:libraries-bom:26.51.0')
5353
5454
implementation 'com.google.cloud:google-cloud-datastore'
5555
```
5656
If you are using Gradle without BOM, add this to your dependencies:
5757

5858
```Groovy
59-
implementation 'com.google.cloud:google-cloud-datastore:2.24.3'
59+
implementation 'com.google.cloud:google-cloud-datastore:2.25.1'
6060
```
6161

6262
If you are using SBT, add this to your dependencies:
6363

6464
```Scala
65-
libraryDependencies += "com.google.cloud" % "google-cloud-datastore" % "2.24.3"
65+
libraryDependencies += "com.google.cloud" % "google-cloud-datastore" % "2.25.1"
6666
```
6767

6868
## Authentication
@@ -479,7 +479,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
479479
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-datastore/java11.html
480480
[stability-image]: https://img.shields.io/badge/stability-stable-green
481481
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-datastore.svg
482-
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-datastore/2.24.3
482+
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-datastore/2.25.1
483483
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
484484
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
485485
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles

datastore-v1-proto-client/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
<modelVersion>4.0.0</modelVersion>
2020
<groupId>com.google.cloud.datastore</groupId>
2121
<artifactId>datastore-v1-proto-client</artifactId>
22-
<version>2.24.3</version><!-- {x-version-update:datastore-v1-proto-client:current} -->
22+
<version>2.25.1</version><!-- {x-version-update:datastore-v1-proto-client:current} -->
2323

2424
<parent>
2525
<groupId>com.google.cloud</groupId>
2626
<artifactId>google-cloud-datastore-parent</artifactId>
27-
<version>2.24.3</version><!-- {x-version-update:google-cloud-datastore:current} -->
27+
<version>2.25.1</version><!-- {x-version-update:google-cloud-datastore:current} -->
2828
</parent>
2929

3030
<packaging>jar</packaging>

generation_config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
gapic_generator_version: 2.50.0
2-
googleapis_commitish: a547fc1420eb0a0f3ae32b0a4eb72d3b8b17d136
3-
libraries_bom_version: 26.50.0
1+
gapic_generator_version: 2.51.0
2+
googleapis_commitish: 7d0c6bee2517d77635beb2a1dd6d6e7d4d943512
3+
libraries_bom_version: 26.51.0
44
libraries:
55
- api_shortname: datastore
66
name_pretty: Cloud Datastore

google-cloud-datastore-bom/pom.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.google.cloud</groupId>
55
<artifactId>google-cloud-datastore-bom</artifactId>
6-
<version>2.24.3</version><!-- {x-version-update:google-cloud-datastore-bom:current} -->
6+
<version>2.25.1</version><!-- {x-version-update:google-cloud-datastore-bom:current} -->
77
<packaging>pom</packaging>
88
<parent>
99
<groupId>com.google.cloud</groupId>
1010
<artifactId>sdk-platform-java-config</artifactId>
11-
<version>3.40.0</version>
11+
<version>3.41.0</version>
1212
</parent>
1313

1414
<name>Google Cloud datastore BOM</name>
@@ -52,22 +52,22 @@
5252
<dependency>
5353
<groupId>com.google.cloud</groupId>
5454
<artifactId>google-cloud-datastore</artifactId>
55-
<version>2.24.3</version><!-- {x-version-update:google-cloud-datastore:current} -->
55+
<version>2.25.1</version><!-- {x-version-update:google-cloud-datastore:current} -->
5656
</dependency>
5757
<dependency>
5858
<groupId>com.google.api.grpc</groupId>
5959
<artifactId>grpc-google-cloud-datastore-admin-v1</artifactId>
60-
<version>2.24.3</version><!-- {x-version-update:grpc-google-cloud-datastore-admin-v1:current} -->
60+
<version>2.25.1</version><!-- {x-version-update:grpc-google-cloud-datastore-admin-v1:current} -->
6161
</dependency>
6262
<dependency>
6363
<groupId>com.google.api.grpc</groupId>
6464
<artifactId>proto-google-cloud-datastore-v1</artifactId>
65-
<version>0.115.3</version><!-- {x-version-update:proto-google-cloud-datastore-v1:current} -->
65+
<version>0.116.1</version><!-- {x-version-update:proto-google-cloud-datastore-v1:current} -->
6666
</dependency>
6767
<dependency>
6868
<groupId>com.google.api.grpc</groupId>
6969
<artifactId>proto-google-cloud-datastore-admin-v1</artifactId>
70-
<version>2.24.3</version><!-- {x-version-update:proto-google-cloud-datastore-admin-v1:current} -->
70+
<version>2.25.1</version><!-- {x-version-update:proto-google-cloud-datastore-admin-v1:current} -->
7171
</dependency>
7272
</dependencies>
7373
</dependencyManagement>

0 commit comments

Comments
 (0)