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): Add drawer with more details for each workflow in Workflow List #3151
Conversation
…abel in the new labels column
… to take up less real estate.
…ait from labels column
…mponent to keep track of show/hide state. Reformat column widths for readability and change format of labels
…ces duration, and conditions
be very selective in the amount of data you query yes? there maybe >2k workflow listed |
I believe the data has already been transmitted to the UI at this point, it's simply being surfaced now. Also, it might be a bit hard to see but the drawer is only shown – and therefore only rendered by React – if a user decides to display it. |
Yeah, each workflow object is already there in its entirety, I'm just displaying more of its properties in the drawer. |
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.
believe the data has already been transmitted to the UI at this point,
We should not be transmitting the data of EVERY workflow that is loaded into this page. Only top line items. Can I confirm that if you open the drawer, then you are only loading the workflow at that point?
Sorry, not sure I understand what your concern is here. Could you help clarify? If you're concerned about sending more information over-the-wire, then this PR does not send any new information that was not previously sent before. As of right now, we send Workflow objects in their entirety to the endpoint used by the timeline page. This PR simply exposes more of the information that is already being sent. If you're proposing we strip Workflow objects sent through this endpoint down to only the necessary fields to display them, then that would be out of scope of this PR. If you're concerned about the UI having performance issues when loading or displaying the information that it has received, then React renders the information intelligently and will only do so if the user clicks the "Show" button. |
@simster7 I'm confused - the screen shot in the description is of the workflow list page - but you're talking about the timeline page - I don't know what page that is - the only thing it might be is the timeline tab fo the workflow page? Can you confirm which page makes these changes? |
Looking at the changes, this is the workflow list page. This page should not be listing all workflow details - only those relevant to the list. This is to reduce network I/O for long lists (1000+ workflows). This should be achieved by line 26 in
If that is actually returning more information, then we have a bug that this PR has revealed. However, what I expect is happening is that events that come from If I'm correct, then can you make sure you're only getting the specific minimal data you need for this? Even adding labels to Or, maybe remove the drawer if that data is missing. |
I'm having trouble understanding what you mean by events coming from The way the changes handle missing data is by checking if each parameter exists in the In case this helps clarify anything, I've included a screenshot of a |
I guess it is call the timeline then! I suggest lazy-loading the workflow using I do like the idea of casually inspecting workflow like this. I think people will find it really useful. |
great, sounds good! I'll start working on that. Do you think the lazy loading requires its own PR or should I include it in this one? |
Upon inspection of the data returned directly from that API call, I'm finding that the response directly from the server (inspected with the Network dev tools) is exactly as expected without the additional data. However, somewhere between the server's response and the returned value of the I'm thinking there are two places this could happen:
In if (this.subscription) {
this.subscription.unsubscribe();
}
...
if (!this.state.initialized) {
workflowList = services.info.getInfo().then(info => {
...
this.setState({initialized: true, managedNamespace: !!info.managedNamespace});
return services.workflows.list(newNamespace, selectedPhases, selectedLabels, pagination);
});
} else {
...
workflowList = services.workflows.list(newNamespace, selectedPhases, selectedLabels, pagination);
}
workflowList
.then(wfList => {
console.log(wfList)
...
}).then(() => {
this.subscription = services.workflows
.watch({namespace: newNamespace, phases: selectedPhases, labels: selectedLabels})
.map(workflowChange => {
... |
I would do the lazy loading in this PR. You seem to have gotten a great start in debugging the Workflow object issue. Would you like to own it? If so, I'd recommend trying to fix it in a separate PR. Also, if you need help feel free to ping me |
I can definitely debug the Workflow object issue, I'll open an issue and PR this afternoon. Thanks! |
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 so far! First round of comments
const params = this.queryParams(filter); | ||
params.push( | ||
`fields=result.object.metadata.name,result.object.metadata.namespace,result.object.status.finishedAt,result.object.status.startedAt,result.object.status.phase` | ||
); | ||
const url = `api/v1/workflow-events/${filter.namespace || ''}?${params.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.
This seems to be fixing the workflow-events
endpoint issue. Shouldn't this be done in #3165 instead?
return ( | ||
<div className='tag' key={`${wf.metadata.namespace}-${wf.metadata.name}-${condition.type}-${condition.status}`}> | ||
<div className='key'>{condition.type}</div> | ||
<div className='value'>{condition.status}</div> |
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.
With Conditions
, the Message
field is often more important than the status field. In fact, we only show the status field at all only if the message field is empty. Furthermore, these message fields can be quite long... take a look at this example
So I'm not sure the tag
class that we use to display "labels" would work here. What do you think?
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 I see. With context, I agree - when I first saw that example, I thought that the SpecWarning portion was not itself a condition, but a constant warning displayed for every workflow.
)} | ||
</div> | ||
); | ||
} | ||
|
||
private fetchWorkflow(): void { |
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.
Nice. I would call this fetchFullWorkflow
to emphasize that we have now is only a partial Workflow.
|
||
interface WorkflowsRowProps { | ||
workflow: models.Workflow; | ||
onChange: (key: string) => void; | ||
} | ||
export class WorkflowsRow extends React.Component<WorkflowsRowProps, {hideLabels: boolean}> { | ||
|
||
export class WorkflowsRow extends React.Component<WorkflowsRowProps, {hideDrawer: boolean; workflow: models.Workflow}> { |
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.
Can we make {hideDrawer: boolean; workflow: models.Workflow}
a format type like we do with props?
interface WorkflowRowState {
...
}
onChange: (key: string) => void; | ||
} | ||
|
||
export class WorkflowDrawer extends React.Component<WorkflowDrawerProps, {}> { |
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 change the ordering things are displayed here to be
- Message
- Conditions
- Resource Durations
- Labels
@@ -89,6 +89,7 @@ message WorkflowDeleteResponse { | |||
message WatchWorkflowsRequest { | |||
string namespace = 1; | |||
k8s.io.apimachinery.pkg.apis.meta.v1.ListOptions listOptions = 2; | |||
string fields = 3; |
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.
Likewise here. Shouldn't this be done in #3165 instead?
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 due to a gap in my understanding of git - my commits from the #3165 branch were added to this branch. I was trying to debug this enhancement with the changes I made in #3165 without considering that accordingly those changes would be added to this branch.
To resolve this, should I simply delete the lines in question and recommit?
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 worries. Yes, I would simply delete these lines and make sure that they are reverted exactly to what they were before by making sure they didn't change with git diff master
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.
Almost there, just one more comment
@@ -806,6 +806,7 @@ var xxx_messageInfo_WorkflowDeleteResponse proto.InternalMessageInfo | |||
type WatchWorkflowsRequest struct { | |||
Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` | |||
ListOptions *v1.ListOptions `protobuf:"bytes,2,opt,name=listOptions,proto3" json:"listOptions,omitempty"` | |||
Fields string `protobuf:"bytes,3,opt,name=fields,proto3" json:"fields,omitempty"` |
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.
Still need to get rid of changes in this file. Doing a git checkout master pkg/apiclient/workflow/workflow.pb.go
should suffice
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.
Excellent work!
Kudos, SonarCloud Quality Gate passed! 0 Bugs |
Concerns addressed by lazy-loading full Workflow infomration
Checklist:
"fix(controller): Updates such and such. Fixes #1234"
.