Skip to content
Closed
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
6176f22
chore: Update generation configuration at Fri Mar 28 02:27:31 UTC 2025
cloud-java-bot Mar 28, 2025
f8bbae4
chore: Update generation configuration at Sat Mar 29 02:26:03 UTC 2025
cloud-java-bot Mar 29, 2025
6d549bb
chore: Update generation configuration at Sun Mar 30 02:29:16 UTC 2025
cloud-java-bot Mar 30, 2025
2d15639
chore: generate libraries at Sun Mar 30 02:29:54 UTC 2025
cloud-java-bot Mar 30, 2025
565ce51
chore: Update generation configuration at Tue Apr 1 02:30:43 UTC 2025
cloud-java-bot Apr 1, 2025
36865a5
chore: Update generation configuration at Wed Apr 2 02:27:30 UTC 2025
cloud-java-bot Apr 2, 2025
0c2d533
chore: generate libraries at Wed Apr 2 02:28:00 UTC 2025
cloud-java-bot Apr 2, 2025
74707ee
chore: Update generation configuration at Thu Apr 3 02:27:26 UTC 2025
cloud-java-bot Apr 3, 2025
e0d9372
chore: Update generation configuration at Fri Apr 4 02:27:05 UTC 2025
cloud-java-bot Apr 4, 2025
31d46e3
chore: Update generation configuration at Sat Apr 5 02:26:21 UTC 2025
cloud-java-bot Apr 5, 2025
47978af
chore: Update generation configuration at Tue Apr 8 02:27:22 UTC 2025
cloud-java-bot Apr 8, 2025
38d265d
chore: Update generation configuration at Wed Apr 9 02:28:05 UTC 2025
cloud-java-bot Apr 9, 2025
e9b98a3
chore: Update generation configuration at Thu Apr 10 02:27:27 UTC 2025
cloud-java-bot Apr 10, 2025
3f9b116
chore: Update generation configuration at Fri Apr 11 02:27:51 UTC 2025
cloud-java-bot Apr 11, 2025
f771a1c
chore: Update generation configuration at Sat Apr 12 02:26:50 UTC 2025
cloud-java-bot Apr 12, 2025
270d51e
chore: Update generation configuration at Tue Apr 15 02:28:40 UTC 2025
cloud-java-bot Apr 15, 2025
60a8322
chore: Update generation configuration at Wed Apr 16 02:28:31 UTC 2025
cloud-java-bot Apr 16, 2025
e09fc3b
chore: Update generation configuration at Thu Apr 17 02:28:06 UTC 2025
cloud-java-bot Apr 17, 2025
d7b8cf4
chore: Update generation configuration at Fri Apr 18 02:27:21 UTC 2025
cloud-java-bot Apr 18, 2025
0d28d7f
chore: Update generation configuration at Sat Apr 19 02:25:53 UTC 2025
cloud-java-bot Apr 19, 2025
fc3af7b
chore: Update generation configuration at Sun Apr 20 02:29:46 UTC 2025
cloud-java-bot Apr 20, 2025
ca9f8f0
chore: generate libraries at Sun Apr 20 02:30:15 UTC 2025
cloud-java-bot Apr 20, 2025
cd1195c
Merge branch 'main' into generate-libraries-main
cindy-peng Apr 21, 2025
3b1eef3
chore: Update generation configuration at Tue Apr 22 02:28:18 UTC 2025
cloud-java-bot Apr 22, 2025
21cc9ad
Merge branch 'main' into generate-libraries-main
cindy-peng Apr 22, 2025
047c712
chore: generate libraries at Tue Apr 22 17:30:16 UTC 2025
cloud-java-bot Apr 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/generated-files-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ externalManifests:
file: '.github/readme/synth.metadata/synth.metadata'
jsonpath: '$.generatedFiles[*]'
ignoreAuthors:
- 'cloud-java-bot'
- 'renovate-bot'
- 'yoshi-automation'
- 'release-please[bot]'
Expand Down
11 changes: 9 additions & 2 deletions .github/scripts/update_generation_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,15 @@ set -e
function get_latest_released_version() {
local group_id=$1
local artifact_id=$2
latest=$(curl -s "https://search.maven.org/solrsearch/select?q=g:${group_id}+AND+a:${artifact_id}&core=gav&rows=500&wt=json" | jq -r '.response.docs[] | select(.v | test("^[0-9]+(\\.[0-9]+)*$")) | .v' | sort -V | tail -n 1)
echo "${latest}"
json_content=$(curl -s "https://search.maven.org/solrsearch/select?q=g:${group_id}+AND+a:${artifact_id}&core=gav&rows=500&wt=json")
latest=$(jq -r '.response.docs[] | select(.v | test("^[0-9]+(\\.[0-9]+)*$")) | .v' <<< "${json_content}" | sort -V | tail -n 1)
if [[ -z "${latest}" ]]; then
echo "The latest version of ${group_id}:${artifact_id} is empty."
echo "The returned json from maven.org is invalid: ${json_content}"
exit 1
else
echo "${latest}"
fi
}

