Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
4c89a70
chore: Update generation configuration at Sat Aug 24 02:16:11 UTC 2024
cloud-java-bot Aug 24, 2024
58de6db
chore: Update generation configuration at Tue Aug 27 02:17:36 UTC 2024
cloud-java-bot Aug 27, 2024
5a2bb92
chore: Update generation configuration at Wed Aug 28 02:18:15 UTC 2024
cloud-java-bot Aug 28, 2024
8d03acf
chore: Update generation configuration at Thu Aug 29 02:19:05 UTC 2024
cloud-java-bot Aug 29, 2024
3de5dbc
chore: generate libraries at Thu Aug 29 02:19:34 UTC 2024
cloud-java-bot Aug 29, 2024
958c621
chore: Update generation configuration at Fri Aug 30 02:19:50 UTC 2024
cloud-java-bot Aug 30, 2024
713b7ad
chore: Update generation configuration at Sat Aug 31 02:32:13 UTC 2024
cloud-java-bot Aug 31, 2024
89f28dd
chore: Update generation configuration at Wed Sep 4 02:19:51 UTC 2024
cloud-java-bot Sep 4, 2024
a890ae6
chore: Update generation configuration at Thu Sep 5 02:20:21 UTC 2024
cloud-java-bot Sep 5, 2024
0bf431e
chore: Update generation configuration at Fri Sep 6 02:20:09 UTC 2024
cloud-java-bot Sep 6, 2024
9899d02
chore: Update generation configuration at Sat Sep 7 02:18:29 UTC 2024
cloud-java-bot Sep 7, 2024
d3be4db
chore: Update generation configuration at Sun Sep 8 02:23:55 UTC 2024
cloud-java-bot Sep 8, 2024
8176860
chore: Update generation configuration at Tue Sep 10 02:21:14 UTC 2024
cloud-java-bot Sep 10, 2024
7b4fb02
chore: Update generation configuration at Tue Sep 10 19:32:36 UTC 2024
cloud-java-bot Sep 10, 2024
db58496
chore: generate libraries at Tue Sep 10 19:33:01 UTC 2024
cloud-java-bot Sep 10, 2024
e5d845a
chore: Update generation configuration at Wed Sep 11 02:20:26 UTC 2024
cloud-java-bot Sep 11, 2024
ae4f6be
chore: Update generation configuration at Thu Sep 12 02:20:51 UTC 2024
cloud-java-bot Sep 12, 2024
2f466f8
chore: Update generation configuration at Fri Sep 13 02:21:29 UTC 2024
cloud-java-bot Sep 13, 2024
a1c2076
chore: Update generation configuration at Sat Sep 14 02:19:43 UTC 2024
cloud-java-bot Sep 14, 2024
fc29c49
chore: Update generation configuration at Mon Sep 16 02:26:06 UTC 2024
cloud-java-bot Sep 16, 2024
ec79204
chore: Update generation configuration at Tue Sep 17 02:09:22 UTC 2024
cloud-java-bot Sep 17, 2024
35b9349
chore: Update generation configuration at Wed Sep 18 02:21:23 UTC 2024
cloud-java-bot Sep 18, 2024
28e2b47
chore: Update generation configuration at Thu Sep 19 02:23:01 UTC 2024
cloud-java-bot Sep 19, 2024
2fc6fcf
chore: generate libraries at Thu Sep 19 02:23:29 UTC 2024
cloud-java-bot Sep 19, 2024
0ca5fe5
chore: Update generation configuration at Fri Sep 20 02:22:38 UTC 2024
cloud-java-bot Sep 20, 2024
b471890
chore: generate libraries at Fri Sep 20 02:24:34 UTC 2024
cloud-java-bot Sep 20, 2024
53c1308
chore: Update generation configuration at Sat Sep 21 02:21:05 UTC 2024
cloud-java-bot Sep 21, 2024
9c9a1e8
chore: Update generation configuration at Tue Sep 24 02:24:46 UTC 2024
cloud-java-bot Sep 24, 2024
52a99dd
chore: Update generation configuration at Wed Sep 25 02:25:21 UTC 2024
cloud-java-bot Sep 25, 2024
f46d286
update gen script
JoeWang1127 Sep 25, 2024
a07d615
chore: generate libraries at Wed Sep 25 23:54:38 UTC 2024
cloud-java-bot Sep 25, 2024
98b0857
chore: Update generation configuration at Thu Sep 26 02:24:15 UTC 2024
cloud-java-bot Sep 26, 2024
d87c0ba
chore: Update generation configuration at Fri Sep 27 02:24:50 UTC 2024
cloud-java-bot Sep 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
45 changes: 22 additions & 23 deletions .github/scripts/hermetic_library_generation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,24 @@ message="chore: generate libraries at $(date)"

