-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
VTAdmin: display workflow type in workflows list #11685
VTAdmin: display workflow type in workflows list #11685
Conversation
…pe on Workflows page Signed-off-by: Rohit Nayak <[email protected]>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
If a new flag is being introduced:
If a workflow is added or modified:
Bug fixes
Non-trivial changes
New/Existing features
Backward compatibility
|
Signed-off-by: Rohit Nayak <[email protected]>
…bal Workflow level Signed-off-by: Rohit Nayak <[email protected]>
Signed-off-by: Rohit Nayak <[email protected]>
Signed-off-by: Rohit Nayak <[email protected]>
Signed-off-by: Rohit Nayak <[email protected]>
Signed-off-by: Rohit Nayak <[email protected]>
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.
LGTM. I'm not sure how I feel about cramming so much into that one UI column w/o labels or anything. We could instead have a workflow type/details column OR add name
,type
labels to the data in the column. I'll let the VTAdmin leads comment on that stuff though. I'll approve for now, FWIW.
@@ -332,42 +334,44 @@ func (s *Server) GetWorkflows(ctx context.Context, req *vtctldatapb.GetWorkflows | |||
span.Annotate("workflow", workflow.Name) | |||
span.Annotate("tablet_alias", tablet.AliasString()) | |||
|
|||
id, err := evalengine.ToInt64(row[0]) | |||
id, err := evalengine.ToInt64(row["id"]) |
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 a note that with named values the field names are case sensitive and we're not guaranteeing case with AS
alias clauses in the SELECT
right now. Should be fine since these are vitess tables and the columns do seem to be all lower case in our defined schema.
We debated this yesterday while walking through the PR with @notfelineit. @notfelineit and I both prefer adding a column, but @rohit-nayak-ps is concerned about horizontal scrolling. |
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'd prefer to see this as a new column, but I'm OK with the current UX.
<span className="text-sm"> | ||
{row.workflowSubType !== 'None' ? ' (' + row.workflowSubType + ')' : ''} | ||
</span> |
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.
Here you could conditionally render the entire span
if the workflow subtype is 'none;
<span className="text-sm"> | |
{row.workflowSubType !== 'None' ? ' (' + row.workflowSubType + ')' : ''} | |
</span> | |
{row.workflowSubtype && row.workflowSubtype != 'None' && ( | |
<span className="text-sm"> | |
{'(' + row.workflowSubType + ')'} | |
</span> | |
)} |
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 also takes care of the nil check for row.workflowSubType
!
@@ -70,6 +72,12 @@ export const Workflows = () => { | |||
<tr key={idx}> | |||
<DataCell> | |||
<div className="font-bold">{href ? <Link to={href}>{row.name}</Link> : row.name}</div> | |||
<div className="text-secondary text-success-200"> | |||
{row.workflowType} |
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.
{row.workflowType} | |
{row.workflowType || 'N/A'} |
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 adding a nil check for row.workflowType
- feel free to change from 'N/A' if something else is appropriate.
Signed-off-by: Rohit Nayak <[email protected]>
@@ -70,6 +72,16 @@ export const Workflows = () => { | |||
<tr key={idx}> | |||
<DataCell> | |||
<div className="font-bold">{href ? <Link to={href}>{row.name}</Link> : row.name}</div> | |||
{row.workflowType && ( | |||
<div className="text-secondary text-success-200"> | |||
{row.workflowType} |
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.
For this one we'll still want to handle the null case from line 57 😄
{row.workflowType} | |
{row.workflowType || 'N/A'} |
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.
For this one we'll still want to handle the null case from line 57 smile
I thought it would never reach this point (line 77) if row.workflowType
is null, because of the check on line 75?
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 missed that! You're correct. This is great!
Signed-off-by: Rohit Nayak <[email protected]>
Signed-off-by: Rohit Nayak <[email protected]>
…ow types vitessio#12217 , VTAdmin: display workflow type in workflows list vitessio#11685 Signed-off-by: Vilius Okockis <[email protected]>
Description
Adds the workflow type (and if applicable the workflow sub type) to the current
/workflows
endpoint.Signed-off-by: Rohit Nayak [email protected]
Related Issue(s)
#11690
Checklist
Deployment Notes