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

[#911] Add validation to migration throttling inputs and add CPU throttling field #915

Conversation

mzazrivec
Copy link
Contributor

@mzazrivec mzazrivec commented Mar 19, 2019

Initial screen
migration01

Validation error
migration02

Validation pass
migration03

Fixes: #911

Associated RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1690851

@@ -34,14 +34,30 @@ export class GeneralSettings extends React.Component {
};

render() {
const { isFetchingServers, isFetchingSettings, isSavingSettings, savedSettings, settingsForm } = this.props;
const {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 9 locations. Consider refactoring.

input: { value, onChange },
postfix
} = this.props;
const { id, label, input, postfix, initialUncheckedValue, meta } = this.props;
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 6 locations. Consider refactoring.

@mzazrivec mzazrivec changed the title Add validation to migration throttling inputs [WIP] Add validation to migration throttling inputs Mar 19, 2019
@mzazrivec mzazrivec added the wip label Mar 19, 2019
@mzazrivec mzazrivec force-pushed the add_validation_to_migration_throttling_inputs branch from c934b51 to c864c98 Compare March 19, 2019 15:58
@mzazrivec mzazrivec changed the title [WIP] Add validation to migration throttling inputs Add validation to migration throttling inputs Mar 19, 2019
@mzazrivec mzazrivec removed the wip label Mar 19, 2019
@mzazrivec mzazrivec force-pushed the add_validation_to_migration_throttling_inputs branch from ca776f7 to c8c6166 Compare March 20, 2019 10:01
Copy link
Contributor

@mturley mturley left a comment

Choose a reason for hiding this comment

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

This looks pretty good! What happened to those postfix labels, though?

@@ -287,8 +287,10 @@ Object {
"isSavingSettings": false,
"postConversionHostsResults": Array [],
"savedSettings": Object {
"cpu_limit_per_host": undefined,
Copy link
Contributor

Choose a reason for hiding this comment

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

We should add these fields to the SettingsReducer tests so they appear in the snapshots here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right. Fixed.

</div>
<InputGroup>
<FormControl type="text" name={id} id={id} readOnly={!this.state.inputEnabled} {...input} />
<InputGroup.Addon>{postfix}</InputGroup.Addon>
Copy link
Contributor

Choose a reason for hiding this comment

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

I haven't had a chance yet to test this locally, but based on your screenshots it doesn't look like this postfix is rendering anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, those labels are being rendered correctly (I forgot to update screenshots in the initial comment).

@mzazrivec
Copy link
Contributor Author

What happened to those postfix labels, though?

Those postfix labels do work, I just forgot to update the screenshots with the working version. Fixed now.

@mzazrivec mzazrivec force-pushed the add_validation_to_migration_throttling_inputs branch from c8c6166 to 16c1b4a Compare March 25, 2019 12:05
@mturley mturley self-assigned this Mar 25, 2019
@mzazrivec mzazrivec changed the title Add validation to migration throttling inputs [#911] Add validation to migration throttling inputs Mar 26, 2019
Copy link
Contributor

@mturley mturley left a comment

Choose a reason for hiding this comment

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

Forgot to get back around to this... this looks good, just waiting to merge it until after ManageIQ/manageiq#18576 is merged.

@mturley mturley changed the title [#911] Add validation to migration throttling inputs [#911] Add validation to migration throttling inputs and add CPU and network throttling fields Apr 10, 2019
@mturley
Copy link
Contributor

mturley commented Apr 10, 2019

This PR is associated with this BZ targeted for 5.10.4: https://bugzilla.redhat.com/show_bug.cgi?id=1690851

@mturley
Copy link
Contributor

mturley commented Apr 17, 2019

@mzazrivec sorry for the additional churn, but based on the call with @fdupont-redhat earlier today, it looks like CPU throttling will make it in for 5.10.4 but the network throttling will need to wait until 5.10.5.

So... deja vu... can we comment out the network field and turn this PR into CPU throttling only, and then open another PR to re-enable the network field?

@mzazrivec mzazrivec force-pushed the add_validation_to_migration_throttling_inputs branch from 16c1b4a to 929d236 Compare April 18, 2019 09:47
@miq-bot
Copy link
Member

miq-bot commented Apr 18, 2019

Checked commits mzazrivec/miq_v2v_ui_plugin@a2d20cf~...929d236 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
0 files checked, 0 offenses detected
Everything looks fine. ⭐

@mzazrivec
Copy link
Contributor Author

@mturley Sure, I removed the network throttling in a separate commit, which can be later reverted (once backend support is in).

@mturley mturley changed the title [#911] Add validation to migration throttling inputs and add CPU and network throttling fields [#911] Add validation to migration throttling inputs and add CPU throttling field Apr 18, 2019
@mturley
Copy link
Contributor

mturley commented Apr 18, 2019

Perfect, thanks @mzazrivec. I moved the network part of the issue to #940 so we can still close #911 here.

@mturley
Copy link
Contributor

mturley commented Apr 18, 2019

@mzazrivec, last thing, I promise.... I was giving your changes a final review and I noticed we never right-aligned the field names for the Concurrent Migrations section like they are in the mockups. We should have those two field labels right-aligned, and the ones with the checkboxes left-aligned. If you could make that change I'll approve the PR, sorry I didn't notice sooner.

@mzazrivec
Copy link
Contributor Author

@mturley Initially, I did try to implement it that way, but it did not look very good in my opinion:

form02

vs. all labeles left aligned:
form01

I can make the change, if you insist, but I'd rather keep it the way it looks right now, since mixing the label alignments produces a bit funny look & fell (in my opinion of course).

@mturley
Copy link
Contributor

mturley commented Apr 18, 2019

I think I agree with you, but I'll let @vconzola make the final decision.

@vconzola
Copy link

Per our discussion in the v2v standup meeting, @mturley will try to make a simple change to the CSS class to use top aligned labels. But if it's too much, let's just leave them left aligned.

@mturley
Copy link
Contributor

mturley commented Apr 18, 2019

@mzazrivec here's a commit that switches the form to a vertical layout: mturley@ef218c0
(edit: replaced 100px field width with 150px so the validation message fits)
(edit 2: fixed some padding in response to feedback from Vince)

It looks like this. @vconzola does this look good to you?

Screenshot 2019-04-18 13 12 35

With validation error showing:

Screenshot 2019-04-18 12 05 03

@vconzola
Copy link

Other than my few comments in Slack, LGTM. Ship it.

@mturley
Copy link
Contributor

mturley commented Apr 18, 2019

Ok @mzazrivec I made a couple other tweaks to the commit based on feedback from Vince, here's the final version to cherry-pick: mturley@ef218c0

@mturley
Copy link
Contributor

mturley commented Apr 18, 2019

The backend PR this depended on is also now merged (ManageIQ/manageiq#18576).

@mturley
Copy link
Contributor

mturley commented Apr 18, 2019

I'm going to go ahead and merge this one as-is so it can make the GA build, I'll open a separate PR to change the layout to vertical.

@mturley mturley merged commit 03106c9 into ManageIQ:master Apr 18, 2019
simaishi pushed a commit that referenced this pull request Apr 22, 2019
…rottling_inputs

[#911] Add validation to migration throttling inputs and add CPU throttling field

(cherry picked from commit 03106c9)

https://bugzilla.redhat.com/show_bug.cgi?id=1702085
@simaishi
Copy link
Contributor

Hammer backport details:

$ git log -1
commit ea0aa2770cedba6d7c4098891e79d64244945652
Author: Mike Turley <[email protected]>
Date:   Thu Apr 18 14:56:43 2019 -0400

    Merge pull request #915 from mzazrivec/add_validation_to_migration_throttling_inputs
    
    [#911] Add validation to migration throttling inputs and add CPU throttling field
    
    (cherry picked from commit 03106c9ca7a9c72d54e70c1eddfac9af53f3404f)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1702085

simaishi added a commit that referenced this pull request May 7, 2019
…ation_throttling_inputs"

This reverts commit ea0aa27.
@simaishi
Copy link
Contributor

simaishi commented May 7, 2019

Reverted Hammer backport.

commit 0fed6ddaf19579f0c5cdec13a7e7a2b704bfc66f
Author: Satoe Imaishi <[email protected]>
Date:   Tue May 7 18:17:42 2019 -0400

    Revert "Merge pull request #915 from mzazrivec/add_validation_to_migration_throttling_inputs"
    
    This reverts commit ea0aa2770cedba6d7c4098891e79d64244945652.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add/un-hide throttling settings for CPU limits
6 participants