Skip to content

Commit 326645e

Browse files
Merge branch 'googleapis:main' into main
2 parents 739b424 + 05df6bd commit 326645e

File tree

4,056 files changed

+708012
-80519
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,056 files changed

+708012
-80519
lines changed

.github/release-please.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,8 @@ branches:
3333
manifest: true
3434
handleGHRelease: true
3535
branch: 1.58.x
36+
- primaryBranch: main
37+
releaseType: java-yoshi
38+
manifest: true
39+
handleGHRelease: true
40+
branch: protobuf-4.x-rc
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
google-cloud-asset:1.2.3:1.2.3

.github/release/partial_release.py

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
class VersionType(Enum):
2525
MAJOR = (1,)
2626
MINOR = (2,)
27-
PATCH = 3
27+
PATCH = (3,)
28+
SNAPSHOT = (4,)
2829

2930

3031
@click.group(invoke_without_command=False)
@@ -34,6 +35,27 @@ def main(ctx):
3435
pass
3536

3637

38+
@main.command()
39+
@click.option(
40+
"--artifact-ids",
41+
required=True,
42+
type=str,
43+
help="""
44+
Artifact IDs whose version needs to update, separated by comma.
45+
""",
46+
)
47+
@click.option(
48+
"--versions",
49+
required=False,
50+
default="./versions.txt",
51+
type=str,
52+
help="""
53+
The path to the versions.txt.
54+
""",
55+
)
56+
def bump_snapshot_version(artifact_ids: str, versions: str) -> None:
57+
bump_version(artifact_ids, "snapshot", versions)
58+
3759
@main.command()
3860
@click.option(
3961
"--artifact-ids",
@@ -49,7 +71,7 @@ def main(ctx):
4971
default="patch",
5072
type=str,
5173
help="""
52-
The type of version bump, one of major, minor or patch.
74+
The type of version bump, one of major, minor, patch.
5375
""",
5476
)
5577
@click.option(
@@ -62,6 +84,9 @@ def main(ctx):
6284
""",
6385
)
6486
def bump_released_version(artifact_ids: str, version_type: str, versions: str) -> None:
87+
bump_version(artifact_ids, version_type, versions)
88+
89+
def bump_version(artifact_ids: str, version_type: str, versions: str) -> None:
6590
target_artifact_ids = set(artifact_ids.split(","))
6691
version_enum = _parse_type_or_raise(version_type)
6792
newlines = []
@@ -95,6 +120,12 @@ def bump_released_version(artifact_ids: str, version_type: str, versions: str) -
95120
minor += 1
96121
case VersionType.PATCH:
97122
patch += 1
123+
case VersionType.SNAPSHOT:
124+
# Keep the released version as is.
125+
newlines.append(
126+
f"{artifact_id}:{major}.{minor}.{patch}:{major}.{minor + 1}.0-SNAPSHOT"
127+
)
128+
continue
98129
newlines.append(
99130
f"{artifact_id}:{major}.{minor}.{patch}:{major}.{minor}.{patch}"
100131
)

.github/release/release_unit_tests.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import shutil
55
import tempfile
66
import unittest
7-
from partial_release import bump_released_version
7+
from partial_release import bump_released_version, bump_snapshot_version
88

99
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
1010
GOLDEN = os.path.join(SCRIPT_DIR, "testdata")
@@ -45,6 +45,22 @@ def test_bump_multiple_versions_success(self):
4545
actual = f.read()
4646
self.assertEqual(expected, actual)
4747

48+
def test_bump_snapshot_version_success(self):
49+
golden = f"{GOLDEN}/snapshot/versions-snapshot-golden.txt"
50+
with copied_fixtures_dir(f"{FIXTURES}/snapshot"):
51+
runner.invoke(
52+
bump_snapshot_version,
53+
[
54+
"--artifact-ids=google-cloud-asset",
55+
"--versions=versions-snapshot.txt",
56+
],
57+
)
58+
with open(golden) as g:
59+
expected = g.read()
60+
with open("./versions-snapshot.txt") as f:
61+
actual = f.read()
62+
self.assertEqual(expected, actual)
63+
4864

4965
@contextlib.contextmanager
5066
def change_dir_to(path: str) -> str:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
google-cloud-asset:1.2.3:1.3.0-SNAPSHOT

generation/apply_current_versions.sh

Lines changed: 0 additions & 26 deletions
This file was deleted.

generation/apply_versions.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
3+
# This script sets the "current-version" written in versions.txt applied to all
4+
# pom.xml files in this monorepo.
5+
# This script plays supplemental role just in case Release Please pull request
6+
# fails to update all files.
7+
8+
# Usage:
9+
# # Run this script at the root of the monorepo
10+
# bash generation/apply_current_versions.sh
11+
12+
set -e
13+
14+
versions_file=$1
15+
column_name=$2
16+
if [[ -z "$versions_file" || -z "$column_name" ]]; then
17+
echo "Replaces the versions annotated with the x-version-update tag in"
18+
echo "all pom.xml files in the current working directory and its subdirectories"
19+
echo "with the versions specified in the versions.txt file (current or released)."
20+
echo
21+
echo "Usage: $0 path/to/versions.txt (released|current)"
22+
exit 1
23+
fi
24+
if [[ "$column_name" == "released" ]]; then
25+
column_index=2
26+
elif [[ "$column_name" == "current" ]]; then
27+
column_index=3
28+
elif "$column_name" != "current" ]]; then
29+
echo "Error: column_name must be either 'released' or 'current'"
30+
exit 1
31+
fi
32+
33+
34+
SED_OPTIONS=""
35+
36+
# The second column is
37+
for KV in $(cut -f1,"${column_index}" -d: $versions_file |grep -v "#"); do
38+
K=${KV%:*}; V=${KV#*:}
39+
echo Key:$K, Value:$V;
40+
SED_OPTIONS="$SED_OPTIONS -e /x-version-update:$K:current/{s|<version>.*<\/version>|<version>$V<\/version>|;}"
41+
done
42+
43+
echo "Running sed command. It may take few minutes."
44+
find . -maxdepth 3 -name pom.xml |sort --dictionary-order |xargs sed -i.bak $SED_OPTIONS
45+
find . -maxdepth 3 -name pom.xml.bak |xargs rm

generation_config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
gapic_generator_version: 2.64.1
2-
googleapis_commitish: ba80e9b5251c974d18c3c25fa905e2d0ae4a0f02
3-
libraries_bom_version: 26.71.0
2+
googleapis_commitish: bfdeefc22ce661d0b0efb68c83c2afd5a3aa9c2c
3+
libraries_bom_version: 26.72.0
44

55
# the libraries are ordered with respect to library name, which is
66
# java-{library.library_name} or java-{library.api-shortname} when

java-accessapproval/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
2020
<dependency>
2121
<groupId>com.google.cloud</groupId>
2222
<artifactId>libraries-bom</artifactId>
23-
<version>26.71.0</version>
23+
<version>26.72.0</version>
2424
<type>pom</type>
2525
<scope>import</scope>
2626
</dependency>
@@ -42,20 +42,20 @@ If you are using Maven without the BOM, add this to your dependencies:
4242
<dependency>
4343
<groupId>com.google.cloud</groupId>
4444
<artifactId>google-cloud-accessapproval</artifactId>
45-
<version>2.79.0</version>
45+
<version>2.81.0</version>
4646
</dependency>
4747
```
4848

4949
If you are using Gradle without BOM, add this to your dependencies:
5050

5151
```Groovy
52-
implementation 'com.google.cloud:google-cloud-accessapproval:2.79.0'
52+
implementation 'com.google.cloud:google-cloud-accessapproval:2.81.0'
5353
```
5454

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

5757
```Scala
58-
libraryDependencies += "com.google.cloud" % "google-cloud-accessapproval" % "2.79.0"
58+
libraryDependencies += "com.google.cloud" % "google-cloud-accessapproval" % "2.81.0"
5959
```
6060

6161
## Authentication
@@ -194,7 +194,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
194194
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html
195195
[stability-image]: https://img.shields.io/badge/stability-stable-green
196196
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-accessapproval.svg
197-
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-accessapproval/2.79.0
197+
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-accessapproval/2.81.0
198198
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
199199
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
200200
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles

java-accesscontextmanager/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
2020
<dependency>
2121
<groupId>com.google.cloud</groupId>
2222
<artifactId>libraries-bom</artifactId>
23-
<version>26.71.0</version>
23+
<version>26.72.0</version>
2424
<type>pom</type>
2525
<scope>import</scope>
2626
</dependency>
@@ -42,20 +42,20 @@ If you are using Maven without the BOM, add this to your dependencies:
4242
<dependency>
4343
<groupId>com.google.cloud</groupId>
4444
<artifactId>google-identity-accesscontextmanager</artifactId>
45-
<version>1.79.0</version>
45+
<version>1.81.0</version>
4646
</dependency>
4747
```
4848

4949
If you are using Gradle without BOM, add this to your dependencies:
5050

5151
```Groovy
52-
implementation 'com.google.cloud:google-identity-accesscontextmanager:1.79.0'
52+
implementation 'com.google.cloud:google-identity-accesscontextmanager:1.81.0'
5353
```
5454

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

5757
```Scala
58-
libraryDependencies += "com.google.cloud" % "google-identity-accesscontextmanager" % "1.79.0"
58+
libraryDependencies += "com.google.cloud" % "google-identity-accesscontextmanager" % "1.81.0"
5959
```
6060

6161
## Authentication
@@ -194,7 +194,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
194194
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html
195195
[stability-image]: https://img.shields.io/badge/stability-stable-green
196196
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-identity-accesscontextmanager.svg
197-
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-identity-accesscontextmanager/1.79.0
197+
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-identity-accesscontextmanager/1.81.0
198198
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
199199
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
200200
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles

0 commit comments

Comments
 (0)