-
Notifications
You must be signed in to change notification settings - Fork 209
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
Conversation
…side ProtobufProcessInstanceWriter
…nside CompositeNodeInstance
…side CompositeNodeInstance - overriding in ForEachNodeInstance
PR job Reproducerbuild-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:
Those are the test failures: |
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.
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. |
… avoid stream/filter on each getSerializableNodeInstances invocation
PR job Reproducerbuild-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:
Those are the test failures: |
…Test.buildWorkflowContext unit test
@martinweiler |
PR job Reproducerbuild-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:
Those are the test failures: |
Failing tests on kogito-runtimes unrelated (already present) |
PR job Reproducerbuild-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:
Those are the test failures: |
+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<>(); |
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.
remove
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.
@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); |
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.
change not required
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.
see above
|
||
@Override | ||
public Collection<org.kie.api.runtime.process.NodeInstance> getSerializableNodeInstances() { | ||
return Collections.unmodifiableCollection(serializableNodeInstances); |
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.
user filter instead.
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.
stream/filtering on each requests add an unneeded overhead
* @return | ||
*/ | ||
protected Set<Class<? extends org.kie.api.runtime.process.NodeInstance>> getNotSerializableClasses() { | ||
return Collections.emptySet(); |
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.
not required.
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.
minor changes
PR job Reproducerbuild-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:
Those are the test failures: |
kogito-runtimes failure unrelated serverless-workflow-examples failure unrelated |
…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]>
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.