Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
12 changes: 6 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.45.0</version>
<version>26.47.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-firestore</artifactId>
<version>3.26.1</version>
<version>3.26.3</version>
</dependency>

```

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

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

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

```Groovy
implementation 'com.google.cloud:google-cloud-firestore:3.26.1'
implementation 'com.google.cloud:google-cloud-firestore:3.26.3'
```

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

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-firestore" % "3.26.1"
libraryDependencies += "com.google.cloud" % "google-cloud-firestore" % "3.26.3"
```
<!-- {x-version-update-end} -->

Expand Down Expand Up @@ -221,7 +221,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-firestore/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-firestore.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-firestore/3.26.1
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-firestore/3.26.3
[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
4 changes: 2 additions & 2 deletions generation_config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
gapic_generator_version: 2.45.0
googleapis_commitish: a18d9b2c3563527b26c4b713469e795b92795271
gapic_generator_version: 2.46.1
googleapis_commitish: 005df4681b89bd204a90b76168a6dc9d9e7bf4fe
libraries_bom_version: 26.47.0
libraries:
- api_shortname: firestore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/firestore/admin/v1/backup.proto

// Protobuf Java Version: 3.25.4
// Protobuf Java Version: 3.25.5
package com.google.firestore.admin.v1;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/firestore/admin/v1/backup.proto

// Protobuf Java Version: 3.25.4
// Protobuf Java Version: 3.25.5
package com.google.firestore.admin.v1;

public interface BackupOrBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/firestore/admin/v1/backup.proto

// Protobuf Java Version: 3.25.4
// Protobuf Java Version: 3.25.5
package com.google.firestore.admin.v1;

public final class BackupProto {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/firestore/admin/v1/schedule.proto

// Protobuf Java Version: 3.25.4
// Protobuf Java Version: 3.25.5
package com.google.firestore.admin.v1;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/firestore/admin/v1/schedule.proto

// Protobuf Java Version: 3.25.4
// Protobuf Java Version: 3.25.5
package com.google.firestore.admin.v1;

public interface BackupScheduleOrBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/firestore/admin/v1/operation.proto

// Protobuf Java Version: 3.25.4
// Protobuf Java Version: 3.25.5
package com.google.firestore.admin.v1;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/firestore/admin/v1/operation.proto

// Protobuf Java Version: 3.25.4
// Protobuf Java Version: 3.25.5
package com.google.firestore.admin.v1;

public interface BulkDeleteDocumentsMetadataOrBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/firestore/admin/v1/firestore_admin.proto

// Protobuf Java Version: 3.25.4
// Protobuf Java Version: 3.25.5
package com.google.firestore.admin.v1;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/firestore/admin/v1/firestore_admin.proto

// Protobuf Java Version: 3.25.4
// Protobuf Java Version: 3.25.5
package com.google.firestore.admin.v1;

public interface BulkDeleteDocumentsRequestOrBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/firestore/admin/v1/firestore_admin.proto

// Protobuf Java Version: 3.25.4
// Protobuf Java Version: 3.25.5
package com.google.firestore.admin.v1;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/firestore/admin/v1/firestore_admin.proto

// Protobuf Java Version: 3.25.4
// Protobuf Java Version: 3.25.5
package com.google.firestore.admin.v1;

public interface BulkDeleteDocumentsResponseOrBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/firestore/admin/v1/firestore_admin.proto

// Protobuf Java Version: 3.25.4
// Protobuf Java Version: 3.25.5
package com.google.firestore.admin.v1;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/firestore/admin/v1/firestore_admin.proto

// Protobuf Java Version: 3.25.4
// Protobuf Java Version: 3.25.5
package com.google.firestore.admin.v1;

public interface CreateBackupScheduleRequestOrBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/firestore/admin/v1/firestore_admin.proto

// Protobuf Java Version: 3.25.4
// Protobuf Java Version: 3.25.5
package com.google.firestore.admin.v1;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/firestore/admin/v1/firestore_admin.proto

// Protobuf Java Version: 3.25.4
// Protobuf Java Version: 3.25.5
package com.google.firestore.admin.v1;

public interface CreateDatabaseMetadataOrBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/firestore/admin/v1/firestore_admin.proto

// Protobuf Java Version: 3.25.4
// Protobuf Java Version: 3.25.5
package com.google.firestore.admin.v1;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/firestore/admin/v1/firestore_admin.proto

// Protobuf Java Version: 3.25.4
// Protobuf Java Version: 3.25.5
package com.google.firestore.admin.v1;

public interface CreateDatabaseRequestOrBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/firestore/admin/v1/firestore_admin.proto

// Protobuf Java Version: 3.25.4
// Protobuf Java Version: 3.25.5
package com.google.firestore.admin.v1;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/firestore/admin/v1/firestore_admin.proto

// Protobuf Java Version: 3.25.4
// Protobuf Java Version: 3.25.5
package com.google.firestore.admin.v1;

public interface CreateIndexRequestOrBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/firestore/admin/v1/schedule.proto

// Protobuf Java Version: 3.25.4
// Protobuf Java Version: 3.25.5
package com.google.firestore.admin.v1;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/firestore/admin/v1/schedule.proto

// Protobuf Java Version: 3.25.4
// Protobuf Java Version: 3.25.5
package com.google.firestore.admin.v1;

public interface DailyRecurrenceOrBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/firestore/admin/v1/database.proto

// Protobuf Java Version: 3.25.4
// Protobuf Java Version: 3.25.5
package com.google.firestore.admin.v1;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/firestore/admin/v1/database.proto

// Protobuf Java Version: 3.25.4
// Protobuf Java Version: 3.25.5
package com.google.firestore.admin.v1;

public interface DatabaseOrBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/firestore/admin/v1/database.proto

// Protobuf Java Version: 3.25.4
// Protobuf Java Version: 3.25.5
package com.google.firestore.admin.v1;

public final class DatabaseProto {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/firestore/admin/v1/firestore_admin.proto

// Protobuf Java Version: 3.25.4
// Protobuf Java Version: 3.25.5
package com.google.firestore.admin.v1;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/firestore/admin/v1/firestore_admin.proto

// Protobuf Java Version: 3.25.4
// Protobuf Java Version: 3.25.5
package com.google.firestore.admin.v1;

public interface DeleteBackupRequestOrBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/firestore/admin/v1/firestore_admin.proto

// Protobuf Java Version: 3.25.4
// Protobuf Java Version: 3.25.5
package com.google.firestore.admin.v1;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/firestore/admin/v1/firestore_admin.proto

// Protobuf Java Version: 3.25.4
// Protobuf Java Version: 3.25.5
package com.google.firestore.admin.v1;

public interface DeleteBackupScheduleRequestOrBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/firestore/admin/v1/firestore_admin.proto

// Protobuf Java Version: 3.25.4
// Protobuf Java Version: 3.25.5
package com.google.firestore.admin.v1;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/firestore/admin/v1/firestore_admin.proto

// Protobuf Java Version: 3.25.4
// Protobuf Java Version: 3.25.5
package com.google.firestore.admin.v1;

public interface DeleteDatabaseMetadataOrBuilder
Expand Down
Loading