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 1891766: Stop non-positive values from being entered by users for min disk size #7890

Merged

Conversation

SanjalKatiyar
Copy link
Contributor

Before:
Screenshot from 2021-01-21 16-09-02
Screenshot from 2021-01-21 16-08-58

After:
Screenshot from 2021-01-21 16-11-49
Screenshot from 2021-01-21 16-11-53

@openshift-ci-robot openshift-ci-robot added bugzilla/severity-unspecified Referenced Bugzilla bug's severity is unspecified for the PR. bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels Jan 21, 2021
@openshift-ci-robot
Copy link
Contributor

@SanjalKatiyar: This pull request references Bugzilla bug 1891766, which is invalid:

  • expected the bug to target the "4.7.0" release, but it targets "---" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

Bug 1891766: Stop non-positive values from being entered by users for min disk size

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/lso Related to local-storage-operator-plugin label Jan 21, 2021
@openshift-ci-robot openshift-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 21, 2021
@openshift-ci-robot
Copy link
Contributor

Hi @SanjalKatiyar. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@SanjalKatiyar
Copy link
Contributor Author

/bugzilla refresh

@openshift-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Jan 21, 2021
@openshift-ci-robot
Copy link
Contributor

@SanjalKatiyar: This pull request references Bugzilla bug 1891766, 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.7.0) matches configured target release for branch (4.7.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

/bugzilla refresh

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 removed the bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label Jan 21, 2021
@bipuladh
Copy link
Contributor

/bugzilla refresh

@openshift-ci-robot openshift-ci-robot added bugzilla/severity-low Referenced Bugzilla bug's severity is low for the branch this PR is targeting. and removed bugzilla/severity-unspecified Referenced Bugzilla bug's severity is unspecified for the PR. labels Jan 25, 2021
@openshift-ci-robot
Copy link
Contributor

@bipuladh: This pull request references Bugzilla bug 1891766, which is valid.

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

In response to this:

/bugzilla refresh

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.

Comment on lines 56 to 58
const validMinDiskSize = /^\+?([1-9]\d*)$/.test(state.minDiskSize || '1');
const validMaxDiskSize = /^\+?([1-9]\d*)$/.test(state.maxDiskSize || '1');
const validMaxDiskLimit = /^\+?([1-9]\d*)$/.test(state.maxDiskLimit || '1');
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
const validMinDiskSize = /^\+?([1-9]\d*)$/.test(state.minDiskSize || '1');
const validMaxDiskSize = /^\+?([1-9]\d*)$/.test(state.maxDiskSize || '1');
const validMaxDiskLimit = /^\+?([1-9]\d*)$/.test(state.maxDiskLimit || '1');
const INTEGER_REGEX = /^\+?([1-9]\d*)$/;
const validMinDiskSize = INTEGER_REGEX.test(state.minDiskSize || '1');
const validMaxDiskSize = INTEGER_REGEX.test(state.maxDiskSize || '1');
const validMaxDiskLimit = INTEGER_REGEX.test(state.maxDiskLimit || '1');

@cloudbehl
Copy link
Contributor

I think the minimum size for a disk can be 0 as well.

Also, I think we need to put one more validation where the value to max disk size should be bigger than the value of min disk size.

@bipuladh ^^

@bipuladh
Copy link
Contributor

I agree with you @cloudbehl . @SanjalKatiyar I guess we will need two regex patterns. One that accepts 0 and the other one that doesn't.
Also we should definitely give a warning in max value/min value based on which one is active so that user doesn't shoot himself in the foot.
@yuvalgalanti wdyt?

Comment on lines 13 to 16
.lso-create-lvs__max-disk-limit {
max-width: 100px;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's remove this as well and use the other class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay... using single class for min disk size, max disk size and max disk limit...

Copy link
Contributor

@bipuladh bipuladh left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 30, 2021
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bipuladh, SanjalKatiyar

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 Jan 30, 2021
@bipuladh
Copy link
Contributor

bipuladh commented Feb 1, 2021

/hold
Backend tests are failing

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 1, 2021
@bipuladh
Copy link
Contributor

bipuladh commented Feb 2, 2021

/hold cancel
/test backend

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 2, 2021
@bipuladh
Copy link
Contributor

bipuladh commented Feb 2, 2021

/retest
/test ceph-storage-plugin

@openshift-merge-robot openshift-merge-robot merged commit f0eb3b2 into openshift:master Feb 2, 2021
@openshift-ci-robot
Copy link
Contributor

@SanjalKatiyar: All pull requests linked via external trackers have merged:

Bugzilla bug 1891766 has been moved to the MODIFIED state.

In response to this:

Bug 1891766: Stop non-positive values from being entered by users for min disk size

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.

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-low Referenced Bugzilla bug's severity is low for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/lso Related to local-storage-operator-plugin lgtm Indicates that a PR is ready to be merged. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants