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

NO-ISSUE: sonataflow-operator: generate stable names for workflow resources #2375

Merged
merged 1 commit into from
Jun 23, 2024

Conversation

rgolangh
Copy link
Contributor

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]

@rgolangh rgolangh force-pushed the main branch 2 times, most recently from ea7e605 to a4fa9cf Compare May 27, 2024 16:16
@rgolangh
Copy link
Contributor Author

@masayag

Copy link
Member

@ricardozanini ricardozanini left a comment

Choose a reason for hiding this comment

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

@tiagobento tiagobento added pr: DO NOT MERGE Draft PR, not ready for merging pr: waiting-for-ci CI is still running or broken. labels May 28, 2024
@rgolangh
Copy link
Contributor Author

@tiagobento
Copy link
Contributor

There seems to be tests failing...

@tiagobento tiagobento changed the title kogito-serverless-operator: generate stable names for workflow resources NO-ISSUE: sonataflow-operator: generate stable names for workflow resources May 28, 2024
@ederign ederign removed their request for review May 30, 2024 19:53
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]>
@rgolangh
Copy link
Contributor Author

rgolangh commented Jun 6, 2024

I fixed the unsorted imports now, they look exactly as the PR to the operator apache/incubator-kie-kogito-serverless-operator#473

@rgolangh
Copy link
Contributor Author

@tiagobento @ricardozanini can you please merge this?

@tiagobento tiagobento merged commit 2c5b1e7 into apache:main Jun 23, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: DO NOT MERGE Draft PR, not ready for merging pr: waiting-for-ci CI is still running or broken.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants