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

Remove unused conditional from class_for_platform in MiqProvisionWorkflow #19751

Merged
merged 3 commits into from
Jun 30, 2020
Merged

Remove unused conditional from class_for_platform in MiqProvisionWorkflow #19751

merged 3 commits into from
Jun 30, 2020

Conversation

djberg96
Copy link
Contributor

This PR removes what appears to be a legacy conditional that will never actually be triggered. I also added some comments.

Followup to #19713

@djberg96 djberg96 changed the title Remove unused conditional from class_for_platform, add comments. Remove unused conditional from class_for_platform in MiqProvisionWorkflow Jan 23, 2020
@djberg96
Copy link
Contributor Author

@miq-bot add_label refactoring

@djberg96
Copy link
Contributor Author

@miq-bot add_reviewer @bdunne

@miq-bot miq-bot requested a review from bdunne February 26, 2020 18:42
# example, the argument "openstack" would become:
#
# "ManageIQ::Providers::Openstack::CloudManager::ProvisionWorkflow"
#
def self.class_for_platform(platform)
Copy link
Member

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?

Copy link
Member

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)

Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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)

Copy link
Contributor Author

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?

Copy link
Member

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?

Copy link
Member

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. 👍

@djberg96
Copy link
Contributor Author

@bdunne, @gmcculloug Are you ok with this?

@miq-bot
Copy link
Member

miq-bot commented Jun 30, 2020

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
1 file checked, 0 offenses detected
Everything looks fine. 👍

@bdunne bdunne merged commit 08fdab5 into ManageIQ:master Jun 30, 2020
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