Skip to content

Conversation

@DavidResende0
Copy link
Member

@DavidResende0 DavidResende0 commented Oct 6, 2020

Form can be found in Storage->Block Storage->Volumes

Fixes #7334

@DavidResende0
Copy link
Member Author

@miq-bot add_reviewer @skateman

Copy link
Member

@skateman skateman left a comment

Choose a reason for hiding this comment

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

I created a core PR that should allow us more precise querying of the supported providers for create and edit separately. Please change the logic accordingly.

Copy link
Member

@skateman skateman left a comment

Choose a reason for hiding this comment

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

Due to some complex conditions in the amazon form, we need to tap into some dark magic to hide the standard (Magnetic) volume type from the dropdown when editing a non-magnetic amazon volume.

Copy link
Member

@skateman skateman left a comment

Choose a reason for hiding this comment

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

This is getting close, just please avoid applying suggested changes using the browser as it creates a mess in the code/commits.

Copy link
Member

@skateman skateman left a comment

Choose a reason for hiding this comment

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

There are a bunch of linting errors in the codebase, please integrate eslint into your editor to see them.

@DavidResende0 DavidResende0 force-pushed the react-cloud-volume branch 2 times, most recently from d26b28a to 734a50b Compare November 6, 2020 19:13
@skateman
Copy link
Member

@DavidResende0 can you please rebase this PR?

@DavidResende0 DavidResende0 force-pushed the react-cloud-volume branch 2 times, most recently from dbf0733 to eaae185 Compare January 18, 2021 17:42
@skateman skateman changed the title [WIP] Re-writing Cloud Volume Form to React Rewriting Cloud Volume Form to React Jan 19, 2021
@skateman skateman requested review from agrare and jaywcarman January 19, 2021 07:17
@skateman
Copy link
Member

Fields are now provider-specific, coming from the API, so there are some differences. The steps/size things is also coming from the provider, it's their decision to have bytes/gbytes, not a UI problem 😉

@himdel
Copy link
Contributor

himdel commented Feb 10, 2021

The steps/size things is also coming from the provider, it's their decision to have bytes/gbytes, not a UI problem

Right, so..

I can't help but notice the "provider decision" was made by you :)

Let's fix it before merging, bad UI is always a UI problem :).

@skateman
Copy link
Member

skateman commented Feb 10, 2021

Different provider backend expect different values (bytes, gigabytes) so I don't know what would be the fix here. Also it's not related to this PR as it is coming from the provider ...

Amazon/Openstack expects bytes, while IBM needs GBs

@chessbyte
Copy link
Member

Amazon/Openstack expects bytes, while IBM needs GBs

We should make our provider plugins work from a single standard and do necessary conversions when communicating with the actual provider. I am assuming that standard is bytes. /cc @agrare

@skateman
Copy link
Member

The point of provider pluggability and form schemas coming over the API is that these things aren't implemented in the UI repo anymore and they don't block us in merging this. With other words: there is nothing else to do in this repo so why can't we get this in @himdel?

@agrare
Copy link
Member

agrare commented Feb 11, 2021

I agree that all providers should use bytes for consistency (someone could be calling CloudVolume.create from automate and the options should be consistent).

We also don't have to do that before this PR is merged, it can be fixed in the IBM Cloud repo independently.

@agrare
Copy link
Member

agrare commented Feb 11, 2021

I can't help but notice the "provider decision" was made by you :)

He decided on bytes which was correct ;) Looks like IBM API takes GB but we should be converting that in raw_create_volume not in the form.

@agrare
Copy link
Member

agrare commented Feb 11, 2021

@himdel all providers are consistent now, please take another look

@skateman
Copy link
Member

I can't help but notice the "provider decision" was made by you :)

He decided on bytes which was correct ;) Looks like IBM API takes GB but we should be converting that in raw_create_volume not in the form.

No, I didn't 😆 IBM folks were complaining that the form isn't working

@jaywcarman
Copy link
Member

jaywcarman commented Feb 11, 2021

IBM guy here 😄. I understand the value in consistent provider back-ends, so I agree with ManageIQ/manageiq-providers-ibm_cloud#135. But now the user interface to create volumes for the IBM Cloud provider isn't great. Is there a way to define the provider form to display GB to the user, but submit the value as bytes? It seems arduous to ask a user to type 107374182400 (or click the step button 100 times) if they want a 100GB volume.

@skateman
Copy link
Member

@jaywcarman @agrare @himdel do we have to do anything else in this PR or these problems can be solved in the provider repos? In that case what is blocking us from merging this UI PR?

@skateman skateman closed this Feb 15, 2021
@skateman skateman reopened this Feb 15, 2021
Copy link
Member

@skateman skateman left a comment

Choose a reason for hiding this comment

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

The Carbon mapper got merged, you should rebase

@miq-bot
Copy link
Member

miq-bot commented Feb 16, 2021

Checked commit DavidResende0@140a2ee with ruby 2.6.3, rubocop 0.82.0, haml-lint 0.35.0, and yamllint
4 files checked, 1 offense detected

**

  • 💣 💥 🔥 🚒 - Linter/Haml - Linter::Haml STDERR:
warning: parser/current is loading parser/ruby26, which recognizes
warning: 2.6.6-compliant syntax, but you are running 2.6.3.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.

@skateman
Copy link
Member

@jaywcarman @agrare @himdel do we have to do anything else in this PR or these problems can be solved in the provider repos? In that case what is blocking us from merging this UI PR?

bump

@jaywcarman
Copy link
Member

@jaywcarman @agrare @himdel do we have to do anything else in this PR or these problems can be solved in the provider repos? In that case what is blocking us from merging this UI PR?

I don't have any issues with merging this PR. If we do that I can open an issue against the IBM Cloud provider to discuss whether/how to improve the display units.

@agrare
Copy link
Member

agrare commented Feb 18, 2021

@skateman merge away if you're good with this

@h-kataria h-kataria merged commit 0a65dc7 into ManageIQ:master Feb 18, 2021
@himdel
Copy link
Contributor

himdel commented Feb 19, 2021

@jaywcarman There's likely no way you can do the conversion in the provider repo, unfortunately :(.

The only way is for the UI to provide a bytes-to-human-size component the providers can then use. Looks like the UI changes will be up to you then, sorry about that. ( #7311 should be a good example of enhancing an existing component by wrapping it, in your case you'd be creating a new one by wrapping an existing number input, but otherwise the principle should be the same)

If you do end up fixing it, please make sure the component is used by all the providers :)

do we have to do anything else in this PR or these problems can be solved in the provider repos? In that case what is blocking us from merging this UI PR?

Sorry, I was too late. The logic was, without this PR, everybody can still use the old forms, with gigabytes and we don't have a TODO(before release).

I do agree with the need to settle on bytes on the data level, but IMO without a component to convert that, it makes the UI less than useable. And I'm not aware of any way to do that from a provider repo (other than doing what should be done here, except 3 times).

(Though, one possible consideration, values over 8 PB can't be represented exactly in js if the representation is numeric bytes.)

@skateman
Copy link
Member

@himdel without this PR you can't really create IBM cloud volumes. Also who would actually create a volume that has 8 PB??? 😱

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 a new Cloud Volume' form is vendor specific

9 participants