-
Notifications
You must be signed in to change notification settings - Fork 900
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
Remove unused conditional from class_for_platform in MiqProvisionWorkflow #19751
Remove unused conditional from class_for_platform in MiqProvisionWorkflow #19751
Conversation
@miq-bot add_label refactoring |
# example, the argument "openstack" would become: | ||
# | ||
# "ManageIQ::Providers::Openstack::CloudManager::ProvisionWorkflow" | ||
# | ||
def self.class_for_platform(platform) |
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.
@Fryguy Are we ready to drop support for the old naming scheme?
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.
@agrare Do you know of any providers that still use these old constant names? (OpenstackInfra
)
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'm not really sure... at a minimum @djberg96 can you do cross-repo tests on this to ensure the constant is not being used anywhere?
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.
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.
We should probably log a deprecation warning for a release first. What do you think?
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.
@bdunne I guess I'm not following how you want it to look then.
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.
if classy =~ /(.*)Infra/
Vmdb::Deprecation.deprecation_warning("MiqProvisionWorkflow.class_for_platform with platform #{platform}")
find_matching_constant("MiqProvision#{classy}Workflow") ||
...
would give you
DEPRECATION WARNING: MiqProvisionWorkflow.class_for_platform with platform OpenstackInfra is deprecated and will be removed from ManageIQ L-release (called from irb_binding at (irb):4)
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 guess I don't see the benefit of that. The cross-repo tests passed, and nothing uses the old naming scheme any more, right?
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 guess I don't see the benefit of that. The cross-repo tests passed, and nothing uses the old naming scheme any more, right?
Yes, the code paths that have test coverage aren't using it.
@gmcculloug What's your comfort level with this?
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.
@bdunne Made the change locally and tried a few paths, all looked good. 👍
@bdunne, @gmcculloug Are you ok with this? |
Checked commits https://github.com/djberg96/manageiq/compare/0244c00ae610a43954e74058416e97abce175041~...fe1ad03741f2f7be4461c02a05e10fd255c49233 with ruby 2.5.7, rubocop 0.69.0, haml-lint 0.28.0, and yamllint |
This PR removes what appears to be a legacy conditional that will never actually be triggered. I also added some comments.
Followup to #19713