-
Notifications
You must be signed in to change notification settings - Fork 63
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
U/kkasp/tron 2370 do ya like dags #1032
Conversation
… importance of ordering
… less than a few minutes of data. Add horizontal guidelines for better legibility. Add code comments
…essages in the console
…ual graph height adjustment. Update popup template to be a bit more generic for use between Job and JobRun
…m. Update styles for better popups and JobRun state visualization. Add search and reset buttons to the graph. Update fit logic to suit the modal size automatically. Many other fixes
…he main page graph behind it
While writing this I used a lot of in-line styles, which generally isn't that great. I'll see how painful it is to move these over, but in the meantime I think this is quite reviewable. |
}, | ||
# Error states (.error mixin in LESS) | ||
{ | ||
selector: '.failed, .unknown', |
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 highlight "unknown" action states as red now, but our graph is quite dumb so it isn't highlighting the node. I'm a bit worried about doing this in something like an ad pipeline job where crossjob triggers will show as red nodes. Maybe this should be some alternative colour
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.
unknown as orange might be interesting?
{ | ||
selector: 'edge', | ||
style: { | ||
'curve-style': 'bezier' |
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.
Hey wait a minute, why aren't you working?
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.
Context, I was expecting this to curve lines around nodes a bit based on cytoscape's demo, but I think I've misunderstood things here.
At any rate, it's probably more advisable to go with taxi edges which looks like this, or something like an unbundled bezier with dynamic curves which would look this.
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'm not super familiar with Tron's frontend code so I'm maybe not qualified to offer an opinion on the code quality, but the functionality is way more useful than status quo, and it doesn't look like you're making the code any worse than it already is.
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.
after going through the whole diff, i think some of the magic ui numbers already existed in the previous iteration of this code - so don't worry about my comment about documenting those too much :p
window.modules = window.modules || {} | ||
module = window.modules.actionrun = {} | ||
window.modules.actionrun = module = {} |
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 assume this was just for consistency?
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.
Yeah, not sure why we did it both ways. I just wanted to be consistent.
initialize: (options) => | ||
@listenTo(@model, "sync", @render) | ||
|
||
tagName: "div" | ||
|
||
className: "span8" | ||
className: "span12" |
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.
heh, we should probably use real classnames - but this is no worse than the existing setup so i'll pretend i didn't see this :p
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.
If only. Those are predefined by Bootstrap 2.3.2 for the grid system (see https://getbootstrap.com/2.3.2/scaffolding.html). SpanX with a total of 12 "columns" across the page. I just noticed we only spanned 8 and had 1/3 of the screen sitting unused.
I don't think we can actually change these. I think if we get to Bootstrap 3, 4, or 5 (maybe a bit ambitious 😛) we can replace these with the newer names.
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.
heh, wild!
}, | ||
# Error states (.error mixin in LESS) | ||
{ | ||
selector: '.failed, .unknown', |
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.
unknown as orange might be interesting?
if nodeClass | ||
node.addClass(nodeClass) | ||
|
||
# 50 ms is enough time for the graph to render before we resize and fit it. Is there a better way? Yeah, probably. |
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.
there's probably a browser event we can hook into/listen for - but this is probably fine for now
@force.start() | ||
@buildSvgLinks(links) | ||
@buildSvgNodes(@model) | ||
@$el.html('') |
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 assume this is to clear any potential existing stuff on the page?
# Create container for controls and add search and reset fields | ||
controlsHtml = '<div class="graph-controls" style="display: inline-flex; align-items: center; margin-right: 45px;">' | ||
controlsHtml += '<span class="graph-search" style="display: inline-flex; align-items: center;"><input type="text" placeholder="Search nodes..." style="width:150px; padding:3px; margin: 0; height: 24px; font-weight: normal; vertical-align: middle;"></span>' | ||
controlsHtml += '<button class="reset-graph-btn btn btn-clear tt-enable" title="Reset Graph" data-placement="top" style="margin-left: 10px;"><i class="icon-refresh icon-white"></i></button>' |
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 assume there's probably a better way to do this too - but imo, it's probably worth shipping this out and then improving this later (or maybe even potentially re-writing all this in our internal ui repo :p)
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.
ty for all the comments!
i think one suggestion might be to extract some of the constants out (or add even more comments :p) for a couple things like tooltip adjustment values and whatnot)
@@ -192,7 +197,7 @@ class window.JobView extends Backbone.View | |||
<span id="refresh"></span> | |||
</h1> | |||
</div> | |||
<div class="span5 outline-block"> | |||
<div class="span4 outline-block"> |
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.
it'd be nice to actually name these - but i assume that's likely an even bigger change
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.
As above, so below.
…wn as a new colour on the graph
I know this looks LLM generated but I swear it isn't. I just did a lot of things
What
At its core, this change is about replacing d3-force with a more reasonable DAG visualization. I don't think it was ever a great pick, but we probably didn't have anything as complicated as our largest jobs today so we likely boiled the frog a bit.
Main changes
Why
This was bad and I wanted to make it less bad. This was called out by a number of teams in the orchestration tool review as a high priority pain point. Replacing d3-force was not that small of a task though since there isn't an immediate alternative available in D3.
Documentation
Bug fixes and miscellanea
Validation
I never got around to updating our Tronweb tests. Given the state of those tests I think calling it an "update" would be a stretch. I created TRON-2385 for a future world where we write actual Tronweb tests. In the meantime I have resorted to writing flawless code that I've verified with some manual testing.
GIFs
Browsers
I've tried this on Arc, Chrome, Safari, and Firefox. No weirdness detected.
See it live!
I've left it running on devbox:8090/web.
If it isn't up I can restart it, or share my complex jobs if any reviewers want to run it themselves.