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

update to MicroProfile Context Propagation 1.3 #343

Merged
merged 2 commits into from
Jan 10, 2022

Conversation

Ladicek
Copy link
Contributor

@Ladicek Ladicek commented Jan 6, 2022

This includes the move from Jakarta EE 8 (javax.*) to 9 (jakarta.*).

@Ladicek
Copy link
Contributor Author

Ladicek commented Jan 6, 2022

This is very much work in progress, there's a ton of test failures that I don't understand (Weld screams about unsatisfied dependencies) and I don't understand anything about resteasy-context-propagation.

@manovotn
Copy link
Contributor

manovotn commented Jan 6, 2022

Hmm, some of those error are really weird.

Error: Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.266 s <<< FAILURE! - in io.smallrye.context.test.cdi.providedBeans.ExecutorAndThreadContextInjectionTest
Error: testInjectionWithConfigurationAndSharing(io.smallrye.context.test.cdi.providedBeans.ExecutorAndThreadContextInjectionTest) Time elapsed: 0.265 s <<< ERROR!
org.jboss.weld.exceptions.DeploymentException:
WELD-001408: Unsatisfied dependencies for type ThreadContext with qualifiers @default
at injection point [UnbackedAnnotatedField] @Inject @ThreadContextConfig io.smallrye.context.test.FullStackResource.threadContext
at io.smallrye.context.test.FullStackResource.threadContext(FullStackResource.java:0)

For instance this test doesn't even use the FullStackResource but it somehow gets included. Probably discovery?

Either way, the issue seems to be with injected TC and ME instances. E.g. functionality provided by this CDI extension
@Ladicek make sure you change the META-INF entry for it accordingly, I don't see it in the current PR which would mean the extension is not working at all.
See https://github.com/smallrye/smallrye-context-propagation/blob/main/cdi/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension

@Ladicek
Copy link
Contributor Author

Ladicek commented Jan 6, 2022

Ouch, I did it again! Or forgot to do it, actually. I was struggling for quite a while with MicroProfile Fault Tolerance TCK in SmallRye Fault Tolerance, only to figure out that I've changed everything except the name of the javax.enterprise.inject.spi.Extension file in META-INF/services. Same here, obviously.

@Ladicek
Copy link
Contributor Author

Ladicek commented Jan 6, 2022

Fixed. Now, I really don't feel like dealing with NoClassDefFound javax/xml/bind/JAXBException 😆

@Ladicek
Copy link
Contributor Author

Ladicek commented Jan 6, 2022

Ah OK, that's RestAssured still depending on Jakarta EE 8 stuff.

@Ladicek
Copy link
Contributor Author

Ladicek commented Jan 6, 2022

Replaced the usage of RestAssured with Apache HTTP Client and the FullStackTest now fails with RESTEASY003880: Unable to find contextual data of type: jakarta.ws.rs.core.UriInfo. That seems to be caused by the missing resteasy-context-propagation, though I didn't really investigate.

@manovotn
Copy link
Contributor

manovotn commented Jan 6, 2022

@Ladicek the CI failure is related to formatting BTW.

That seems to be caused by the missing resteasy-context-propagation, though I didn't really investigate.

Hm, don't know about that. In this codebase I only found https://github.com/smallrye/smallrye-context-propagation/blob/main/tests/src/test/java/io/smallrye/context/storage/RESTEasyContext.java
Which seems to be a fake replacement for actual context hosted in (presumably) resteasy repo. But even this one should likely suffice for tests here?

@Ladicek
Copy link
Contributor Author

Ladicek commented Jan 6, 2022

OK, so I found that RESTEasy moved a lot of MicroProfile stuff to a separate repo https://github.com/resteasy/resteasy-microprofile, including Context Propagation, and that also entails changed Maven coordinates. What used to be org.jboss.resteasy:resteasy-context-propagation is now org.jboss.resteasy.microprofile:microprofile-context-propagation. Updated. There's a test failure now which I don't really understand :-)

@Ladicek
Copy link
Contributor Author

Ladicek commented Jan 6, 2022

OK the formatter is bloody idiotic, I changed the commented out piece of code to appease its tasteless taste.

@Ladicek
Copy link
Contributor Author

Ladicek commented Jan 6, 2022

FTR, there are some strange error messages that are caused by a bug in RESTEasy (https://issues.redhat.com/browse/RESTEASY-3073). I fixed that in resteasy/resteasy#3004

@Ladicek
Copy link
Contributor Author

Ladicek commented Jan 6, 2022

OK, that test failure was a silly mistake I made when transforming the RestAssured code to use Apache HTTP Client. All should be passing now.

@manovotn
Copy link
Contributor

manovotn commented Jan 6, 2022

OK the formatter is bloody idiotic, I changed the commented out piece of code to appease its tasteless taste.

LOL

FTR, there are some strange error messages that are caused by a bug in RESTEasy (https://issues.redhat.com/browse/RESTEASY-3073). I fixed that in resteasy/resteasy#3004

That's some dedication. Thanks for looking deep into this :-)

@Ladicek
Copy link
Contributor Author

Ladicek commented Jan 6, 2022

OK, all tests are passing, so I'm undrafting this. The 1st commit seems fine to me, though the 2nd one certainly deserves some discussion.

@Ladicek Ladicek marked this pull request as ready for review January 6, 2022 16:15
@Ladicek Ladicek force-pushed the jakarta branch 2 times, most recently from e5e8e9f to 764477b Compare January 6, 2022 16:19
manovotn
manovotn previously approved these changes Jan 7, 2022
Copy link
Contributor

@manovotn manovotn left a comment

Choose a reason for hiding this comment

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

Both commits look good to me. Thanks @Ladicek!

@@ -93,6 +96,23 @@
<artifactId>rxjava</artifactId>
<version>${version.rxjava1}</version>
</dependency>

<!-- SmallRye Parent 34 manages Weld to an older version that doesn't have JBoss Class File Writer 1.2.5.Final -->
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't there be a parent update anyway before all other SR projects move to jakarta namespace?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Parent is actually updated in this commit, and smallrye-jakarta-parent 34 should be fine. Except it has old Weld version, which leads to the infamous issue of jbossas/jboss-classfilewriter#24 :-)

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, I see. It has Weld version 4 but for some reason not the latest release :-/
Just FTR, it should be enough to just override the classfilewriter version here but having latest Weld version is likely even better.

@manovotn
Copy link
Contributor

manovotn commented Jan 7, 2022

@Ladicek I just realized; shouldn't we do a version bump as part of this PR?
I can see MP CP didn't do a major version increase (which is surprising but OK) but maybe we should? Or at least minor version bump?

Cc @FroMage

@Ladicek
Copy link
Contributor Author

Ladicek commented Jan 7, 2022

Ah good point.

I'm not sure why MP ConProp went with a minor bump, all other MP specs (that I know of) have bumped a major. I'd suggest bumping a major here, too. Let me add a commit.

@Ladicek
Copy link
Contributor Author

Ladicek commented Jan 7, 2022

Ah and one other thing -- I believe what SmallRye projects do right now is having a dedicated jakarta branch for this effort, and main stays on Jakarta EE 8 for the time being. But better to coordinate with @radcortez on that front.

This includes the move from Jakarta EE 8 (javax.*) to 9 (jakarta.*).
This is to workaround RestAssured's dependency on Jakarta EE 8.
See rest-assured/rest-assured#1510.
@Ladicek
Copy link
Contributor Author

Ladicek commented Jan 7, 2022

Bumped to 2.0.0-SNAPSHOT.

Copy link
Contributor

@manovotn manovotn left a comment

Choose a reason for hiding this comment

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

PR is LGTM, thanks for bumping the version as well.

Let's wait for @radcortez regarding the branch question before actually merging this.
I'd assume that main moves to jakarta and we create another branch for javax but that's apparently not what's planned :)

@xstefank
Copy link
Member

xstefank commented Jan 7, 2022

Let me help here. So jakarta changes should go into new jakarta branch and there should be a major bump. - https://github.com/smallrye/smallrye-config/tree/jakarta or https://github.com/smallrye/smallrye-health/tree/jakarta

@radcortez
Copy link
Member

Let me help here. So jakarta changes should go into new jakarta branch and there should be a major bump. - https://github.com/smallrye/smallrye-config/tree/jakarta or https://github.com/smallrye/smallrye-health/tree/jakarta

+1

The reason for this is because Quarkus is still on javax and most of our development is targeting Quarkus, so I believe it would be harder for us to have to backport all the work to javax.

@manovotn manovotn changed the base branch from main to jakarta January 10, 2022 09:51
@manovotn
Copy link
Contributor

I've created the jakarta branch and changed the base branch of this PR to point there.
We should be good to go now.

@manovotn manovotn merged commit 7344089 into smallrye:jakarta Jan 10, 2022
@Ladicek Ladicek deleted the jakarta branch January 10, 2022 12:43
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.

4 participants