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

Validate name uniqueness for Transformation Plans #17677

Conversation

agrare
Copy link
Member

@agrare agrare commented Jul 9, 2018

Add a unique name validation, scoped to the tenant, for
ServiceTemplateTransformationPlans.

ManageIQ/manageiq-v2v#451

BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1567225

@agrare
Copy link
Member Author

agrare commented Jul 9, 2018

@bzwei do you know why it is failing to have the validation on the subclass? This works from a rails console but fails on the spec test, granted I was calling just .create from rails c not create_catalog_item

@bzwei
Copy link
Contributor

bzwei commented Jul 9, 2018

@agrare our factories for service_template models are all nameless because the base class does not have uniqueness requirement. You will need to feed one name for service_template_transformation_plan

Add a unique name validation, scoped to the tenant, for
ServiceTemplateTransformationPlans.

ManageIQ/manageiq-v2v#451
@agrare agrare force-pushed the validate_name_is_unique_transformation_plan branch from dda7260 to fb695d0 Compare July 9, 2018 19:12
@agrare
Copy link
Member Author

agrare commented Jul 9, 2018

@bzwei oh actually I wasn't even talking about those spec failures, this morning when I tried adding a spec test it passed and didn't raise an exception.
I updated the factory to add a sequenced name and now it is raising an appropriate error.

PTAL

@miq-bot
Copy link
Member

miq-bot commented Jul 9, 2018

Checked commit agrare@fb695d0 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
3 files checked, 0 offenses detected
Everything looks fine. 🍰

@agrare
Copy link
Member Author

agrare commented Jul 9, 2018

Thanks @bzwei

@gmcculloug gmcculloug merged commit 6586413 into ManageIQ:master Jul 9, 2018
@agrare agrare deleted the validate_name_is_unique_transformation_plan branch July 9, 2018 20:09
simaishi pushed a commit that referenced this pull request Jul 26, 2018
…rmation_plan

Validate name uniqueness for Transformation Plans
(cherry picked from commit 6586413)

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

Gaprindashvili backport details:

$ git log -1
commit 80edeaa410ec566b4b0d13bac42999c363833e1c
Author: Greg McCullough <gmccullo@redhat.com>
Date:   Mon Jul 9 16:09:31 2018 -0400

    Merge pull request #17677 from agrare/validate_name_is_unique_transformation_plan
    
    Validate name uniqueness for Transformation Plans
    (cherry picked from commit 6586413443d504a0a2ae5fa4a30072e0145d57b3)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1608768

@agrare agrare added this to the Sprint 90 Ending Jul 16, 2018 milestone Jul 31, 2018
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.

5 participants