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

feat(ui): allow importing external workflows and copying flow nodes in next generation New Workflow #3368

Merged
merged 15 commits into from
Jul 11, 2022

Conversation

g1eny0ung
Copy link
Member

@g1eny0ung g1eny0ung commented Jun 15, 2022

What problem does this PR solve?

Close #3364.
Close #3365.

What's changed and how it works?

This PR modifies the way nodes are connected in the flowchart. Since Workflow is "flexible" (for example, if there are currently two parallel nodes, one with 3 children and the other with 4, they cannot be connected one-to-one), I created separate Serial and Parallel nodes to contain the children. Then I finished this PR based on that.

Demos

a-serial-node.mp4
import-a-external-workflow.mp4
copy-a-node.mp4

Related changes

  • Need to update chaos-mesh/website
  • Need to update Dashboard UI
  • Need to cheery-pick to release branches
    • release-2.2
    • release-2.1

Checklist

CHANGELOG

  • I have updated the CHANGELOG.md
  • I have labeled this PR with "no-need-update-changelog"

Tests

  • Unit test
  • E2E test
  • No code
  • Manual test (add steps below)

Side effects

  • Breaking backward compatibility

DCO

If you find the DCO check fails, please run commands like below (Depends on the actual situations. For example, if the failed commit isn't the most recent) to fix it:

git commit --amend --signoff
git push --force

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>
Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>
Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>
Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jun 15, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • STRRL
  • cwen0

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>
https://lodash.com/docs/4.17.15#merge
Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>
@g1eny0ung g1eny0ung requested review from cwen0 and a team June 16, 2022 06:28
@codecov
Copy link

codecov bot commented Jun 20, 2022

Codecov Report

Merging #3368 (6802ad8) into master (9522623) will increase coverage by 0.22%.
The diff coverage is n/a.

❗ Current head 6802ad8 differs from pull request most recent head 48654cd. Consider uploading reports for the commit 48654cd to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3368      +/-   ##
==========================================
+ Coverage   40.90%   41.13%   +0.22%     
==========================================
  Files         166      165       -1     
  Lines       13985    13853     -132     
==========================================
- Hits         5721     5698      -23     
+ Misses       7835     7723     -112     
- Partials      429      432       +3     
Impacted Files Coverage Δ
.../workflow/controllers/workflow_entry_reconciler.go 47.02% <0.00%> (-9.19%) ⬇️
pkg/finalizer/utils.go 94.44% <0.00%> (-5.56%) ⬇️
controllers/statuscheck/controller.go 79.26% <0.00%> (-4.88%) ⬇️
api/v1alpha1/workflow_webhook.go 42.34% <0.00%> (-1.82%) ⬇️
...md/chaos-controller-manager/provider/controller.go 39.31% <0.00%> (-1.40%) ⬇️
pkg/bpm/build_linux.go 32.65% <0.00%> (ø)
pkg/webhook/validate_auth.go 0.00% <0.00%> (ø)
api/v1alpha1/blockchaos_types.go 0.00% <0.00%> (ø)
controllers/utils/controller/key.go 0.00% <0.00%> (ø)
pkg/chaosdaemon/stress_server_linux.go 0.00% <0.00%> (ø)
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a625391...48654cd. Read the comment docs.

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>
@g1eny0ung
Copy link
Member Author

In fe24730, I added an arrow at the end of the edge to identify the next node, and the workflow flow is now a bit clearer.

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>
Copy link
Member

@STRRL STRRL left a comment

Choose a reason for hiding this comment

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

I failed to build the frontend project:
image

I think we should remove this line:

podsPreviewDesc={<T id="newE.target.network.target.podsPreviewHelper" />}

@STRRL
Copy link
Member

STRRL commented Jul 5, 2022

rest LGTM!

Awesome!

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>
@g1eny0ung
Copy link
Member Author

I failed to build the frontend project: image

I think we should remove this line:

podsPreviewDesc={<T id="newE.target.network.target.podsPreviewHelper" />}

Thanks! I forgot to remove this line. Now it's fixed.

@g1eny0ung g1eny0ung requested a review from STRRL July 5, 2022 07:26
@cwen0
Copy link
Member

cwen0 commented Jul 5, 2022

I can't delete this parallel node.
image

@cwen0
Copy link
Member

cwen0 commented Jul 5, 2022

In parallel node, I created three experiments and specified the sequential relationship, but the YAML file still has three parallel tasks. If we don't support such an operation, we should disable the addition of sequential relationships.

image
image

@cwen0
Copy link
Member

cwen0 commented Jul 5, 2022

image
image

@g1eny0ung
Copy link
Member Author

I can't delete this parallel node. image

😵 I forgot to add the operations menu to Serial and Parallel nodes. I will fix them soon.

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>
Copy link
Member

@STRRL STRRL left a comment

Choose a reason for hiding this comment

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

LGTM!

I have tried to use it on my own machine with the example workflow yaml files.

@g1eny0ung
Copy link
Member Author

In parallel node, I created three experiments and specified the sequential relationship, but the YAML file still has three parallel tasks. If we don't support such an operation, we should disable the addition of sequential relationships.

image image

This place needs to be improved. Currently, I haven't limited users to connect nodes when they aren't permitted to connect. I will open an issue to track it later.

@g1eny0ung
Copy link
Member Author

image image

Fixed in bdc8b8d.

Copy link
Member

@cwen0 cwen0 left a comment

Choose a reason for hiding this comment

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

LGTM

@g1eny0ung
Copy link
Member Author

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 48654cd

@g1eny0ung g1eny0ung merged commit e0e0d54 into chaos-mesh:master Jul 11, 2022
@g1eny0ung g1eny0ung deleted the feat/import-workflow branch July 11, 2022 11:42
STRRL pushed a commit to Garima-Negi/chaos-mesh that referenced this pull request Sep 13, 2022
…n next generation `New Workflow` (chaos-mesh#3368)

* feat(ui): import external workflows

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>

* refactor: rewrite flowToWorkflow

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>

* fix: isolate flow nodes and real templates

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>

* feat: allow copying flow nodes

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>

* chore: update CHANGELOG

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>

* fix: mutate state

https://lodash.com/docs/4.17.15#merge
Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>

* chore: add marker-end arrow

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>

* chore: remove network.target.podsPreviewHelper

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>

* fix: build

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>

* fix: support copy/delete group nodes

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>

* fix: replace default entry when entry exists

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>
Signed-off-by: STRRL <im@strrl.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ui(workflow-ng): import workflow from Yaml ui(workflow-ng): copy single Node to reuse
4 participants