-
Notifications
You must be signed in to change notification settings - Fork 5
Refactor execution status handling #1579
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
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
a02a1f1 to
3029633
Compare
a2650c8 to
1e3965d
Compare
7c954c4 to
949efd4
Compare
b8a7076 to
227876d
Compare
589df57 to
e1a9094
Compare
65cdf3c to
adf56fd
Compare
cbd1b13 to
9eda85c
Compare
9eda85c to
dcdf569
Compare
|
this looks like a pretty bold change, and while I like it a lot, I'm worried that the customers might misunderstand it. I suggest discussing this during the sync. Also I think this would be a good candidate for some A/B testing if only we had that. |
| const HATCHED_SEGMENT_CLASS = | ||
| "bg-[repeating-linear-gradient(135deg,transparent,transparent_6px,rgba(0,0,0,0.5)_6px,rgba(0,0,0,0.5)_12px)] bg-blend-multiply bg-repeat bg-[length:512px_24px] bg-[position:left_top]"; | ||
|
|
||
| const BAR_CLASS = "h-2 w-full rounded overflow-hidden bg-gray-200"; |
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.
Just for consideration. I want to get opinion about an approach where we can use @apply to create semantic CSS classes for highly re-usable places.
For cases like this, we can extract complex CSS into separate CSS files to create semantical CSS classes:
@reference "tailwindcss";
.task-status-bar {
@apply h-2 w-full overflow-hidden rounded bg-gray-200;
}
.task-status-bar-segment-hatched {
@apply bg-blend-multiply bg-repeat;
background-image: repeating-linear-gradient(
135deg,
transparent,
transparent 6px,
rgba(0, 0, 0, 0.5) 6px,
rgba(0, 0, 0, 0.5) 12px
);
background-size: 512px 24px;
background-position: left top;
}So in the code we can use it like:
<InlineStack wrap="nowrap" gap="0" className="task-status-bar" />While this specific use-case may be not the best application of the practice, but a good place to just get the discussion going.
Official Tailwind recommendation is to try to avoid "@apply" in favor of component extraction (so entire css is isolated in one component).
| hatched: boolean; | ||
| }) => { | ||
| const label = getExecutionStatusLabel(status); | ||
| const colorClass = EXECUTION_STATUS_BG_COLORS[status] ?? "bg-slate-300"; |
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: Similar to comment above - we can convert the status-color mapping to a CSS semantic class.
| const orderMap = new Map<string, number>( | ||
| STATUS_DISPLAY_ORDER.map((s, i) => [s, i]), | ||
| ); |
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: since STATUS_DISPLAY_ORDER is only used here, we can micro-optimize and prepare the map beforehand and not while component rendering.
| Object.entries(details.child_task_execution_ids).forEach( | ||
| ([taskId, executionId]) => { | ||
| const statusStats = state?.child_execution_status_stats?.[executionId]; | ||
| const aggregated = getOverallExecutionStatusFromStats(statusStats); |
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: make naming consistent Overall -> Aggregated so the function may be getAggregatedExecutionStatusFromStats
| pipeline_name: string; | ||
| pipeline_digest?: string; | ||
| status?: RunStatus; | ||
| status?: string; |
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 would prefer to have a union string type to indicate possible values.
| * Note: The mapping is intentionally aligned to the status table from: | ||
| * https://github.com/TangleML/tangle-ui/issues/1540 | ||
| */ | ||
| const EXECUTION_STATUS_LABELS: Record<string, string> = { |
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 would prefer to have a union type to represent the possible status values (we have a well-defined finite number of values)
maxy-shpfy
left a comment
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 would invest some time into improving typing for status values.
Overall LGTM, tested locally - need to test more on staging.
Also as a follow-up PR I would love to have an e2e test to cover this functionality

Description
Enhanced status visualization with detailed tooltips for pipeline runs. The status bar now shows more granular execution states and provides tooltips with detailed breakdowns of task statuses. This improves visibility into pipeline execution states by displaying the actual execution statuses rather than simplified aggregates.
We’ll display the raw status coming from the server, but map it to a “pretty” label in the UI so we can localize later, if we need to:
Previously we grouped several “pending-like” states together (e.g., PENDING, QUEUED, WAITING, WAITING_FOR_UPSTREAM) and displayed them all as Pending.
Now, each execution state displays its own label and its own status color. Some statuses still share the same color to indicate they’re part of the same general category/type (e.g., multiple “in progress / not started yet” states use yellow).
Type of Change
Checklist
Screenshots (if applicable)
Here is a real example of my local env
Here is some test data (ignore the state on the left, I was just feeding fake data into the bar for the screenshots below, so it would contain all states)
states.mov (uploaded via Graphite)
Test Instructions
Additional Comments
This change introduces a new utility module for execution status handling and standardizes how we display and aggregate execution statuses throughout the UI.