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

[KOGITO-9614] Fixing issue with async api and dev mode #3165

Merged
merged 3 commits into from
Aug 8, 2023

Conversation

fjtirado
Copy link
Contributor

@fjtirado fjtirado commented Aug 8, 2023

Reverted to previos version of async api base on code generation (since the alternative approach mengled with quarkus config management and make wrong assumption about resource location)
There is a degree of classpath manipulation that I cannot avoid but it should be fine since it only occurs while on devmode. Also there are some exception while cleanup test that I feel are acceptable since it does not affect the overal result

2023-08-08 11:49:05,475 ERROR [io.qua.sma.rea.run.dev.ReactiveMessagingHotReplacementSetup] (pool-39-thread-1) Failed to redeploy application on changes: java.lang.IllegalStateException: Cannot reset a started application
	at io.quarkus.dev.appstate.ApplicationStateNotification.reset(ApplicationStateNotification.java:20)
	at io.quarkus.runner.bootstrap.StartupActionImpl.runMainClass(StartupActionImpl.java:90)
	at io.quarkus.deployment.dev.IsolatedDevModeMain.restartApp(IsolatedDevModeMain.java:222)
	at io.quarkus.deployment.dev.IsolatedDevModeMain.restartCallback(IsolatedDevModeMain.java:203)
	at io.quarkus.deployment.dev.RuntimeUpdatesProcessor.doScan(RuntimeUpdatesProcessor.java:537)
	at io.quarkus.deployment.dev.RuntimeUpdatesProcessor.doScan(RuntimeUpdatesProcessor.java:437)
	at io.quarkus.smallrye.reactivemessaging.runtime.devmode.ReactiveMessagingHotReplacementSetup$OnMessage$1.run(ReactiveMessagingHotReplacementSetup.java:44)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

@radtriste
Copy link
Contributor

jenkins run kogito-runtimes quarkus-lts

@radtriste
Copy link
Contributor

jenkins run kogito-runtimes native

@fjtirado
Copy link
Contributor Author

fjtirado commented Aug 8, 2023

Jenkins run kogito-runtimes quarkus-lts

@fjtirado
Copy link
Contributor Author

fjtirado commented Aug 8, 2023

Jenkins run kogito-runtimes native

@fjtirado
Copy link
Contributor Author

fjtirado commented Aug 8, 2023

Jenkins run kogito-runtimes quarkus-lts

@fjtirado
Copy link
Contributor Author

fjtirado commented Aug 8, 2023

Jenkins run kogito-runtimes native

KogitoBuildContextAttributeBuildItem asyncAPIContext(List<AsyncAPIBuildItem> asyncAPIBuildItem) {
return new KogitoBuildContextAttributeBuildItem(ParserContext.ASYNC_CONVERTER_KEY, new AsyncAPIInfoConverter(
new MapAsyncAPIRegistry(asyncAPIBuildItem.stream().map(AsyncAPIBuildItem::getAsyncAPI).collect(Collectors.toList()))));
void asyncAPIContext(LiveReloadExecutionBuildItem reload, KogitoBuildContextBuildItem context, BuildProducer<KogitoAddonsPreGeneratedSourcesBuildItem> sources) throws ClassNotFoundException {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

LiveReload depends on KogitoBuildContext (which depends on KogitoContextAttributeBuildItem), so here the trick is to declare a producer (that actually does not produce anything) so this is invoked before kogito codegen and take benefit of the fact that KogitoBuildContext is a mutable class.
We need LiveReload to use the proper classloader when loading the service

@kie-ci3

This comment was marked as outdated.

@kie-ci3

This comment was marked as outdated.

@kie-ci3
Copy link
Contributor

kie-ci3 commented Aug 8, 2023

(quarkus-lts) - kogito-runtimes job #90 was: UNSTABLE
Possible explanation: This should be test failures

Reproducer

export QUARKUS_BRANCH=2.13
export BUILD_MVN_OPTS_CURRENT=-T 1C
build-chain build cross_pr -f 'https://raw.githubusercontent.com/kiegroup/kogito-pipelines/main/.ci/pull-request-config.yaml' -o 'bc' -p kiegroup/kogito-runtimes -u https://github.com/kiegroup/kogito-runtimes/pull/3165 --skipParallelCheckout

NOTE: To install the build-chain tool, please refer to https://github.com/kiegroup/github-action-build-chain#local-execution

Please look here: https://eng-jenkins-csb-business-automation.apps.ocp-c1.prod.psi.redhat.com/job/KIE/job/kogito/job/main/job/pullrequest.quarkus-lts/job/kogito-runtimes.quarkus-lts.kogito-runtimes/90/display/redirect

Test results:

  • PASSED: 2206
  • FAILED: 1

Those are the test failures:

org.kie.kogito.quarkus.serverless.workflow.deployment.livereload.LiveReloadProcessorTest.testAsyncApi 1 expectation failed.
Expected status code <201> but was <500>.

@kie-ci3

This comment was marked as outdated.

@kie-ci3

This comment was marked as outdated.

@fjtirado
Copy link
Contributor Author

fjtirado commented Aug 8, 2023

@@ -25,7 +25,7 @@
/**
* Decorators for Http CloudEvents outgoing messages
*/
public final class CloudEventHttpOutgoingDecorator implements MessageDecorator {
public class CloudEventHttpOutgoingDecorator implements MessageDecorator {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@radtriste This is intending to fix the inheritance issue on lts

@fjtirado
Copy link
Contributor Author

fjtirado commented Aug 8, 2023

Jenkins run kogito-runtimes quarkus-lts

@kie-ci3
Copy link
Contributor

kie-ci3 commented Aug 8, 2023

(tests) - kogito-runtimes job #2992 was: UNSTABLE
Possible explanation: This should be test failures

Reproducer

export BUILD_MVN_OPTS_CURRENT=-T 1C -Dvalidate-formatting -Prun-code-coverage
build-chain build cross_pr -f 'https://raw.githubusercontent.com/kiegroup/kogito-pipelines/main/.ci/pull-request-config.yaml' -o 'bc' -p kiegroup/kogito-runtimes -u https://github.com/kiegroup/kogito-runtimes/pull/3165 --skipParallelCheckout

NOTE: To install the build-chain tool, please refer to https://github.com/kiegroup/github-action-build-chain#local-execution

Please look here: https://eng-jenkins-csb-business-automation.apps.ocp-c1.prod.psi.redhat.com/job/KIE/job/kogito/job/main/job/pullrequest/job/kogito-runtimes.tests.kogito-runtimes/2992/display/redirect

Test results:

  • PASSED: 3350
  • FAILED: 1

Those are the test failures:

org.kie.kogito.persistence.kafka.KafkaProcessInstancesIT.testFindByIdReadMode
expected: 5
but was: 0

@fjtirado
Copy link
Contributor Author

fjtirado commented Aug 8, 2023

jenkins run kogito-runtimes tests

@sonarcloud
Copy link

sonarcloud bot commented Aug 8, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

91.4% 91.4% Coverage
0.0% 0.0% Duplication

warning The version of Java (11.0.20) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

@fjtirado fjtirado merged commit 1b2146d into apache:main Aug 8, 2023
7 checks passed
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