-
Notifications
You must be signed in to change notification settings - Fork 912
Set model validation lengths based upon react form maxLength #23262
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
base: master
Are you sure you want to change the base?
Conversation
d59848f to
0c7e540
Compare
|
update:
update:
|
0c7e540 to
d879123
Compare
|
update:
|
fde4e05 to
6a295e4
Compare
|
update:
update:
|
6a295e4 to
e4dca87
Compare
|
update:
|
found in ui-classic: app/javascript/components/*/*.schema.js
1952d23 to
fe8046a
Compare
|
update:
|
| has_many :flavors, :through => :cloud_tenant_flavors | ||
| has_many :cloud_volume_types, :through => :ext_management_system | ||
|
|
||
| validates :name, :length => {:maximum => 128} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I mentioned this elsewhere, but any data that can come from providers I don't think we should be as conservative with, otherwise we run the risk of failing during provider collection. On the backend, I think we can be much looser with these values. For example, here I'd be ok with 1k or even higher. The frontend is only for new objects, and those forms (I think) are provider specific, so the value could be different on different forms depending on the provider. I understand the need to limit it to some value, but I'd prefer if it were a really large, but reasonable value.
@agrare Thoughts?
|
|
||
| virtual_total :total_based_volumes, :based_volumes | ||
|
|
||
| validates :description, :length => {:maximum => 50} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great example, where the description (if it's not a name or identifier), could actually be really large coming from a provider.
|
|
||
| validates :name, :presence => true | ||
| validates :name, :presence => true, :length => {:maximum => 256} | ||
| validates :description, :length => {:maximum => 1024} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1kb for a service description feels really small. I'm surprised the UI only allows that much.
|
Checked commits kbrock/manageiq@a4abf7a~...fe8046a with ruby 3.1.5, rubocop 1.56.3, haml-lint 0.59.0, and yamllint |
|
This pull request has been automatically marked as stale because it has not been updated for at least 3 months. If these changes are still valid, please remove the |
Put limits on models so API will not allow very large input
These limits were taken from the React forms found in the react schema.js files.