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

Add a backwards compatibility check for .proto files #1362

Merged
merged 1 commit into from
Jul 12, 2024

Conversation

nakulj
Copy link
Contributor

@nakulj nakulj commented Jul 8, 2024

Issue #, if available:

Description of changes:
In # 1361 we skip backwards compatibility tests for proto files because they were too brittle. By using protolock through this maven plugin we can instead test the proto files directly instead of inspecting the generated Java code, which is better because:

  1. It lets us ignore implementation specific details such as inheriting methods vs implementing them in the wrapper class directly
  2. It lets us catch problems like reassigning field numbers or forgetting to reserve deleted field numbers, which would be missed by simply inspecting the generated code.

To verify that this works locally, I made a basic incompatible change and verified that the check failed:

$ perl -pi -e 's,key = 1,key = 8,g' amazon-kinesis-client/src/main/proto/messages.proto
$ mvn proto-backwards-compatibility:backwards-compatibility-check -pl amazon-kinesis-client

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@nakulj nakulj requested a review from vincentvilo-aws July 8, 2024 19:06
@nakulj nakulj force-pushed the proto-backwards-compat branch from e78441c to 2b3e7a7 Compare July 12, 2024 16:48
@nakulj nakulj merged commit 5878ba8 into awslabs:master Jul 12, 2024
2 checks passed
@nakulj nakulj deleted the proto-backwards-compat branch July 12, 2024 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants