-
Notifications
You must be signed in to change notification settings - Fork 554
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
Support deploying multiple DMN files at once #9432
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Our testcases were missing a scenario where we deploy multiple DRGs at once.
When writing the records after deploying a new DRG we would iterate over all the drgs and decisions in the DeploymentRecord. New drgs and decisions get gradually appended to the DeploymentRecord for each resource that's being processed. Since we iterate over this for every resource, it causes the same event to be send multiple times. Once for each of the drgs deployed. By filtering the drg metadata that is available in the DeploymentRecord to only include the resource that we are currently transforming we can stop this behavior and support deploying multiple drgs at once.
saig0
approved these changes
May 30, 2022
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.
@remcowesterhoud thanks for fixing 🍪 LGTM 👍
* make it clear that there is at most one decision requirements event that should be written
bors merge |
Successfully created backport PR #9458 for |
zeebe-bors-camunda bot
added a commit
that referenced
this pull request
May 30, 2022
9458: [Backport stable/8.0] Support deploying multiple DMN files at once r=remcowesterhoud a=backport-action # Description Backport of #9432 to `stable/8.0`. relates to camunda/zeebe-process-test#357 #9337 #9115 Co-authored-by: Remco Westerhoud <remco@westerhoud.nl> Co-authored-by: Philipp Ossler <philipp.ossler@gmail.com>
zeebe-bors-camunda bot
added a commit
that referenced
this pull request
May 30, 2022
9458: [Backport stable/8.0] Support deploying multiple DMN files at once r=saig0 a=backport-action # Description Backport of #9432 to `stable/8.0`. relates to camunda/zeebe-process-test#357 #9337 #9115 Co-authored-by: Remco Westerhoud <remco@westerhoud.nl> Co-authored-by: Philipp Ossler <philipp.ossler@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When deploying multiple DMN resources in a single command users would receive the error
This error is caused by a bug in Zeebe where we are sending multiple events for the same DRG and decisions. This only occurs when the command contains multiple DMN resources.
Root cause
In the
DmnResourceTransformer
we will transform each resource, so each dmn file. In here we have the methodappendMetadataToDeploymentEvent
. This method will add aDecisionRequirementsMetadataRecord
to theDeploymentRecord
. Once the metadata has been added we write the records:As you can see this method takes the
DeploymentRecord
as a parameter and iterates over all theDecisionRequirementsMetadataRecords
that have been added. So what happens when we deploy multiple dmns:DeploymentRecord
with an empty list ofDecisionRequirementsMetadataRecords
.DecisionRequirementsMetadataRecord
gets appended to theDeploymentRecord
DeploymentRecord
. At this point this is only the metadata of dmn 1DecisionRequirementsMetadataRecord
gets appended to theDeploymentRecord
DeploymentRecord
. At this point this record contains the metadata of both dmn 1 and dmn 2, resulting in aCREATED
event for dmn 2 containing the metadata keys of dmn 1Related issues
closes #9337
closes #9115
Related to camunda/zeebe-process-test#357
Definition of Done
Not all items need to be done depending on the issue and the pull request.
Code changes:
backport stable/1.3
) to the PR, in case that fails you need to create backports manually.Testing:
Documentation:
Please refer to our review guidelines.