Skip to content

Commit

Permalink
Merge branch 'main' into test-proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
mutianf authored Dec 17, 2024
2 parents fb083d7 + a039489 commit 5071c8b
Show file tree
Hide file tree
Showing 71 changed files with 444 additions and 295 deletions.
72 changes: 32 additions & 40 deletions .github/scripts/update_generation_config.sh
Original file line number Diff line number Diff line change
@@ -1,32 +1,12 @@
#!/bin/bash
set -ex
set -e
# This script should be run at the root of the repository.
# This script is used to update googleapis_commitish, gapic_generator_version,
# and libraries_bom_version in generation configuration at the time of running
# and create a pull request.
# This script is used to update googleapis commit to latest in generation
# configuration at the time of running and create a pull request.

# The following commands need to be installed before running the script:
# 1. git
# 2. gh
# 3. jq

# Utility functions
# Get the latest released version of a Maven artifact.
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}"
}

# Update a key to a new value in the generation config.
function update_config() {
local key_word=$1
local new_value=$2
local file=$3
echo "Update ${key_word} to ${new_value} in ${file}"
sed -i -e "s/^${key_word}.*$/${key_word}: ${new_value}/" "${file}"
}

# The parameters of this script is:
# 1. base_branch, the base branch of the result pull request.
Expand Down Expand Up @@ -72,50 +52,62 @@ if [ -z "${generation_config}" ]; then
fi

current_branch="generate-libraries-${base_branch}"
title="chore: Update generation configuration at $(date)"
title="chore: update googleapis commit at $(date)"

# try to find a open pull request associated with the branch
git checkout "${base_branch}"
# Try to find a open pull request associated with the branch
pr_num=$(gh pr list -s open -H "${current_branch}" -q . --json number | jq ".[] | .number")
# create a branch if there's no open pull request associated with the
# Create a branch if there's no open pull request associated with the
# branch; otherwise checkout the pull request.
if [ -z "${pr_num}" ]; then
git checkout -b "${current_branch}"
# Push the current branch to remote so that we can
# compare the commits later.
git push -u origin "${current_branch}"
else
gh pr checkout "${pr_num}"
fi

# Only allow fast-forward merging; exit with non-zero result if there's merging
# conflict.
git merge -m "chore: merge ${base_branch} into ${current_branch}" "${base_branch}"

mkdir tmp-googleapis
# use partial clone because only commit history is needed.
# Use partial clone because only commit history is needed.
git clone --filter=blob:none https://github.com/googleapis/googleapis.git tmp-googleapis
pushd tmp-googleapis
git pull
latest_commit=$(git rev-parse HEAD)
popd
rm -rf tmp-googleapis
update_config "googleapis_commitish" "${latest_commit}" "${generation_config}"

# update gapic-generator-java version to the latest
latest_version=$(get_latest_released_version "com.google.api" "gapic-generator-java")
update_config "gapic_generator_version" "${latest_version}" "${generation_config}"

# update libraries-bom version to the latest
latest_version=$(get_latest_released_version "com.google.cloud" "libraries-bom")
update_config "libraries_bom_version" "${latest_version}" "${generation_config}"
sed -i -e "s/^googleapis_commitish.*$/googleapis_commitish: ${latest_commit}/" "${generation_config}"

git add "${generation_config}"
changed_files=$(git diff --cached --name-only)
if [[ "${changed_files}" == "" ]]; then
echo "The latest generation config is not changed."
echo "The latest googleapis commit is not changed."
echo "Skip committing to the pull request."
else
git commit -m "${title}"
fi

# There are potentially at most two commits: merge commit and change commit.
# We want to exit the script if no commit happens (otherwise this will be an
# infinite loop).
# `git cherry` is a way to find whether the local branch has commits that are
# not in the remote branch.
# If we find any such commit, push them to remote branch.
unpushed_commit=$(git cherry -v "origin/${current_branch}" | wc -l)
if [[ "${unpushed_commit}" -eq 0 ]]; then
echo "No unpushed commits, exit"
exit 0
fi
git commit -m "${title}"