git checkout "${target_branch}"
git checkout "${current_branch}"
# if the last commit doesn't contain changes to generation configuration,
# do not generate again as the result will be the same.
change_of_last_commit="$(git diff-tree --no-commit-id --name-only HEAD~1..HEAD -r)"
if [[ ! ("${change_of_last_commit}" == *"${generation_config}"*) ]]; then
echo "The last commit doesn't contain any changes to the generation_config.yaml, skipping the whole generation process." || true
exit 0
fi

# copy generation configuration from target branch to current branch.
git show "${target_branch}":"${generation_config}" > "${baseline_generation_config}"
config_diff=$(diff "${generation_config}" "${baseline_generation_config}" || true)

# parse image tag from the generation configuration.
image_tag=$(grep "gapic_generator_version" "${generation_config}" | cut -d ':' -f 2 | xargs)

repo_root_dir=$(pwd)
mkdir -p "${repo_root_dir}/output"
# download api definitions from googleapis repository
googleapis_commitish=$(grep googleapis_commitish "${generation_config}" | cut -d ":" -f 2 | xargs)
api_def_dir=$(mktemp -d)
git clone https://github.com/googleapis/googleapis.git "${api_def_dir}"
pushd "${api_def_dir}"
git checkout "${googleapis_commitish}"
cp -r google/ grafeas/ "${repo_root_dir}/output"
popd

# run hermetic code generation docker image.
docker run \
--rm \
Expand All @@ -90,26 +94,21 @@ docker run \
--baseline-generation-config-path="${workspace_name}/${baseline_generation_config}" \
--current-generation-config-path="${workspace_name}/${generation_config}"

# remove api definitions after generation
rm -rf "${api_def_dir}"

# commit the change to the pull request.
if [[ $(basename $(pwd)) == "google-cloud-java" ]]; then
git add java-* pom.xml gapic-libraries-bom/pom.xml versions.txt
else
# The image leaves intermediate folders and files it works with. Here we remove them
rm -rdf output googleapis "${baseline_generation_config}"
git add --all -- ':!pr_description.txt'
fi
rm -rdf output googleapis "${baseline_generation_config}"
git add --all -- ':!pr_description.txt' ':!hermetic_library_generation.sh'
changed_files=$(git diff --cached --name-only)
if [[ "${changed_files}" == "" ]]; then
echo "There is no generated code change with the generation config change ${config_diff}."
echo "Skip committing to the pull request."
exit 0
if [[ "${changed_files}" != "" ]]; then
echo "Commit changes..."
git commit -m "${message}"
git push
else
echo "There is no generated code change, skip commit."
fi

echo "Configuration diff:"
echo "${config_diff}"
git commit -m "${message}"
git push
# set pr body if pr_description.txt is generated.
if [[ -f "pr_description.txt" ]]; then
pr_num=$(gh pr list -s open -H "${current_branch}" -q . --json number | jq ".[] | .number")
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.43.0</version>
<version>26.44.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -42,28 +42,28 @@ If you are using Maven without the BOM, add this to your dependencies:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-spanner</artifactId>
<version>6.71.0</version>
<version>6.72.0</version>
</dependency>

```

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

```Groovy
implementation platform('com.google.cloud:libraries-bom:26.44.0')
implementation platform('com.google.cloud:libraries-bom:26.47.0')

implementation 'com.google.cloud:google-cloud-spanner'
```
If you are using Gradle without BOM, add this to your dependencies:

```Groovy
implementation 'com.google.cloud:google-cloud-spanner:6.71.0'
implementation 'com.google.cloud:google-cloud-spanner:6.73.0'
```

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

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-spanner" % "6.71.0"
libraryDependencies += "com.google.cloud" % "google-cloud-spanner" % "6.73.0"
```
<!-- {x-version-update-end} -->

