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

Bug 1830080: Prompt user to update traffic on revision deletion #5256

Merged

Conversation

jeff-phillips-18
Copy link
Member

Fixes:
https://issues.redhat.com/browse/ODC-2413

Analysis / Root cause:
Users are allowed to delete revisions w/o adjusting traffic distribution.
Users are allowed to delete the last revision in a knative service.

Solution Description:
When a revision is deleted, check if it is the only revision in the service, if so prevent the deletions and inform the user.

When a revision is ok to delete, prompt the user to update the traffic distribution prior to deleting the revision.

Screen shots / Gifs for design review:
Single Revision being deleted:
image

One of three revisions being deleted:
image

One of two revisions being deleted where the second currently receives no traffic:
image

Process of deleting a revision:
DeleteRev

Browser conformance:

  • Chrome
  • Firefox
  • Safari
  • Edge

cc @openshift/team-devconsole-ux @serenamarie125 @beaumorley

/kind bug

@openshift-ci-robot openshift-ci-robot added kind/bug Categorizes issue or PR as related to a bug. bugzilla/severity-unspecified Referenced Bugzilla bug's severity is unspecified for the PR. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Apr 30, 2020
@openshift-ci-robot
Copy link
Contributor

@jeff-phillips-18: This pull request references Bugzilla bug 1830080, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1830080: Prompt user to update traffic on revision deletion

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the component/core Related to console core functionality label Apr 30, 2020
@openshift-ci-robot openshift-ci-robot added the component/knative Related to knative-plugin label Apr 30, 2020
@jeff-phillips-18
Copy link
Member Author

@openshift/team-devconsole-ux @serenamarie125 @beaumorley PTAL

@invincibleJai
Copy link
Member

@jeff-phillips-18 Thanks , it looks great. I verified for below scenarios

  • If only one revision is there
    It works as expected , user is shown with alert

  • if there is more then one revision and user is trying to delete revision which has active traffic
    It works as expected , user is shown with traffic distribution modal prior deletion

  • if there is more then one revision and user is trying to delete revision which has no active traffic
    Here as well user is shown with traffic distribution modal prior deletion, it makes sense as user is shown with pre-filled value of split

import { RevisionModel } from '../../models';
import TrafficSplittingFields from '../traffic-splitting/TrafficSplittingFields';

export interface TrafficSplittingDeleteModalProps {
Copy link
Member

Choose a reason for hiding this comment

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

nit: we may not need to export type

import TrafficSplittingFields from '../traffic-splitting/TrafficSplittingFields';

export interface TrafficSplittingDeleteModalProps {
revisionItems: any;
Copy link
Member

Choose a reason for hiding this comment

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

we can type for revisionItems

@jeff-phillips-18 jeff-phillips-18 force-pushed the revision-delete branch 2 times, most recently from 9c2f9da to b2dcb89 Compare May 6, 2020 14:05
@jeff-phillips-18
Copy link
Member Author

Updated to not show the traffic splitting when the revision being deleted is not receiving traffic:

image

Updated error dialog when attempting to delete the last revision:

image

@jeff-phillips-18
Copy link
Member Author

@openshift/team-devconsole-ux @beaumorley

@jeff-phillips-18
Copy link
Member Author

/test backend

@beaumorley
Copy link

Hi @jeff-phillips-18 this looks good. For the case were the user has to adjust the split for the two remaining revisions, is it an option to disable the delete button until they equal 100? I don't know if we already have a pattern here to show the error like you do so just asking.

Also could we more clearly spell out what they need to do? (A) Make sure you update the traffic distribution among the remaining revisions to equal 100. This might be too conversational but I would want the 100 part at least. So (A) Update the traffic distribution among the remaining revisions to equal 100 <--are there units here?

@jeff-phillips-18
Copy link
Member Author

@beaumorley Those issues should likely be address in https://issues.redhat.com/browse/ODC-2479. There are more changes to the traffic splitting portion's styling and logic going on there.
Could you comment in that issue instead, raise a separate issue, or should that be fixed here, in your opinion?

@serenamarie125
Copy link
Contributor

hey @beaumorley ! All good points, we definitely need to improve this dialog in the future - FYI we've talked about making it more consistent with the Kiali dialog, but these things would need to be tackled in future releases.

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 7, 2020
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 7, 2020
@invincibleJai
Copy link
Member

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 7, 2020
@christianvogt
Copy link
Contributor

/approve

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: christianvogt, invincibleJai, jeff-phillips-18, serenamarie125

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 7, 2020
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit bc40c51 into openshift:master May 8, 2020
@openshift-ci-robot
Copy link
Contributor

@jeff-phillips-18: All pull requests linked via external trackers have merged: openshift/console#5256. Bugzilla bug 1830080 has been moved to the MODIFIED state.

In response to this:

Bug 1830080: Prompt user to update traffic on revision deletion

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@spadgett spadgett added this to the v4.5 milestone May 11, 2020
@jeff-phillips-18 jeff-phillips-18 deleted the revision-delete branch December 2, 2020 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-unspecified Referenced Bugzilla bug's severity is unspecified for the PR. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/core Related to console core functionality component/knative Related to knative-plugin kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants