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

[V2V] Use full class name in task context data for conversion hosts #18799

Closed
wants to merge 2 commits into from
Closed

[V2V] Use full class name in task context data for conversion hosts #18799

wants to merge 2 commits into from

Conversation

djberg96
Copy link
Contributor

@djberg96 djberg96 commented May 23, 2019

Originally we set the resource_type to the full name, e.g. ManageIQ::Providers::Redhat::InfraManager::Host, so that we could take advantage of the SupportsFeature mixin. And so, we added a validation to force the issue.

However, that broke Rails polymorphic associations, so we changed the param internally to just the base name, e.g. host, in #18604.

Unfortunately, this also got saved in the context data for the associated task. The upshot is that when a user tries to use the "retry" button, which uses the context data to resubmit the request, there is a validation failure because the resource type is no longer the full name.

So, this PR restores the full resource type in the context_data of the associated task internally.

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

@djberg96
Copy link
Contributor Author

@mturley Please take a look.

@djberg96
Copy link
Contributor Author

@miq-bot add_label bug, transformation

@djberg96
Copy link
Contributor Author

@miq-bot add_label hammer/yes

@mturley
Copy link
Contributor

mturley commented May 23, 2019

@djberg96 I'm testing this locally and it looks like auth_user is also missing from the request_params. I think we need to include that explicitly too.

@mturley
Copy link
Contributor

mturley commented May 23, 2019

@djberg96
Copy link
Contributor Author

@mturley I was never really sure why that was split out originally. Doesn't seem to be a good reason for it, but I'll just work around it for now.

@djberg96
Copy link
Contributor Author

@mturley @fdupont-redhat Updated.

@miq-bot
Copy link
Member

miq-bot commented May 23, 2019

Checked commits https://github.com/djberg96/manageiq/compare/f11ff8209c7868a93ba48072e6c4f69250bc5144~...aa2e02e78494cad789732f51c5b427da4adb65ba with ruby 2.3.3, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. ⭐

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.

👍 LGTM. Thanks @djberg96

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

👍 LGTM too.

@djberg96
Copy link
Contributor Author

Closing in favor of ManageIQ/manageiq-api#600

@djberg96 djberg96 closed this May 29, 2019
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.

3 participants