Expand Down Expand Up @@ -561,6 +561,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-spanner/tree/
| Restore Backup With Encryption Key | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/RestoreBackupWithEncryptionKey.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/RestoreBackupWithEncryptionKey.java) |
| Set Max Commit Delay Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/SetMaxCommitDelaySample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/SetMaxCommitDelaySample.java) |
| Singer Proto | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/SingerProto.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/SingerProto.java) |
| Spanner Graph Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/SpannerGraphSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/SpannerGraphSample.java) |
| Spanner Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/SpannerSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/SpannerSample.java) |
| Statement Timeout Example | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/StatementTimeoutExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/StatementTimeoutExample.java) |
| Tag Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/TagSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/TagSample.java) |
Expand Down Expand Up @@ -716,7 +717,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-spanner/java11.html
[stability-image]: https://img.shields.io/badge/stability-stable-green
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-spanner.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-spanner/6.71.0
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-spanner/6.73.0
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down
6 changes: 3 additions & 3 deletions generation_config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
gapic_generator_version: 2.44.0
googleapis_commitish: 6f3c628e7fc39b5ca7186aba1a67ae39454d0752
libraries_bom_version: 26.44.0
gapic_generator_version: 2.46.1
googleapis_commitish: 005df4681b89bd204a90b76168a6dc9d9e7bf4fe
libraries_bom_version: 26.47.0
libraries:
- api_shortname: spanner
name_pretty: Cloud Spanner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@
* <p>The builder of this class is recursive, so contained classes are themselves builders. When
* build() is called, the tree of builders is called to create the complete settings object.
*
* <p>For example, to set the total timeout of executeActionAsync to 30 seconds:
* <p>For example, to set the
* [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings)
* of executeActionAsync:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
Expand All @@ -66,11 +68,22 @@
* .executeActionAsyncSettings()
* .getRetrySettings()
* .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .setInitialRetryDelayDuration(Duration.ofSeconds(1))
* .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
* .setMaxAttempts(5)
* .setMaxRetryDelayDuration(Duration.ofSeconds(30))
* .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
* .setRetryDelayMultiplier(1.3)
* .setRpcTimeoutMultiplier(1.5)
* .setTotalTimeoutDuration(Duration.ofSeconds(300))
* .build());
* SpannerExecutorProxySettings spannerExecutorProxySettings =
* spannerExecutorProxySettingsBuilder.build();
* }</pre>
*
* Please refer to the [Client Side Retry
* Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for
* additional support in setting retries.
*/
@Generated("by gapic-generator-java")
public class SpannerExecutorProxySettings extends ClientSettings<SpannerExecutorProxySettings> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@
* <p>The builder of this class is recursive, so contained classes are themselves builders. When
* build() is called, the tree of builders is called to create the complete settings object.
*
* <p>For example, to set the total timeout of executeActionAsync to 30 seconds:
* <p>For example, to set the
* [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings)
* of executeActionAsync:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
Expand All @@ -75,11 +77,22 @@
* .executeActionAsyncSettings()
* .getRetrySettings()
* .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .setInitialRetryDelayDuration(Duration.ofSeconds(1))
* .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
* .setMaxAttempts(5)
* .setMaxRetryDelayDuration(Duration.ofSeconds(30))
* .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
* .setRetryDelayMultiplier(1.3)
* .setRpcTimeoutMultiplier(1.5)
* .setTotalTimeoutDuration(Duration.ofSeconds(300))
* .build());
* SpannerExecutorProxyStubSettings spannerExecutorProxySettings =
* spannerExecutorProxySettingsBuilder.build();
* }</pre>
*
* Please refer to the [Client Side Retry
* Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for
* additional support in setting retries.
*/
@Generated("by gapic-generator-java")
public class SpannerExecutorProxyStubSettings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,24 @@
"allDeclaredClasses": true,
"allPublicClasses": true
},
{
"name": "com.google.api.PythonSettings$ExperimentalFeatures",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allPublicMethods": true,
"allDeclaredClasses": true,
"allPublicClasses": true
},
{
"name": "com.google.api.PythonSettings$ExperimentalFeatures$Builder",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allPublicMethods": true,
"allDeclaredClasses": true,
"allPublicClasses": true
},
{
"name": "com.google.api.ResourceDescriptor",
"queryAllDeclaredConstructors": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@
* <p>The builder of this class is recursive, so contained classes are themselves builders. When
* build() is called, the tree of builders is called to create the complete settings object.
*
* <p>For example, to set the total timeout of getDatabase to 30 seconds:
* <p>For example, to set the
* [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings)
* of getDatabase:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
Expand All @@ -117,10 +119,46 @@
* .getDatabaseSettings()
* .getRetrySettings()
* .toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .setInitialRetryDelayDuration(Duration.ofSeconds(1))
* .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
* .setMaxAttempts(5)
* .setMaxRetryDelayDuration(Duration.ofSeconds(30))
* .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
* .setRetryDelayMultiplier(1.3)
* .setRpcTimeoutMultiplier(1.5)
* .setTotalTimeoutDuration(Duration.ofSeconds(300))
* .build());
* DatabaseAdminSettings databaseAdminSettings = databaseAdminSettingsBuilder.build();
* }</pre>
*
* Please refer to the [Client Side Retry
* Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for
* additional support in setting retries.
*
* <p>To configure the RetrySettings of a Long Running Operation method, create an
* OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to
* configure the RetrySettings for createDatabase:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* DatabaseAdminSettings.Builder databaseAdminSettingsBuilder = DatabaseAdminSettings.newBuilder();
* TimedRetryAlgorithm timedRetryAlgorithm =
* OperationalTimedPollAlgorithm.create(
* RetrySettings.newBuilder()
* .setInitialRetryDelayDuration(Duration.ofMillis(500))
* .setRetryDelayMultiplier(1.5)
* .setMaxRetryDelay(Duration.ofMillis(5000))
* .setTotalTimeoutDuration(Duration.ofHours(24))
* .build());
* databaseAdminSettingsBuilder
* .createClusterOperationSettings()
* .setPollingAlgorithm(timedRetryAlgorithm)
* .build();
* }</pre>
*/
@Generated("by gapic-generator-java")
public class DatabaseAdminSettings extends ClientSettings<DatabaseAdminSettings> {
Expand Down
Loading
Loading