-
Notifications
You must be signed in to change notification settings - Fork 212
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
KOGITO-6131 Enable codegen when RESTEasy reactive is used #1757
KOGITO-6131 Enable codegen when RESTEasy reactive is used #1757
Conversation
also, throws error with undertow
…y-reactive-tkobayas02
The (build) kogito-apps check has failed. Please check the logs. |
- fix test cases - temporarily disabled MissingServletCapabilityException check
b86c4ea
to
844571f
Compare
// if (capabilities.isPresent(Capability.RESTEASY) && capabilities.isMissing(Capability.SERVLET) && kogitoGenerateRestEnabled) { | ||
// throw new MissingServletCapabilityException(); | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Temporarily disabled MissingServletCapabilityException check in order to confirm if all tests run fine without servlet (undertow) dependency.
...ment/src/main/java/org/kie/kogito/quarkus/processes/deployment/ProcessesAssetsProcessor.java
Show resolved
Hide resolved
The (build) kogito-runtimes check has failed. Please check the logs. |
The (build) kogito-examples check has failed. Please check the logs. |
The (build) kogito-runtimes check has failed. Please check the logs. |
The (build) kogito-examples check has failed. Please check the logs. |
The (build) kogito-examples check has failed. Please check the logs. |
Note : In order to access static resources generated by codegen, we need to use |
import io.restassured.RestAssured; | ||
import io.restassured.http.ContentType; | ||
|
||
import static io.restassured.RestAssured.given; | ||
import static org.hamcrest.Matchers.is; | ||
|
||
@QuarkusTest | ||
@QuarkusIntegrationTest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
honest question: why are we making this change as part of this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@evacchi Sorry about not having commented on that.
For example, if I leave BasicAddIT with @QuarkusTest (and others are @QuarkusIntegrationTest. At least, OASIT requires @QuarkusIntegrationTest), I hit the BindException because quarkus keeps running across the @QuarkusIntegrationTest tests.
[ERROR] Tests run: 4, Failures: 0, Errors: 1, Skipped: 3, Time elapsed: 6.403 s <<< FAILURE! - in org.kie.kogito.integrationtests.quarkus.BasicAddIT
[ERROR] org.kie.kogito.integrationtests.quarkus.BasicAddIT.testDs1 Time elapsed: 0.001 s <<< ERROR!
java.lang.RuntimeException: java.lang.RuntimeException: Failed to start quarkus
Caused by: java.lang.RuntimeException: Failed to start quarkus
Caused by: java.lang.RuntimeException: Unable to start HTTP server
Caused by: java.util.concurrent.ExecutionException: java.net.BindException: Address already in use
Caused by: java.net.BindException: Address already in use
So I think we should not mix @QuarkusTest and @QuarkusIntegrationTest in the same integration-test phase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you should not mix them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the confirmation!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing me out to this thread @tkobayas , I would like to explore if it's feasible to produce a more meaningful help/warn message, reported in quarkusio/quarkus#28526
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks overall good. I would investigate if it's possible to do a "cleaner" check for static resource paths (i.e. use the type/add a new category). if it's too much work we can at least file a new JIRA for that and do it on the next round.
as for AdditionalStaticResourceBuildItem
I am not sure whether it is really picked up by resteasy-classic, so I am summoning @geoand's powers for confirmation. If that is the case, that would mean that we don't need to add undertow
as a forced dependency as @tkobayas was suggesting
However, please keep in mind that it looks like some metrics-related examples are breaking because a static file is missing. So either we are forgetting to register some static resources or undertow is indeed necessary.
BuildProducer<NativeImageResourceBuildItem> resource, | ||
BuildProducer<GeneratedResourceBuildItem> genResBI) { | ||
for (GeneratedFile f : generatedFiles) { | ||
if (f.category() == GeneratedFileType.Category.RESOURCE) { | ||
if (f.relativePath().startsWith(STATIC_RESOURCE_DIR)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better if we only checked the Category. In theory there is even a specific subtype:
but I don't know if we were consistent with it. I wouldn't check the path, though, it may be brittle
...ment/src/main/java/org/kie/kogito/quarkus/processes/deployment/ProcessesAssetsProcessor.java
Show resolved
Hide resolved
Using |
Summary of this PR:
|
@tkobayas |
…y-reactive-tkobayas02
hi @danielezonca ,
I think this javadoc explains well. Probably our tests in Kogito repo should align like this?:
If there is a case where Do you think it's acceptable to kogito developers? And where is the good place to document this? |
restarting the GHA build for examples. I think this can be merged if no further changes are required + the build is green |
/cc @ricardozanini BTW today GHA is on vacation 🕺 |
Not anymore. :) |
…y-reactive-tkobayas02
Thank you for re-triggering and I see a compilation error. I need to merge main again and fix. |
- Added quarkus-undertow-deployment dependency to knative eventing addon because it's no longer dependency of kogito-quarkus-common-deployment
Regarding the SonarCloud coverage report, the uncovered codes are not directly related to this PR changes. Maybe we can add more tests to increase the coverage though.... |
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-undertow-deployment</artifactId> | ||
</dependency> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ricardozanini With this PR, kogito-quarkus-common-deployment
no longer have quarkus-undertow-deployment
dependency so adding here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tkobayas the Knative add-on doesn't require explicitly undertow. I believe that it comes from the HTTP Messaging: https://github.com/quarkiverse/quarkus-reactive-messaging-http
Since you've made a lot of changes, can you please confirm if this add-on still requires undertow? Otherwise, we can remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ricardozanini Thank you for the reply. quarkus-undertow
dependency was in quarkus/addons/knative/eventing/runtime/pom.xml
. I removed it so now knative addon works without quarkus-undertow
. Tests passed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I had to add because Quarkus Maven Plugin was complaining about it. Glad that worked now that you've removed the transients.
assertReturnExpressionContains(clazz.getMethods().get(0), "customers", EventKind.CONSUMED); | ||
assertReturnExpressionContains(clazz.getMethods().get(1), "process.messagestartevent.processedcustomers", EventKind.PRODUCED); | ||
|
||
MethodDeclaration customersMethod = clazz.getMethods().stream().filter(m -> m.getNameAsString().endsWith("CONSUMED_customers")).findFirst() | ||
.orElseGet(() -> fail("Cannot find CONSUMED_customers method")); | ||
MethodDeclaration processedcustomersMethod = clazz.getMethods().stream().filter(m -> m.getNameAsString().endsWith("PRODUCED_processedcustomers")).findFirst() | ||
.orElseGet(() -> fail("Cannot find PRODUCED_processedcustomers method")); | ||
assertReturnExpressionContains(customersMethod, "customers", EventKind.CONSUMED); | ||
assertReturnExpressionContains(processedcustomersMethod, "process.messagestartevent.processedcustomers", EventKind.PRODUCED); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kostola This test failed randomly (depending on the method order) so changed. If you want to implement it differently, please change it after this PR.
GHA : Kogito Examples Build
RuleCodegenError is caused by drools (drools-model-compiler) executable-model code gen processing and the message |
Hi @evacchi , I merged main branch again and made some fixes. Currently GHA "Kogito Examples Build" failed but it's not related to this PR (https://github.com/kiegroup/kogito-runtimes/pull/1757#issuecomment-1000135842) and SonarCloud failed but I think it is not caused by this PR (https://github.com/kiegroup/kogito-runtimes/pull/1757#issuecomment-1000073247). If you think it's okay to merge (with squash), please do. Note that https://github.com/kiegroup/kogito-examples/pull/1004 has be merged as well (I re-run the tests in the PR but it's redundant). This PR has some ramifications to other kogito developers as I wrote in https://github.com/kiegroup/kogito-runtimes/pull/1757#issuecomment-996390447 and https://github.com/kiegroup/kogito-runtimes/pull/1757#issuecomment-998560583 (and I'll be off next week) so... we may delay merging until new year :) |
The (build) kogito-examples check has failed. Please check the logs. |
(build) kogito-examples : Probably a flaky test.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this effort!
…y-reactive-tkobayas02
SonarCloud Quality Gate failed. |
Again, regarding the SonarCloud coverage report, the uncovered codes are not directly related to this PR changes. Maybe we can add more tests to increase the coverage though.... |
https://issues.redhat.com/browse/KOGITO-6131
This is a WIP branch to continue https://github.com/kiegroup/kogito-runtimes/pull/1669
Applied AdditionalStaticResourceBuildItem following quarkusio/quarkus#20846 (comment)
Use @QuarkusIntegrationTest instead of @QuarkusTest to handle static resources generated by codegen
https://github.com/kiegroup/kogito-examples/pull/1004
KOGITO-XYZ Subject
[0.9.x] KOGITO-XYZ Subject
How to replicate CI configuration locally?
Build Chain tool does "simple" maven build(s), the builds are just Maven commands, but because the repositories relates and depends on each other and any change in API or class method could affect several of those repositories there is a need to use build-chain tool to handle cross repository builds and be sure that we always use latest version of the code for each repository.
build-chain tool is a build tool which can be used on command line locally or in Github Actions workflow(s), in case you need to change multiple repositories and send multiple dependent pull requests related with a change you can easily reproduce the same build by executing it on Github hosted environment or locally in your development environment. See local execution details to get more information about it.
How to retest this PR or trigger a specific build:
Run all builds
Please add comment: Jenkins retest this
Run (or rerun) specific test(s)
Please add comment: Jenkins (re)run [kogito-runtimes|optaplanner|kogito-apps|kogito-examples|optaplanner-quickstarts|optaweb-employee-rostering|optaweb-vehicle-routing] tests
Quarkus LTS checks
Please add comment: Jenkins run LTS
Run (or rerun) LTS specific test(s)
Please add comment: Jenkins (re)run [kogito-runtimes|optaplanner|kogito-apps|kogito-examples|optaplanner-quickstarts|optaweb-employee-rostering|optaweb-vehicle-routing] LTS
Native checks
Please add comment: Jenkins run native
Run (or rerun) native specific test(s)
Please add comment: Jenkins (re)run [kogito-runtimes|optaplanner|kogito-apps|kogito-examples|optaplanner-quickstarts|optaweb-employee-rostering|optaweb-vehicle-routing] native
Full Kogito testing (with cloud images and operator BDD testing)
Please add comment: Jenkins run BDD
This check should be used only if a big change is done as it takes time to run, need resources and one full BDD tests check can be done at a time ...