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
Edit pipeline builder #4055
Edit pipeline builder #4055
Conversation
Was waiting for the initial bot to kick in... but it seems busy with other things. /kind feature cc @openshift/team-devconsole-ux |
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.
Looking good 🎉
Looks great, love the "this is not the param you are looking for" sample text |
To be honest, forgot that was there lol. Wasn't reading the text when I was recording. It's part of my test param Pipeline I have, so if this shows up in the logs I made a bug somewhere 😅 |
@@ -142,8 +142,8 @@ const TaskComponent: React.FC<TaskProps> = ({ | |||
</> | |||
); | |||
return ( | |||
<li className={cx('odc-pipeline-vis-task')}> | |||
<div className={cx('odc-pipeline-vis-task')}> |
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.
no need to use classnames
lib here for a single class
return ( | ||
<PipelineTopologyGraph | ||
// TODO: fix this; the graph layout isn't properly laying out nodes | ||
key={nodes.map((n) => n.id).join('-')} |
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.
No need for a key here.
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.
Layout is a pain atm, if I don't force a re-render it doesn't properly layout nodes when new ones are added. Have an intent to circle back to this once Jeff's stuff is in.
const [clusterTasks, setClusterTasks] = React.useState<PipelineResourceTask[]>(null); | ||
const [loadErrorMsg, setLoadErrorMsg] = React.useState<string>(undefined); | ||
|
||
React.useEffect(() => { |
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.
These async calls to update state need to be guarded against updating state on an unmounted component.
.then((res: PipelineResourceTask[]) => { | ||
setNamespacedTasks(res); | ||
}) |
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.
nit:
.then(setNamespacedTasks)
.then((res: PipelineResourceTask[]) => { | ||
setClusterTasks(res); | ||
}) |
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.
nit:
.then(setClusterTasks)
<div style={{ height: maxSize?.height, width: maxSize?.width }}> | ||
<VisualizationSurface visualization={vis} /> |
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.
Need to improve topology to support sizing based on contents.
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.
Pipeline code (this code)? Or Topology?
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.
Topology. This is fine for now
const SpacerNode: React.FC<{ element: Node }> = () => { | ||
return <g />; | ||
}; |
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.
Dagre trickery?
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.
To get the design we want, yeah... parallel to parallel is just straight lines to Dagre... placing a node as a focal point allows them to flow to an invisible point and then flow back out.
Select task <CaretDownIcon /> | ||
</Button> | ||
</div> | ||
<Popper |
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.
We need to extract this and the other instances into a single reusable component later.
properties: { | ||
perspective: 'dev', | ||
exact: true, | ||
path: [`/k8s/ns/:ns/${referenceForModel(PipelineModel)}/~new/:pipelineName/builder`], |
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.
Why ~new
in the edit url?
/k8s/ns/:ns/${referenceForModel(PipelineModel)}/:pipelineName/builder
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.
I did that originally... it's caught by the Details page and thinks I want a tab in there. I am unsure how to override that. Order in the Plugin file doesn't seem to do it.
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.
Apparently I was wrong... not sure how I tested that and didn't get it to work. 🤷♂ Fixed now.
const { | ||
metadata: { name, namespace }, | ||
} = pipeline; | ||
history.push(`/k8s/ns/${namespace}/${referenceForModel(PipelineModel)}/~new/${name}/builder`); |
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.
history.push(`/k8s/ns/${namespace}/${referenceForModel(PipelineModel)}/~new/${name}/builder`); | |
history.push(`/k8s/ns/${namespace}/${referenceForModel(PipelineModel)}/${name}/builder`); |
30b5b65
to
a98f8f8
Compare
/retest |
@@ -2,7 +2,6 @@ $border-color: var(--pf-global--BorderColor--light-100); | |||
.odc-pipeline-vis-task { | |||
position: relative; | |||
width: 10em; | |||
margin-top: 1.5em; |
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.
nit: I understand this is an existing file... However, should we use pf-react-tokens instead later
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 sure I understand. Your problem is with the sass styles or the hardcoded value? I believe I made the margin a pf variable when I moved it.
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.
this is not something urgent. While going through the code, I just thought that the remaining styles like width:10em, should they be converted to pf units. This could be taken up in later PRs
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.
Ah gotcha... you mean the width
haha... I thought you were talking about the margin-top
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.
This was all done at the time to make the nodes reactive to font size. The layout was dynamic too.
Now that we have a fixed layout and node sizes at can clean up the old code later
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.
On my cleanup list 😞
clicking on the task bubble gave this issue
|
While changing the name in the Sidebar for one of the buildah task, I backspaced till zero characters and got this issue.
|
#4055 (comment) |
#4055 (comment) ah, damn. That was overlooked. Good catch. Live updating the form + visualization has its issues haha. |
#4055 (comment) |
The Builder fails to load over Create/Edit flow in Admin perspective because of route issues |
97597d7
to
52cbb05
Compare
/test e2e-gcp-console |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest |
/retest Please review the full test history for this PR and help us cut down flakes. |
4 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest |
/retest Please review the full test history for this PR and help us cut down flakes. |
bd36046
to
6b60f12
Compare
/hold Looks like there is another flake that is preventing any tests from running. |
/retest |
/hold cancel Looks like it's good to go again. |
/retest |
/test e2e-gcp-console |
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abhinandan13jan, andrewballantyne, christianvogt, karthikjeeyar, serenamarie125 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest |
/retest Please review the full test history for this PR and help us cut down flakes. |
Fixes:
Folded the PRs into this one now that it has been reviewed by @christianvogt - Additional changes will be more commits
Dependency on #4004 (https://issues.redhat.com/browse/ODC-2605) -- 1st commitDependency on #4031 (https://issues.redhat.com/browse/ODC-2448) -- 2nd commit
Dependency on #4033 (https://issues.redhat.com/browse/ODC-2447) -- 3rd commit
Dependency on #4049 (https://issues.redhat.com/browse/ODC-2449) -- 4th commit
https://issues.redhat.com/browse/ODC-2450 -- 5th commit
Tickets covered are:
Additional comments beyond the 1st one are all reviewer feedback.
Analysis / Root cause:
I've completed walked through the builder and produced a Pipeline I like. There however is an issue with the way I set it up - it'd be nice to go back through the builder to adjust it.
Solution Description:
Inject an existing Pipeline into the PipelineBuilder as to start off with a pre-built structure.
Screen shots / Gifs for design review:
There is a laundry list of touch ups and writing tests I need to do. But this is the essence of the Pipeline Builder (and all 4 previous PRs build it up in different ways).
Unit test coverage report:
Test setup:
Browser conformance: