Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: linkage monitor GitHub Actions for Java repository template #933

Merged
merged 2 commits into from
Feb 2, 2021

Conversation

suztomo
Copy link
Member

@suztomo suztomo commented Jan 29, 2021

@stephaniewang526 @chingor13

This PR migrates the Java library repositories to use the versioned action through cloud-opensource-java repository. Previously the Linkage Monitor was not versioned and caused unexpected problem in past (GoogleCloudPlatform/cloud-opensource-java#1838). To have proper versioning of the tool, we have prepared a versioned Linkage Monitor through GoogleCloudPlatform/cloud-opensource-java/linkage-monitor@v1-linkagemonitor.

As we no longer need curl to download the uber JAR, we don't need linkage-monitor.sh, I put the Maven install command in ci.yaml.

Details of the background: go/jdd-github-actions.

CC: @elharo

What is Linkage Monitor

Linkage Monitor works as a presubmit check in a GitHub repository to prevent open source libraries in the Google Cloud Java orbit (GAX, google-http-java-client, gRPC, etc.) from releasing versions that would introduce new linkage errors.

More on https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/Linkage-Monitor

What did I test?

I tested this yaml file in java-spanner and it worked.

https://github.com/googleapis/java-spanner/pull/831/files#diff-944291df2c9c06359d37cc8833d182d705c9e8c3108e7cfe132d61a06e9133ddR57

@suztomo suztomo requested a review from a team as a code owner January 29, 2021 19:31
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Jan 29, 2021
Comment on lines -33 to -39
retry_with_backoff 3 10 \
mvn install -B -V \
-DskipTests=true \
-Dclirr.skip=true \
-Denforcer.skip=true \
-Dmaven.javadoc.skip=true \
-Dgcloud.download.skip=true
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This command is now part of ci.yaml

Comment on lines -41 to -46
# Kokoro job cloud-opensource-java/ubuntu/linkage-monitor-gcs creates this JAR
JAR=linkage-monitor-latest-all-deps.jar
curl -v -O "https://storage.googleapis.com/cloud-opensource-java-linkage-monitor/${JAR}"

# Fails if there's new linkage errors compared with baseline
java -jar ${JAR} com.google.cloud:libraries-bom
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These commands are done at the new action specified at GoogleCloudPlatform/cloud-opensource-java/linkage-monitor@v1-linkagemonitor. GoogleCloudPlatform/cloud-opensource-java@a7f4d63#diff-83a64340a0cc2b591f154efe6cc2f4928d0391788f54d76966bde9b7cb12d36cR10 (See the curl command downloads the versioned uber JAR)

@suztomo suztomo changed the title chore: linkage monitor GitHub Actions chore: linkage monitor GitHub Actions for Java repository template Jan 29, 2021
@suztomo
Copy link
Member Author

suztomo commented Feb 2, 2021

@Neenu1995 I see you got assigned to this. Let me know if you need any clarification.

Copy link
Contributor

@chingor13 chingor13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you send a PR to any one of the libraries to test it out? Then we'll merge this one if it passes.

@chingor13
Copy link
Contributor

Can you send a PR to any one of the libraries to test it out? Then we'll merge this one if it passes.

Oh I see it was done in spanner.

@chingor13 chingor13 merged commit e935c9e into googleapis:master Feb 2, 2021
@suztomo
Copy link
Member Author

suztomo commented Feb 2, 2021

Thank you.

@suztomo suztomo deleted the linkage_monitor_github_actions branch February 2, 2021 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants