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

[incubator-kie-issues#1497] Using the getSerializableNodeInstances inside ProtobufProcessInstanceWriter #3707

Merged
merged 15 commits into from
Oct 18, 2024

Conversation

gitgabrio
Copy link
Contributor

Fixes apache/incubator-kie-issues#1497

Requires apache/incubator-kie-drools#6116

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.

@kie-ci3
Copy link
Contributor

kie-ci3 commented Oct 8, 2024

PR job #1 was: UNSTABLE
Possible explanation: This should be test failures

Reproducer

build-chain build full_downstream -f 'https://raw.githubusercontent.com/${AUTHOR:apache}/incubator-kie-kogito-pipelines/${BRANCH:main}/.ci/buildchain-config-pr-cdb.yaml' -o 'bc' -p apache/incubator-kie-kogito-runtimes -u #3707 --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://ci-builds.apache.org/job/KIE/job/kogito/job/main/job/pullrequest_jobs/job/kogito-runtimes-pr/job/PR-3707/1/display/redirect

Test results:

  • PASSED: 3365
  • FAILED: 3

Those are the test failures:

org.jbpm.bpmn2.IntermediateEventTest.testTimerBoundaryEventInterrupting
expected: 2
but was: 1
org.jbpm.bpmn2.IntermediateEventTest.testIntermediateCatchEventTimerDuration
expected: 2
but was: 1
org.jbpm.bpmn2.IntermediateEventTest.testEventBasedSplit2
expected: 2
but was: 1

@gitgabrio gitgabrio marked this pull request as ready for review October 8, 2024 15:44
Copy link
Contributor

@martinweiler martinweiler left a comment

Choose a reason for hiding this comment

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

It would be great to have a unit test that actually tests the protobuf serialization changes.

Other than that, great work @gitgabrio

@gitgabrio
Copy link
Contributor Author

It would be great to have a unit test that actually tests the protobuf serialization changes.

Other than that, great work @gitgabrio

I tried to write it (TBH, I still have it on my local) but the problem is that I'm ending up mocking everything, from NodeInstances to ProtobufProcessMarshallerWriteContext to have the test working, and so it would not be a real test.

@kie-ci3
Copy link
Contributor

kie-ci3 commented Oct 9, 2024

PR job #5 was: UNSTABLE
Possible explanation: This should be test failures

Reproducer

build-chain build full_downstream -f 'https://raw.githubusercontent.com/${AUTHOR:apache}/incubator-kie-kogito-pipelines/${BRANCH:main}/.ci/buildchain-config-pr-cdb.yaml' -o 'bc' -p apache/incubator-kie-kogito-runtimes -u #3707 --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://ci-builds.apache.org/job/KIE/job/kogito/job/main/job/pullrequest_jobs/job/kogito-runtimes-pr/job/PR-3707/5/display/redirect

Test results:

  • PASSED: 3371
  • FAILED: 3

Those are the test failures:

org.jbpm.bpmn2.IntermediateEventTest.testTimerBoundaryEventInterrupting
expected: 2
but was: 1
org.jbpm.bpmn2.IntermediateEventTest.testIntermediateCatchEventTimerDuration
expected: 2
but was: 1
org.jbpm.bpmn2.IntermediateEventTest.testEventBasedSplit2
expected: 2
but was: 1

@gitgabrio
Copy link
Contributor Author

gitgabrio commented Oct 9, 2024

@martinweiler
I add ProtobufProcessInstanceWriterTest.buildWorkflowContext test to verify the actual change of this PR, i.e. that only the "serializable" node instances are used for WorkflowContext instantiation.

@kie-ci3
Copy link
Contributor

kie-ci3 commented Oct 9, 2024

PR job #6 was: UNSTABLE
Possible explanation: This should be test failures

Reproducer

build-chain build full_downstream -f 'https://raw.githubusercontent.com/${AUTHOR:apache}/incubator-kie-kogito-pipelines/${BRANCH:main}/.ci/buildchain-config-pr-cdb.yaml' -o 'bc' -p apache/incubator-kie-kogito-runtimes -u #3707 --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://ci-builds.apache.org/job/KIE/job/kogito/job/main/job/pullrequest_jobs/job/kogito-runtimes-pr/job/PR-3707/6/display/redirect

Test results:

  • PASSED: 3372
  • FAILED: 3

Those are the test failures:

org.jbpm.bpmn2.IntermediateEventTest.testTimerBoundaryEventInterrupting
expected: 2
but was: 1
org.jbpm.bpmn2.IntermediateEventTest.testIntermediateCatchEventTimerDuration
expected: 2
but was: 1
org.jbpm.bpmn2.IntermediateEventTest.testEventBasedSplit2
expected: 2
but was: 1

@gitgabrio
Copy link
Contributor Author

Failing tests on kogito-runtimes unrelated (already present)

@kie-ci3
Copy link
Contributor

kie-ci3 commented Oct 11, 2024

PR job #7 was: UNSTABLE
Possible explanation: This should be test failures

Reproducer

build-chain build full_downstream -f 'https://raw.githubusercontent.com/${AUTHOR:apache}/incubator-kie-kogito-pipelines/${BRANCH:main}/.ci/buildchain-config-pr-cdb.yaml' -o 'bc' -p apache/incubator-kie-kogito-runtimes -u #3707 --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://ci-builds.apache.org/job/KIE/job/kogito/job/main/job/pullrequest_jobs/job/kogito-runtimes-pr/job/PR-3707/7/display/redirect

Test results:

  • PASSED: 2877
  • FAILED: 3

Those are the test failures:

org.jbpm.bpmn2.IntermediateEventTest.testTimerBoundaryEventInterrupting
expected: 2
but was: 1
org.jbpm.bpmn2.IntermediateEventTest.testIntermediateCatchEventTimerDuration
expected: 2
but was: 1
org.jbpm.bpmn2.IntermediateEventTest.testEventBasedSplit2
expected: 2
but was: 1

@pefernan
Copy link
Contributor

+1 when green. Thank you @gitgabrio

*/
public class CompositeNodeInstance extends StateBasedNodeInstance implements NodeInstanceContainer, EventNodeInstanceInterface, EventBasedNodeInstanceInterface {

private static final long serialVersionUID = 510l;

private final List<NodeInstance> nodeInstances = new ArrayList<>();
private final List<NodeInstance> serializableNodeInstances = new ArrayList<>();
Copy link
Contributor

Choose a reason for hiding this comment

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

remove

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@elguardian
Scope of that list is to avoid streams/filtering during execution, that impact on performance

}

@Override
public Collection<org.kie.api.runtime.process.NodeInstance> getNodeInstances() {
return new ArrayList<>(getNodeInstances(false));
return Collections.unmodifiableCollection(nodeInstances);
Copy link
Contributor

Choose a reason for hiding this comment

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

change not required

Copy link
Contributor Author

Choose a reason for hiding this comment

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

see above


@Override
public Collection<org.kie.api.runtime.process.NodeInstance> getSerializableNodeInstances() {
return Collections.unmodifiableCollection(serializableNodeInstances);
Copy link
Contributor

Choose a reason for hiding this comment

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

user filter instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

stream/filtering on each requests add an unneeded overhead

* @return
*/
protected Set<Class<? extends org.kie.api.runtime.process.NodeInstance>> getNotSerializableClasses() {
return Collections.emptySet();
Copy link
Contributor

Choose a reason for hiding this comment

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

not required.

Copy link
Contributor

@elguardian elguardian left a comment

Choose a reason for hiding this comment

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

minor changes

@kie-ci3
Copy link
Contributor

kie-ci3 commented Oct 11, 2024

PR job #9 was: UNSTABLE
Possible explanation: This should be test failures

Reproducer

build-chain build full_downstream -f 'https://raw.githubusercontent.com/${AUTHOR:apache}/incubator-kie-kogito-pipelines/${BRANCH:main}/.ci/buildchain-config-pr-cdb.yaml' -o 'bc' -p apache/incubator-kie-kogito-runtimes -u #3707 --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://ci-builds.apache.org/job/KIE/job/kogito/job/main/job/pullrequest_jobs/job/kogito-runtimes-pr/job/PR-3707/9/display/redirect

Test results:

  • PASSED: 3374
  • FAILED: 3

Those are the test failures:

org.jbpm.bpmn2.IntermediateEventTest.testTimerBoundaryEventInterrupting
expected: 2
but was: 1
org.jbpm.bpmn2.IntermediateEventTest.testIntermediateCatchEventTimerDuration
expected: 2
but was: 1
org.jbpm.bpmn2.IntermediateEventTest.testEventBasedSplit2
expected: 2
but was: 1

@gitgabrio
Copy link
Contributor Author

kogito-runtimes failure unrelated
- apache_incubator-kie-kogito-runtimes/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/StandaloneBPMNProcessTest.java | expected: 2

serverless-workflow-examples failure unrelated
mvn <args> -rf :serverless-workflow-python-quarkus

@gitgabrio gitgabrio merged commit d67f929 into apache:main Oct 18, 2024
4 of 6 checks passed
@gitgabrio gitgabrio deleted the incubator-kie-issues#1497 branch October 18, 2024 10:40
rgdoliveira pushed a commit to rgdoliveira/kogito-runtimes that referenced this pull request Oct 24, 2024
…side ProtobufProcessInstanceWriter (apache#3707)

* [incubator-kie-issues#1497] Using the getSerializableNodeInstances inside ProtobufProcessInstanceWriter

* [incubator-kie-issues#1497] Overriding  getSerializableNodeInstances inside CompositeNodeInstance

* [incubator-kie-issues#1497] Implementing  getNotSerializableClasses inside CompositeNodeInstance - overriding in ForEachNodeInstance

* [incubator-kie-issues#1497] Unit-testing ForEachNodeInstance

* [incubator-kie-issues#1497] Improving Serializable Nodes management - avoid stream/filter on each getSerializableNodeInstances invocation

* [incubator-kie-issues#1497] Fix formatting

* [incubator-kie-issues#1497] Fix imports

* [incubator-kie-issues#1497] Implemented ProtobufProcessInstanceWriterTest.buildWorkflowContext unit test

* [incubator-kie-issues#1497] Removing serializableNodes list

* [incubator-kie-issues#1497] Reverting to modification only in ForEachNodeInstance

* [incubator-kie-issues#1497] Fix format/imports

---------

Co-authored-by: Gabriele-Cardosi <[email protected]>
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.

Kogito 10-rc: Protobuf Serialization error with Multi-instance subprocess.
5 participants