Repository navigation
Description
Problem
We'd like to see the libraries in LTS BOM are compatible with each other. This is not just for Java class file signature but also for behavioral change.
Idea: run the tests with LTS BOM
To capture behavioral change, we can leverage the tests in the repository of the each library in LTS BOM.
For example, if I want to check the compatibility of protobuf-java in LTS BOM and grpc-protobuf, then I can modify build.gradle to include api enforcedPlatform('com.google.cloud:gcp-lts-bom:0.1.0-SNAPSHOT') to see the compatibility.
I checkout grpc-java Git repository and insert the enforcedPlatform to one of build.gradle:
suztomo@suztomo:~/grpc-java$ git diff
diff --git a/protobuf/build.gradle b/protobuf/build.gradle
index af7f51c83..1c00e0a63 100644
--- a/protobuf/build.gradle
+++ b/protobuf/build.gradle
@@ -10,6 +10,8 @@ plugins {
description = 'gRPC: Protobuf'
dependencies {
+ api enforcedPlatform('com.google.cloud:gcp-lts-bom:0.1.0-SNAPSHOT')
+
api project(':grpc-api'),
libraries.jsr305,
libraries.protobuf
If the tests pass, then the LTS BOM is compatible with the grpc-protobuf.
suztomo@suztomo:~/grpc-java$ ./gradlew :grpc-protobuf:check
*** Skipping the build of codegen and compilation of proto files because skipCodegen=true
* Skipping the build of Android projects because skipAndroid=true
BUILD SUCCESSFUL in 3s
19 actionable tasks: 1 executed, 18 up-to-date
Implementation Design
Repositories
Checkout the following repositories with a release tag.
- Beam
- org.apache.beam:beam-sdks-java-core
- org.apache.beam:beam-sdks-java-extensions-google-cloud-platform-core
- org.apache.beam:beam-runners-google-cloud-dataflow-java
- org.apache.beam:beam-sdks-java-io-google-cloud-platform
- grpc-java
- java-spanner
- google-cloud-spanner
Checking out a specific revision
For example, to checkout java-spannner repository with a specific release tag, run the following command:
git clone -b v4.0.1 --depth=1 https://github.com/googleapis/java-spanner
For Gradle project
For the target modules, insert the BOM after keyword "dependencies":
dependencies {
so that it would look like:
dependencies {
+ api enforcedPlatform('com.google.cloud:gcp-lts-bom:0.1.0-SNAPSHOT')
+
Activity
[-]Idea: checking LTS bomand [/-][+]Idea: checking the behavioral compatibility in the libraries in the LTS BOM[/+]suztomo commentedon Mar 9, 2021
Start with a shell script to
For unit tests. Think about Integration tests later.
For pom.xml, fill version element from the value in the LTS BOM.
suztomo commentedon Mar 11, 2021
I picked java-spanner's v4.0.1 tag as the starter and I ran the same command as .github/workflow/ci.yaml (without modifying any code) and the build fails on my cloudtop. Why?
It works with v5.0.0 tag.
suztomo commentedon Mar 15, 2021
While writing code for it (https://github.com/GoogleCloudPlatform/cloud-opensource-java/tree/lts_tests), I found that java-spanner project (google-cloud-spanner) does not compile with Guava 30.1-jre (It builds with 30.1-android). In both my MacBook and Cloudtop (Linux).
https://gist.github.com/suztomo/bfb4765ad9e32a59f0d8d786f1092232
These classes are simple interface from Guava.
Why doesn't the Java compiler choose to use Guava's
com.google.common.base.Predicate?Example PR that shows the strange compilation failure: googleapis/java-spanner#959
suztomo commentedon Mar 16, 2021
I think the compiler plugin's source/target 1.7 is causing the compilation failure:
in the google-cloud-shared-config:
If that's the case, then we cannot build the Yoshi repositories with Guava JRE flavor.
suztomo commentedon Mar 19, 2021
The Maven surefire plugin has configuration to set runtime class path (document).
For each library, I need to supply 2 things in surefire configuration (
<project>/<build>/<plugins>/<plugin>):For example, when I want to run the java-spanner test with very old Guava version, I supply the configuration:
It worked as expected:
suztomo commentedon Mar 23, 2021
google-http-java-client/google-http-client-appengine failed:
Does this mean the google-http-client-appengine v1.39.1 does not work with appengine-api-1.0-sdk 1.9.86?
The google-http-client-appengine master uses 1.9.71.
But the master branch of google-http-client-appengine with 1.9.86 just works fine. Maybe there's problem in supplying newer version in the test class path?
This causes problem;
I don't see
com.google.appengine.repackaged.com.google.common.collect.HashMultisetdefines theaddmethod as final in the newer version 1.9.86:The old version 1.9.71 defines it as final.
How come
HashMultisetis from appengine-api-1.0-sdk version 1.9.86 and its parentAbstractMapBasedMultisetis from version 1.9.71?suztomo commentedon Mar 24, 2021
The test in google-auth-library-java's appengine module doesn't run. Skipping it for now.
suztomo commentedon Mar 24, 2021
java-bigtable-hbase fails with
java.lang.NoClassDefFoundError: com/google/api/services/bigquery/model/TableRow.https://gist.github.com/suztomo/7c3a50d3ab03f0ee62ec00f3ded3d262
The test runs fine if there's no test-runtime dependency override.
com.google.apis:google-api-services-bigquery:v2-rev20200719-1.30.10 has the class.
suztomo commentedon Mar 24, 2021
Google Map Services needed to have
mavenLocalin repository section of build.gradle.elharo commentedon Mar 25, 2021
It might be a good idea to file bugs in the respective repos for individual failures you're uncovering. We should fix these at head ASAP to have a chance of getting them into the June release.
suztomo commentedon Mar 25, 2021
Yes, I'll do.
So far I observe that most of the issues above are due to the behaviors of this test tool (such as the need to add
mavenLocal). Still there are genuine problem, such as pom.xml without name space declaration.suztomo commentedon May 4, 2021
The build that worked fine at the time of the release of a library might not work later due to unstable (or retired) repositories. google-http-java-client repository at git tag
v1.31.3does not work any more due todl.bintray.comreturning 403.