# Update a key to a new value in the generation config.
Expand Down
10 changes: 1 addition & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,15 @@ jobs:
env:
JOB_TYPE: test
windows:
# Building using Java 11 and run the tests with Java 8 runtime
runs-on: windows-latest
steps:
- name: Support longpaths
run: git config --system core.longpaths true
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 8
distribution: temurin
- name: "Set jvm system property environment variable for surefire plugin (unit tests)"
run: echo "SUREFIRE_JVM_OPT=-Djvm=${JAVA_HOME}\bin\java" >> $GITHUB_ENV
shell: bash
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 11
java-version: 8
- run: java -version
- run: .kokoro/build.bat
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/hermetic_library_generation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
with:
fetch-depth: 0
token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
- uses: googleapis/sdk-platform-java/.github/scripts@v2.55.1
- uses: googleapis/sdk-platform-java/.github/scripts@v2.56.0
if: env.SHOULD_RUN == 'true'
with:
base_ref: ${{ github.base_ref }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/renovate_config_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
renovate_bot_config_validation:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- name: Checkout code
Expand All @@ -16,7 +16,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
node-version: '22'

- name: Install Renovate and Config Validator
run: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/update_generation_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ on:

jobs:
update-generation-config:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
env:
# the branch into which the pull request is merged
base_branch: main
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
- name: Update params in generation config to latest
shell: bash
Expand All @@ -36,7 +37,8 @@ jobs:
[ -z "$(git config user.email)" ] && git config --global user.email "[email protected]"
[ -z "$(git config user.name)" ] && git config --global user.name "cloud-java-bot"
bash .github/scripts/update_generation_config.sh \
--base_branch "${base_branch}"\
--base_branch "${base_branch}" \
--repo ${{ github.repository }}
env:
GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}

26 changes: 6 additions & 20 deletions .kokoro/build.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash
# Copyright 2019 Google LLC
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
Expand Down Expand Up @@ -42,6 +42,7 @@ if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTI
export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_GFILE_DIR}/${GOOGLE_APPLICATION_CREDENTIALS})
fi


RETURN_CODE=0
set +e

Expand All @@ -60,24 +61,14 @@ javadoc)
RETURN_CODE=$?
;;
integration)
# Kokoro integration tests use both JDK 11 and JDK 8. Integration
# tests require JDK 11 export as JAVA env variable to run cloud datastore
# emulator (https://cloud.google.com/sdk/docs/release-notes#39300_2022-07-12).
# For Java 8 environment, we will still run the tests using Java 8 with
# SUREFIRE_JVM_OPT for Maven surefire plugin:
# https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jvm
if [[ -n "${JAVA11_HOME}" && -n "${JAVA8_HOME}" ]]
then
export JAVA=${JAVA11_HOME}/bin/java
export SUREFIRE_JVM_OPT=-Djvm=${JAVA8_HOME}/bin/java
fi

mvn -B ${INTEGRATION_TEST_ARGS} \
-ntp \
-Penable-integration-tests \
-DtrimStackTrace=false \
-Dclirr.skip=true \
-Denforcer.skip=true \
-Dcheckstyle.skip=true \
-DskipUnitTests=true \
-fae \
verify
RETURN_CODE=$?
Expand All @@ -87,11 +78,6 @@ graalvm)
mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative test
RETURN_CODE=$?
;;
graalvm17)
# Run Unit and Integration Tests with Native Image
mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative test
RETURN_CODE=$?
;;
samples)
SAMPLES_DIR=samples
# only run ITs in snapshot/ on presubmit PRs. run ITs in all 3 samples/ subdirectories otherwise.
Expand Down Expand Up @@ -144,4 +130,4 @@ then
fi

echo "exiting with ${RETURN_CODE}"
exit ${RETURN_CODE}
exit ${RETURN_CODE}
38 changes: 38 additions & 0 deletions .kokoro/presubmit/graalvm-a.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.45.1"
}

env_vars: {
key: "JOB_TYPE"
value: "graalvm"
}

# TODO: remove this after we've migrated all tests and scripts
env_vars: {
key: "GCLOUD_PROJECT"
value: "gcloud-devel"
}

env_vars: {
key: "GOOGLE_CLOUD_PROJECT"
value: "gcloud-devel"
}

env_vars: {
key: "GOOGLE_APPLICATION_CREDENTIALS"
value: "secret_manager/java-it-service-account"
}

env_vars: {
key: "SECRET_MANAGER_KEYS"
value: "java-it-service-account"
}

env_vars: {
key: "IT_SERVICE_ACCOUNT_EMAIL"
value: "[email protected]"
}
38 changes: 38 additions & 0 deletions .kokoro/presubmit/graalvm-b.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.45.1"
}

env_vars: {
key: "JOB_TYPE"
value: "graalvm"
}

# TODO: remove this after we've migrated all tests and scripts
env_vars: {
key: "GCLOUD_PROJECT"
value: "gcloud-devel"
}

env_vars: {
key: "GOOGLE_CLOUD_PROJECT"
value: "gcloud-devel"
}

env_vars: {
key: "GOOGLE_APPLICATION_CREDENTIALS"
value: "secret_manager/java-it-service-account"
}

env_vars: {
key: "SECRET_MANAGER_KEYS"
value: "java-it-service-account"
}

env_vars: {
key: "IT_SERVICE_ACCOUNT_EMAIL"
value: "[email protected]"
}
38 changes: 38 additions & 0 deletions .kokoro/presubmit/graalvm-c.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.45.1"
}

env_vars: {
key: "JOB_TYPE"
value: "graalvm"
}

# TODO: remove this after we've migrated all tests and scripts
env_vars: {
key: "GCLOUD_PROJECT"
value: "gcloud-devel"
}

env_vars: {
key: "GOOGLE_CLOUD_PROJECT"
value: "gcloud-devel"
}

env_vars: {
key: "GOOGLE_APPLICATION_CREDENTIALS"
value: "secret_manager/java-it-service-account"
}

env_vars: {
key: "SECRET_MANAGER_KEYS"
value: "java-it-service-account"
}

env_vars: {
key: "IT_SERVICE_ACCOUNT_EMAIL"
value: "[email protected]"
}
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Code in this repo is formatted with
[google-java-format](https://github.com/google/google-java-format).
To run formatting on your project, you can run:
```
mvn com.coveo:fmt-maven-plugin:format
mvn com.spotify.fmt:fmt-maven-plugin:format
```

[1]: https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ If you are using Maven without the BOM, add this to your dependencies:
If you are using Gradle 5.x or later, add this to your dependencies:

```Groovy
implementation platform('com.google.cloud:libraries-bom:26.57.0')
implementation platform('com.google.cloud:libraries-bom:26.59.0')

implementation 'com.google.cloud:google-cloud-datastore'
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ public synchronized File getProjectDirectory() {
static class StartupMonitor extends Thread {
private final InputStream inputStream;
private volatile boolean success = false;

/** This latch will reach 0 once server startup has completed. */
private final CountDownLatch startupCompleteLatch = new CountDownLatch(1);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,16 @@ public DatastoreException(String methodName, Code code, String message, Throwabl
this.code = code;
}

/** @return the canonical error code */
/**
* @return the canonical error code
*/
public Code getCode() {
return code;
}

/** @return the datastore method name */
/**
* @return the datastore method name
*/
public String getMethodName() {
return methodName;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,9 @@ private static void setProjectEndpointFromEnv(DatastoreOptions.Builder options)
return;
}

/** @see #getOptionsFromEnv() */
/**
* @see #getOptionsFromEnv()
*/
public static Datastore getDatastoreFromEnv() throws GeneralSecurityException, IOException {
return DatastoreFactory.get().create(getOptionsFromEnv().build());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
class EndToEndChecksumHandler {
/** The checksum http header on http requests */
static final String HTTP_REQUEST_CHECKSUM_HEADER = "x-request-checksum-348659783";

/** The checksum http header on http responses */
static final String HTTP_RESPONSE_CHECKSUM_HEADER = "x-response-checksum-348659783";

Expand Down
Loading
Loading