-
Notifications
You must be signed in to change notification settings - Fork 898
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
Add ConversionHost validations #18277
Add ConversionHost validations #18277
Conversation
@jameswnl @fdupont-redhat Please take a look. This is as strict as I could make it without breaking service templates. |
@djberg96 didn't we add |
@djberg96 I think we're just stubbing way too many things, the vm/host ipaddresses should be hardware.networks and the active tasks should just use the association. I think some of these used to be method calls but now that they're real associations we should just set this up for real instead of stubbing. |
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.
(Just a drive by)
Saw the p
and thought I'd comment
spec/models/service_template_transformation_plan_request_spec.rb
Outdated
Show resolved
Hide resolved
@agrare I've only added one stub, and then only because of some odd behavior that @gmcculloug had to narrow down, so I feel like adding "real" network data would just be testing that Rails associations work as advertised. I actually started doing that, and it was just more work than it was worth IMHO. |
@agrare True, we could put some of the logic in the
That, or update the |
Checked commits https://github.com/djberg96/manageiq/compare/bd2ade60f867d5e2e2e73c7d5ee6d5c16521fd9c~...99d065703aa6daf95f35af7850947fe30f3938af with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 app/models/conversion_host.rb
|
A recent change in ManageIQ/manageiq#18277 caused specs to fail in the API since the new validations no longer allow the specs to create `:conversion_host` factories. This change simply updates the specs to support these new restrictions, but it might not be the ideal API interface.
in ManageIQ/manageiq#18277 Fixes failing tests.
@miq-bot add_label hammer/yes |
Add ConversionHost validations (cherry picked from commit c617468) https://bugzilla.redhat.com/show_bug.cgi?id=1694229
Hammer backport details:
|
…ations2" This reverts commit 373368e.
Reverted the backport:
|
Add ConversionHost validations (cherry picked from commit c617468) https://bugzilla.redhat.com/show_bug.cgi?id=1696437
Hammer backport details:
|
As I was doing some general testing with various POST operations with the REST API for conversion hosts, I realized there were almost no validations on the model. This PR adds some validations to a few columns, specifically the following:
Replaces #18264
The "VmOrTemplate" was required for the service template request/plan models and specs, as was the check for the presence of an IP address before validating.Ignore that first part, we only need
VmOrTemplate
and notVm
, since it's a subclass.https://bugzilla.redhat.com/show_bug.cgi?id=1622728https://bugzilla.redhat.com/show_bug.cgi?id=1695797