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

deps: updates build to compile with LTS JDK and bumps deps #204

Merged
merged 10 commits into from
Jan 4, 2024

Conversation

codefromthecrypt
Copy link
Member

This moves to the same build infra as the rest of Zipkin, notably to allow compiling on JDK 11, 17 and 21. This also bumps all the dependencies and ports to junit jupiter (used by brave now).

This also migrates to junit5 which began with the helpful @TeamModerne tool, but needed a lot of fixing up due to custom rules.

./mvnw org.openrewrite.maven:rewrite-maven-plugin:run \
  -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-testing-frameworks:LATEST \
  -Drewrite.activeRecipes=org.openrewrite.java.testing.junit5.JUnit4to5Migration

I intentionally raised this on a shared branch as I'm out of time. If someone can finish up the rest of it, many thanks. Notably, I think I messed up porting the SQS extension (some tests pass some hang). Also, there's a need to replace the environment rule with something. Pinging @timetebeek, but really anyone who is good at jupiter could give a swing and let this project release again after merge!

This moves to the same build infra as the rest of Zipkin, notably to allow compiling on JDK 11, 17 and 21. This also bumps all the dependencies.

This also migrates to junit5 which began with the helpful @TeamModerne tool, but needed a lot of fixing up due to custom rules.
```
./mvnw org.openrewrite.maven:rewrite-maven-plugin:run \
  -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-testing-frameworks:LATEST \
  -Drewrite.activeRecipes=org.openrewrite.java.testing.junit5.JUnit4to5Migration
```

Signed-off-by: Adrian Cole <adrian@tetrate.io>
public MockWebServer mockServer = new MockWebServer();

// TODO: replace this with jupiter
@Rule
public EnvironmentVariables environmentVariables = new EnvironmentVariables();
Copy link
Member

@shakuzen shakuzen Dec 18, 2023

Choose a reason for hiding this comment

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

We've used https://github.com/webcompere/system-stubs in Micrometer for setting environment variables in tests with Jupiter.

@codefromthecrypt
Copy link
Member Author

@reta if you have free time, do you mind trying to progress this? While the project is zipkin-aws proceeding doesn't need an aws account. There is some work to do porting off junit 4 environment rule and also figuring out why the mock sqs setup I tried to port to jupiter doesn't work. It is fine to use a different sqs mock or even a docker testcontainer instead. Push any commits you like and feel free to do anything including force pushing or squashing. When you've moved as far as you can, please summarize in a comment, even if incomplete still. Cheers!

@reta
Copy link
Contributor

reta commented Dec 31, 2023

@reta if you have free time, do you mind trying to progress this?

Sure @codefromthecrypt , I will work on it

@codefromthecrypt
Copy link
Member Author

nice to see some commits going 🙇‍♂️

@reta
Copy link
Contributor

reta commented Jan 4, 2024

@codefromthecrypt it seems like we are in good shape :-) anything else you have in mind for this change?

Copy link
Member Author

@codefromthecrypt codefromthecrypt left a comment

Choose a reason for hiding this comment

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

Thanks very much @reta, you did it!

Next step is to merge this and then push a tag release-0.24.0 and once that's done make GH release from that tag in the same style as the latest on zipkin-gcp.

These notes are in RELEASE.md, but the jist is only this.

HttpTracing httpTracing = HttpTracing.create(tracing);
environmentVariables.set("AWS_REGION", "us-east-1");
variables.set("AWS_REGION", "us-east-1");
Copy link
Member Author

Choose a reason for hiding this comment

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

cool

try {
AggregatedHttpRequest signed = sign(ctx, aggReg);
return unwrap().execute(ctx, signed.toHttpRequest());
final HttpRequest httpRequest = signed.toHttpRequest();
Copy link
Member Author

Choose a reason for hiding this comment

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

not terrible drift considering the years passed!

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah! kudos to you man!

@@ -63,7 +63,7 @@ abstract class AbstractSender extends Sender {

boolean isAscii(byte[] encodedSpans) {
for (int i = 0; i < encodedSpans.length; i++) {
if (encodedSpans[i] >= 0x80) {
if (Byte.toUnsignedInt(encodedSpans[i]) >= 0x80) {
Copy link
Member Author

Choose a reason for hiding this comment

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

interesting

Copy link
Contributor

Choose a reason for hiding this comment

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

so byte is signed [-128 to 127], and 0x80 is exactly -128, the comparison to 0x80 was actually lifting byte to int

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks, might want to github search the whole org and also openzipkin-contrib in case this bug is elsewhere via copy/pasta!

@codefromthecrypt codefromthecrypt marked this pull request as ready for review January 4, 2024 23:44
@codefromthecrypt codefromthecrypt merged commit 498be65 into master Jan 4, 2024
3 checks passed
@codefromthecrypt codefromthecrypt deleted the new-build branch January 4, 2024 23:45
@codefromthecrypt
Copy link
Member Author

@reta so when we merge, we always squash and retain co-author tags, but tidy up the message so it isn't like a list of interim commits. Over to you for the release and looking forward to you pinging it on the zipkin gitter channel, too when done. :shipit: 🚀

Screenshot 2024-01-05 at 07 45 32

@codefromthecrypt
Copy link
Member Author

@reta ps one thing in RELEASE.md it says for the first release of the year, make sure the pom.xml license headers are up to date. If they aren't the release will fail. so you want to do something like this to make sure they are bumped.. or check manually https://github.com/openzipkin/zipkin-aws/blob/master/RELEASE.md#first-release-of-the-year

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.

3 participants