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

ci: Add Downstream Protobuf-Java Source Compatibility Test #3405

Merged
merged 11 commits into from
Dec 12, 2024

Conversation

lqiu96
Copy link
Contributor

@lqiu96 lqiu96 commented Dec 3, 2024

Set up a nightly CI job that tests Protobuf compatibility with downstream libraries. This step of the CI job is to test source compatibility.

The nightly job will check the compatibility of these libraries with the latest in Protobuf-Java 3.x and and 4.x. This job can be manually invoked with the Protobuf-Java versions as a list.

Future steps may introduce testing for binary compatibility.

@product-auto-label product-auto-label bot added the size: m Pull request size is medium. label Dec 3, 2024
@lqiu96 lqiu96 requested a review from blakeli0 December 3, 2024 19:22
@lqiu96 lqiu96 marked this pull request as ready for review December 3, 2024 19:22
@lqiu96 lqiu96 force-pushed the downstream-protobuf-source-test branch from ec2dcf9 to bb30be6 Compare December 5, 2024 17:07
@lqiu96 lqiu96 requested a review from blakeli0 December 6, 2024 20:38
@lqiu96 lqiu96 force-pushed the downstream-protobuf-source-test branch from e6911c5 to 642930d Compare December 9, 2024 20:43
- 'release-please--branches--main'
workflow_dispatch:
inputs:
protobuf_versions:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we plan to use this for protoc testing as well? If not or not decided yet, maybe change this to something like protobuf_runtime_versions or protobuf_java_versions to make it clearer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(As of now) I don't plan to re-use this job for Protoc testing. It'll most likely be a separate job that is manually invoked to test for future Protoc RC and future versions.

I'll rename this param to reference the protobuf runtime versions

pull_request:
# Updates on Release-Please PRs
branches:
- 'release-please--branches--main'
Copy link
Collaborator

Choose a reason for hiding this comment

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

I thought this means this workflow would run on any PRs targeting 'release-please--branches--main', not PRs created from 'release-please--branches--main', can you verify it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, I see. Yeah, I think you're right. It's for the branch that it's targeting and not where it is raised from.

I think there are other (not built in) solutions for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a conditional that checks the head_ref (source branch) and the github.event type (schedule) so that it works for release please PRs and the nightly flow

strategy:
fail-fast: false
matrix:
repo:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are all of them dependent on protobuf-java? For example, I don't see java-storage-nio is dependent on protobuf-java. Or we are adding all handwritten libraries here in case they start depending on protobuf-java in the future?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I took a quick look and don't think they're all dependent on protobuf-java. java-storage-nio seems to be the odd one out that doesn't have any protobuf-java references at all and a few others have some references only in tests.

adding all handwritten libraries here in case they start depending on protobuf-java in the future

I think it'll be safer to keep all of the downstream libraries in here. Just to be safe in case there are references of Protobuf-Java added in source for downstream libraries.


# Comma-delimited list of repos to test with the local java-shared-dependencies
if [ -z "${REPOS_UNDER_TEST}" ]; then
echo "REPOS_UNDER_TEST must be set to run downstream-protobuf-source-compatibility.sh"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we provide more detailed error hint if they are not supplied? For example, what are the expected format of the input etc. Same comment for PROTOBUF_RUNTIME_VERSION below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I can add an example

cd "${scriptDir}/../.." # cd to the root of this repo
# common.sh lives in the presubmit folder
source "$scriptDir/../presubmit/common.sh"
setup_maven_mirror
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this still needed now that we are overriding the property, not building sdk-platform-java anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think we need to call setup_maven_mirror, but I kept it here for consistency with the other jobs that need to pull deps from Maven Central

I think setup_maven_mirror can be moved to a common.sh file that doesn't solely exist in the presubmit folder, but I didn't want to make that part of this PR.

Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the difference if we don't call setup_maven_mirror?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't recall the original context of using the maven mirror, but I believe it was to help speed up the CI jobs by reducing the time it takes to download the JARs. I just did a search and it doesn't look like it's being used anymore (maybe this was removed recently?).

I'll remove it since it doesn't seem to be used anymore.

Copy link

sonarcloud bot commented Dec 12, 2024

Copy link

sonarcloud bot commented Dec 12, 2024

Quality Gate Passed Quality Gate passed for 'java_showcase_integration_tests'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@lqiu96 lqiu96 merged commit d7579ba into main Dec 12, 2024
51 checks passed
@lqiu96 lqiu96 deleted the downstream-protobuf-source-test branch December 12, 2024 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants