Skip to content

java: google-cloud-java patch version bump breaks librarian version assumption #6244

Description

@zhumin8

(To scope this: this affect README.md generation when a partial release is done. When last release is a patch release, librarian generated README.md has wrong versions.
When regular releases that bumps minor, no such generate issue.)
In readme generation, we assumed released version can be worked out from current version:

// deriveLastReleasedVersion derives the last released version from a snapshot version
// (e.g., x.y.z-SNAPSHOT or x.y.z-beta-SNAPSHOT) by decrementing the patch or minor version.
// If the version has a prerelease tag (like "beta") before "SNAPSHOT", that tag is preserved
// in the derived version (e.g., x.y.z-beta-SNAPSHOT becomes x.y.(z-1)-beta).
//
// It returns an error if both minor and patch versions are zero, as it's
// ambiguous what the last released version was in that case.
func deriveLastReleasedVersion(v string) (string, error) {

This assumption is based on google-cloud-java uses release-please "versioning": "always-bump-minor",.

https://github.com/googleapis/google-cloud-java/blob/dcc2a68b7cfc36ffcfa7e34e3ce91253a4cca074/release-please-config.json#L4

This assumption does not hold true in recent manual partial releases https://github.com/googleapis/google-cloud-java/releases/tag/v1.86.2

As result, seeing generation diffs in recent check for googleapis/google-cloud-java#13319

Run git diff --exit-code
diff --git a/java-bigtable/README.md b/java-bigtable/README.md
index 07882cc1fc0..c8a2b142ba7 100644
--- a/java-bigtable/README.md
+++ b/java-bigtable/README.md
@@ -56,13 +56,13 @@ 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.78.1'
+implementation 'com.google.cloud:google-cloud-bigtable:2.78.0'
 ```
 
 If you are using SBT, add this to your dependencies:
 
 ```Scala
-libraryDependencies += "com.google.cloud" % "google-cloud-bigtable" % "2.78.1"
+libraryDependencies += "com.google.cloud" % "google-cloud-bigtable" % "2.78.0"
 ```
 
 ## Authentication
@@ -452,7 +452,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
 [javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-bigtable/latest/history
 [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.78.1
+[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigtable/2.78.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
Error: Process completed with exit code 1.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions