-
Notifications
You must be signed in to change notification settings - Fork 193
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
NO-ISSUE: sonataflow-operator: generate stable names for workflow resources #2375
Conversation
ea7e605
to
a4fa9cf
Compare
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.
Can you also please backport this change to https://github.com/apache/incubator-kie-kogito-serverless-operator/?
|
There seems to be tests failing... |
Motivation: Workflowproj generates a configmap per schema or subflow or specs in a separate file for each one, however the name is not deterministic. In one iteration you can get the specs in 01-configmap-FLOWNAME-resources.yaml and in the next iteration the same content will go in 02-configmap-FLOWNAME-resources.yaml. While the flow spec file will be updated accordingly and stay correct, the behaviour generates lots of changes when tracking changes in git. Modification: This fix will make the generation behaviour deterministic by sorting the resources iteration prior to generating them and also add the related schemas|specs/subflows to the generated file name: Result: old schema configmap manifest: 0x-configmap-FLOWNAME-resources.yaml new schema configmap manifest: 01-configmap-FLOWNAME-resources-schemas.yaml old specs config map manifest: 0x-configmap-FLOWNAME-resources.yaml new specs configmap manifest: 02-configmap-FLOWNAME-resources-specs.yaml old subflows config map manifest: 0x-configmap-FLOWNAME-resources.yaml new subflows configmap manifest: 01-configmap-FLOWNAME-resources-subflows.yaml Also the name of the config map itself will get the name related to the content like: '03-FLOWNAME-resources-schemas' Signed-off-by: Roy Golan <[email protected]>
I fixed the unsorted imports now, they look exactly as the PR to the operator apache/incubator-kie-kogito-serverless-operator#473 |
@tiagobento @ricardozanini can you please merge this? |
Motivation:
Workflowproj generates a configmap per schema or subflow or specs in a
separate file for each one, however the name is not deterministic. In
one iteration you can get the specs in
01-configmap-FLOWNAME-resources.yaml and in the next iteration the same
content will go in 02-configmap-FLOWNAME-resources.yaml.
While the flow spec file will be updated accordingly and stay correct,
the behaviour generates lots of changes when tracking changes in git.
Modification:
This fix will make the generation behaviour deterministic by sorting the
resources iteration prior to generating them and also add the related
schemas|specs/subflows to the generated file name:
Result:
old schema configmap manifest:
0x-configmap-FLOWNAME-resources.yaml
new schema configmap manifest:
01-configmap-FLOWNAME-resources-schemas.yaml
old specs config map manifest:
0x-configmap-FLOWNAME-resources.yaml
new specs configmap manifest:
02-configmap-FLOWNAME-resources-specs.yaml
old subflows config map manifest:
0x-configmap-FLOWNAME-resources.yaml
new subflows configmap manifest:
01-configmap-FLOWNAME-resources-subflows.yaml
Also the name of the config map itself will get the name related to the
content like: '03-FLOWNAME-resources-schemas'
Signed-off-by: Roy Golan [email protected]