Implement the drawing algorithm for yaml viz
What does this MR do?
This is part 2 of a series of MR to implement a graph preview of ci yaml configurations.
- Deliver the basic graph behind a feature flag without dependencies
- Deliver the job dependencies line between jobs <-- You are here
- Add hover on job pills that highlight all ancestors
needs
- Turn on feature flag + documentation + changelog
- Support parallel jobs
Behind a feature flag gitlab_ci_yml_preview
Draw the lines between dependant nodes in the yaml visualization graph that was added on ci config files. Because we initially render the stage and job pills in vue, to draw the lines we use D3 to create an svg that we apply on top of it, like a thin film. This MR calculates what it takes to draw that film and add it on top of our graph to connect needs
jobs.
Couples of notes:
- This part of the feature can't really be seriously tested imo. It relies on a lot of DOM element to be present to calculate bounding rects and the like. If reviewers have suggestions on tests that could be added, let me know.
- I have added the error handling inside the graph itself, not the
gitlab_ci_yaml_visualization.vue
component (which is the view container) because the graph itself as a component will be reused in the future and these errors should also live there I feel (if the lines fail to be drawn for example, you would want to see the error regardless of which page you are on) - No changelog required, it is still behind a disabled feature flag
- I moved some util files that were used for the DAG to a higher level folder since they have become shared
Below are a couple of examples for different configurations
Screenshots
Does this MR meet the acceptance criteria?
Conformity
Edited by Frédéric Caplette