if [ -z "${pr_num}" ]; then
git remote add remote_repo https://cloud-java-bot:"${GH_TOKEN}@github.com/${repo}.git"
git fetch -q --unshallow remote_repo
git fetch -q remote_repo
git push -f remote_repo "${current_branch}"
gh pr create --title "${title}" --head "${current_branch}" --body "${title}" --base "${base_branch}"
else
git push
gh pr edit "${pr_num}" --title "${title}" --body "${title}"
fi
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.50.0
- uses: googleapis/sdk-platform-java/.github/scripts@v2.51.0
if: env.SHOULD_RUN == 'true'
with:
base_ref: ${{ github.base_ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unmanaged_dependency_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ jobs:
shell: bash
run: .kokoro/build.sh
- name: Unmanaged dependency check
uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.40.0
uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.41.0
with:
bom-path: google-cloud-bigtable-bom/pom.xml
2 changes: 1 addition & 1 deletion .kokoro/presubmit/graalvm-native-17.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.40.0"
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.41.0"
}

env_vars: {
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/presubmit/graalvm-native.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.40.0"
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.41.0"
}

env_vars: {
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## [2.51.0](https://github.com/googleapis/java-bigtable/compare/v2.50.0...v2.51.0) (2024-12-17)


### Features

* Introduce `java.time` ([#2415](https://github.com/googleapis/java-bigtable/issues/2415)) ([bb96c3e](https://github.com/googleapis/java-bigtable/commit/bb96c3e395793ba324cf658bb4c985d4315cf781))


### Bug Fixes

* **deps:** Update the Java code generator (gapic-generator-java) to 2.51.0 ([a5444a5](https://github.com/googleapis/java-bigtable/commit/a5444a545ec61a1520716dfafb6f62b7e39df1c7))
* Move resource detection to the first export to avoid slow start ([#2450](https://github.com/googleapis/java-bigtable/issues/2450)) ([cec010a](https://github.com/googleapis/java-bigtable/commit/cec010aa64f2b190f8e742915be41baae2ad2083))


### Dependencies

* Update sdk-platform-java dependencies ([#2448](https://github.com/googleapis/java-bigtable/issues/2448)) ([825e717](https://github.com/googleapis/java-bigtable/commit/825e717e9d8ae3853d7509d0849b58f2c47c9803))

## [2.50.0](https://github.com/googleapis/java-bigtable/compare/v2.49.0...v2.50.0) (2024-12-06)


Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,28 +41,28 @@ If you are using Maven without the BOM, add this to your dependencies:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigtable</artifactId>
<version>2.48.0</version>
<version>2.50.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.50.0')
implementation platform('com.google.cloud:libraries-bom:26.51.0')
implementation 'com.google.cloud:google-cloud-bigtable'
```
If you are using Gradle without BOM, add this to your dependencies:

```Groovy
implementation 'com.google.cloud:google-cloud-bigtable:2.50.0'
implementation 'com.google.cloud:google-cloud-bigtable:2.51.0'
```

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

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-bigtable" % "2.50.0"
libraryDependencies += "com.google.cloud" % "google-cloud-bigtable" % "2.51.0"
```

## Authentication
Expand Down Expand Up @@ -543,7 +543,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-bigtable/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-bigtable.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigtable/2.50.0
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigtable/2.51.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.50.0
googleapis_commitish: 349841abac6c3e580ccce6e3d6fcc182ed2512c2
libraries_bom_version: 26.50.0
gapic_generator_version: 2.51.0
googleapis_commitish: f4eff5440fd07389f820d22d2a55690c6390dc6d
libraries_bom_version: 26.51.0
template_excludes:
- .gitignore
- .kokoro/presubmit/integration.cfg
Expand Down
18 changes: 9 additions & 9 deletions google-cloud-bigtable-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigtable-bom</artifactId>
<version>2.50.0</version><!-- {x-version-update:google-cloud-bigtable:current} -->
<version>2.51.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigtable:current} -->
<packaging>pom</packaging>
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>sdk-platform-java-config</artifactId>
<version>3.40.0</version>
<version>3.41.0</version>
<relativePath/>
</parent>

Expand Down Expand Up @@ -63,37 +63,37 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigtable</artifactId>
<version>2.50.0</version><!-- {x-version-update:google-cloud-bigtable:current} -->
<version>2.51.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigtable:current} -->
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigtable-emulator</artifactId>
<version>0.187.0</version><!-- {x-version-update:google-cloud-bigtable-emulator:current} -->
<version>0.188.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigtable-emulator:current} -->
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigtable-emulator-core</artifactId>
<version>0.187.0</version><!-- {x-version-update:google-cloud-bigtable-emulator:current} -->
<version>0.188.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigtable-emulator:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-bigtable-admin-v2</artifactId>
<version>2.50.0</version><!-- {x-version-update:grpc-google-cloud-bigtable-admin-v2:current} -->
<version>2.51.1-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-bigtable-admin-v2:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-bigtable-v2</artifactId>
<version>2.50.0</version><!-- {x-version-update:grpc-google-cloud-bigtable-v2:current} -->
<version>2.51.1-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-bigtable-v2:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-bigtable-admin-v2</artifactId>
<version>2.50.0</version><!-- {x-version-update:proto-google-cloud-bigtable-admin-v2:current} -->
<version>2.51.1-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-bigtable-admin-v2:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-bigtable-v2</artifactId>
<version>2.50.0</version><!-- {x-version-update:proto-google-cloud-bigtable-v2:current} -->
<version>2.51.1-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-bigtable-v2:current} -->
</dependency>
</dependencies>
</dependencyManagement>
Expand Down
6 changes: 3 additions & 3 deletions google-cloud-bigtable-deps-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>sdk-platform-java-config</artifactId>
<version>3.40.0</version>
<version>3.41.0</version>
<relativePath/>
</parent>

<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigtable-deps-bom</artifactId>
<version>2.50.0</version><!-- {x-version-update:google-cloud-bigtable:current} -->
<version>2.51.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigtable:current} -->

<packaging>pom</packaging>
<description>
Expand Down Expand Up @@ -67,7 +67,7 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>gapic-libraries-bom</artifactId>
<version>1.48.0</version>
<version>1.49.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
4 changes: 2 additions & 2 deletions google-cloud-bigtable-emulator-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<parent>
<artifactId>google-cloud-bigtable-parent</artifactId>
<groupId>com.google.cloud</groupId>
<version>2.50.0</version><!-- {x-version-update:google-cloud-bigtable:current} -->
<version>2.51.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigtable:current} -->
</parent>

<artifactId>google-cloud-bigtable-emulator-core</artifactId>
<version>0.187.0</version><!-- {x-version-update:google-cloud-bigtable-emulator:current} -->
<version>0.188.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigtable-emulator:current} -->

<description>
A Java wrapper for the Cloud Bigtable emulator.
Expand Down
10 changes: 5 additions & 5 deletions google-cloud-bigtable-emulator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>

<artifactId>google-cloud-bigtable-emulator</artifactId>
<version>0.187.0</version><!-- {x-version-update:google-cloud-bigtable-emulator:current} -->
<version>0.188.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigtable-emulator:current} -->
<name>Google Cloud Java - Bigtable Emulator</name>
<url>https://github.com/googleapis/java-bigtable</url>
<description>
Expand All @@ -14,7 +14,7 @@
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigtable-parent</artifactId>
<version>2.50.0</version><!-- {x-version-update:google-cloud-bigtable:current} -->
<version>2.51.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigtable:current} -->
</parent>
<scm>
<connection>scm:git:[email protected]:googleapis/java-bigtable.git</connection>
Expand Down Expand Up @@ -81,14 +81,14 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigtable-deps-bom</artifactId>
<version>2.50.0</version><!-- {x-version-update:google-cloud-bigtable:current} -->
<version>2.51.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigtable:current} -->
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigtable-bom</artifactId>
<version>2.50.0</version><!-- {x-version-update:google-cloud-bigtable:current} -->
<version>2.51.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigtable:current} -->
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -99,7 +99,7 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigtable-emulator-core</artifactId>
<version>0.187.0</version><!-- {x-version-update:google-cloud-bigtable-emulator:current} -->
<version>0.188.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigtable-emulator:current} -->
</dependency>

<dependency>
Expand Down
Loading

0 comments on commit 5071c8b

Please sign in to comment.