Skip to content
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

Merged

Conversation

rohit-nayak-ps
Copy link
Contributor

@rohit-nayak-ps rohit-nayak-ps commented Nov 10, 2022

Description

Adds the workflow type (and if applicable the workflow sub type) to the current /workflows endpoint.

Workflows   VTAdmin (1)
Workflows   VTAdmin

Signed-off-by: Rohit Nayak [email protected]

Related Issue(s)

#11690

Checklist

  • "Backport me!" label has been added if this change should be backported
  • Tests were added or are not required
  • Documentation was added or is not required

Deployment Notes

@rohit-nayak-ps rohit-nayak-ps added Type: Enhancement Logical improvement (somewhere between a bug and feature) Component: VReplication Component: VTAdmin VTadmin interface labels Nov 10, 2022
@vitess-bot
Copy link
Contributor

vitess-bot bot commented Nov 10, 2022

Review Checklist

Hello reviewers! 👋 Please follow this checklist when reviewing this Pull Request.

General

  • Ensure that the Pull Request has a descriptive title.
  • If this is a change that users need to know about, please apply the release notes (needs details) label so that merging is blocked unless the summary release notes document is included.

If a new flag is being introduced:

  • Is it really necessary to add this flag?
  • Flag names should be clear and intuitive (as far as possible)
  • Help text should be descriptive.
  • Flag names should use dashes (-) as word separators rather than underscores (_).

If a workflow is added or modified:

  • Each item in Jobs should be named in order to mark it as required.
  • If the workflow should be required, the maintainer team should be notified.

Bug fixes

  • There should be at least one unit or end-to-end test.
  • The Pull Request description should include a link to an issue that describes the bug.

Non-trivial changes

  • There should be some code comments as to why things are implemented the way they are.

New/Existing features

  • Should be documented, either by modifying the existing documentation or creating new documentation.
  • New features should have a link to a feature request issue or an RFC that documents the use cases, corner cases and test cases.

Backward compatibility

  • Protobuf changes should be wire-compatible.
  • Changes to _vt tables and RPCs need to be backward compatible.
  • vtctl command output order should be stable and awk-able.
  • RPC changes should be compatible with vitess-operator
  • If a flag is removed, then it should also be removed from VTop, if used there.

@rohit-nayak-ps rohit-nayak-ps added Component: VTAdmin VTadmin interface and removed Component: VTAdmin VTadmin interface labels Nov 11, 2022
Signed-off-by: Rohit Nayak <[email protected]>
Signed-off-by: Rohit Nayak <[email protected]>
@rohit-nayak-ps rohit-nayak-ps changed the title WIP: VTAdmin: display workflow type in workflows list VTAdmin: display workflow type in workflows list Nov 11, 2022
@rohit-nayak-ps rohit-nayak-ps marked this pull request as ready for review November 11, 2022 15:15
Copy link
Contributor

@mattlord mattlord left a 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"])
Copy link
Contributor

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.

@deepthi
Copy link
Member

deepthi commented Nov 16, 2022

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.

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.

Copy link
Member

@deepthi deepthi left a 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.

Comment on lines 77 to 79
<span className="text-sm">
{row.workflowSubType !== 'None' ? ' (' + row.workflowSubType + ')' : ''}
</span>
Copy link
Contributor

@notfelineit notfelineit Nov 16, 2022

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;

Suggested change
<span className="text-sm">
{row.workflowSubType !== 'None' ? ' (' + row.workflowSubType + ')' : ''}
</span>
{row.workflowSubtype && row.workflowSubtype != 'None' && (
<span className="text-sm">
{'(' + row.workflowSubType + ')'}
</span>
)}

Copy link
Contributor

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}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{row.workflowType}
{row.workflowType || 'N/A'}

Copy link
Contributor

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}
Copy link
Contributor

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 😄

Suggested change
{row.workflowType}
{row.workflowType || 'N/A'}

Copy link
Contributor Author

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?

Copy link
Contributor

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]>
@rohit-nayak-ps rohit-nayak-ps merged commit 77506ae into vitessio:main Nov 17, 2022
@rohit-nayak-ps rohit-nayak-ps deleted the vtadmin-display-workflow-type branch November 17, 2022 16:39
DeathBorn added a commit to vinted/vitess that referenced this pull request Apr 23, 2024
…ow types vitessio#12217 , VTAdmin: display workflow type in workflows list  vitessio#11685

Signed-off-by: Vilius Okockis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: VReplication Component: VTAdmin VTadmin interface Type: Enhancement Logical improvement (somewhere between a bug and feature)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants