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

Refactor MiqProvisionWorkflow#initialize method and subclasses #21014

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

chessbyte
Copy link
Member

No description provided.

@Fryguy
Copy link
Member

Fryguy commented Feb 5, 2021

Should these new methods be private methods?

@chessbyte
Copy link
Member Author

@lfu when you get a chance, if you can review and validate in a real provision workflow (I don't have environment to try it), that would be great. This is NOT URGENT and very low priority.

@chessbyte
Copy link
Member Author

@lfu I re-ordered the initialize method here because it seemed that the dialog initialization and configuration has nothing to do with the password_helper and setting instance variables. Let me know if my assumptions are wrong.

end
normalize_numeric_fields unless @dialogs.nil?
Copy link
Member

@Fryguy Fryguy Feb 5, 2021

Choose a reason for hiding this comment

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

I'm curious why this was moved from the if @dialogs.nil? branch

Copy link
Member Author

Choose a reason for hiding this comment

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

that is the way some of the subclasses had it. so I commonized the code.

def initialize(values, requester, options = {})
super

load_source_object if initial_pass?(values, options)
Copy link
Member

Choose a reason for hiding this comment

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

Does this have to happen before the dialogs are loaded? (i.e. in between initialize_dialogs and configure_dialogs?)

Copy link
Member Author

Choose a reason for hiding this comment

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

good question - maybe @lfu knows.

Copy link
Member Author

Choose a reason for hiding this comment

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

@chessbyte chessbyte force-pushed the refactor_miq_provision_worflow_initialize_method_and_subclasses branch from 77b9dea to 518f6d9 Compare February 5, 2021 15:38
@miq-bot miq-bot added the stale label Feb 27, 2023
@miq-bot
Copy link
Member

miq-bot commented Feb 27, 2023

This pull request has been automatically marked as stale because it has not been updated for at least 3 months.

If these changes are still valid, please remove the stale label, make any changes requested by reviewers (if any), and ensure that this issue is being looked at by the assigned/reviewer(s)

Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation.

@kbrock
Copy link
Member

kbrock commented May 3, 2023

This removes a bunch of copy paste code.

Do we want to pick this up, or let stale make it disappear?

@Fryguy
Copy link
Member

Fryguy commented May 16, 2023

I'm surprised this PR is still mergeable - would like @agrare to review and then either accept or close.

@Fryguy Fryguy assigned agrare and unassigned Fryguy May 16, 2023
@Fryguy Fryguy removed the stale label May 16, 2023
@miq-bot miq-bot added the stale label Aug 21, 2023
@miq-bot
Copy link
Member

miq-bot commented Aug 21, 2023

This pull request has been automatically marked as stale because it has not been updated for at least 3 months.

If these changes are still valid, please remove the stale label, make any changes requested by reviewers (if any), and ensure that this issue is being looked at by the assigned/reviewer(s)

Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation.

@miq-bot
Copy link
Member

miq-bot commented Nov 27, 2023

This pull request has been automatically marked as stale because it has not been updated for at least 3 months.

If these changes are still valid, please remove the stale label, make any changes requested by reviewers (if any), and ensure that this issue is being looked at by the assigned/reviewer(s).

1 similar comment
@miq-bot
Copy link
Member

miq-bot commented Mar 4, 2024

This pull request has been automatically marked as stale because it has not been updated for at least 3 months.

If these changes are still valid, please remove the stale label, make any changes requested by reviewers (if any), and ensure that this issue is being looked at by the assigned/reviewer(s).

@miq-bot
Copy link
Member

miq-bot commented Jun 10, 2024

This pull request has been automatically marked as stale because it has not been updated for at least 3 months.

If these changes are still valid, please remove the stale label, make any changes requested by reviewers (if any), and ensure that this issue is being looked at by the assigned/reviewer(s).

1 similar comment
@miq-bot
Copy link
Member

miq-bot commented Sep 16, 2024

This pull request has been automatically marked as stale because it has not been updated for at least 3 months.

If these changes are still valid, please remove the stale label, make any changes requested by reviewers (if any), and ensure that this issue is being looked at by the assigned/reviewer(s).

@kbrock kbrock force-pushed the refactor_miq_provision_worflow_initialize_method_and_subclasses branch from 4094852 to c7243c9 Compare September 17, 2024 18:47
@miq-bot
Copy link
Member

miq-bot commented Sep 17, 2024

Checked commits chessbyte/manageiq@55f03f0~...c7243c9 with ruby 3.1.5, rubocop 1.56.3, haml-lint 0.51.0, and yamllint
3 files checked, 5 offenses detected

app/models/miq_provision_virt_workflow.rb

  • ⚠️ - Line 1117, Col 3 - Lint/IneffectiveAccessModifier - private (on line 965) does not make singleton methods private. Use private_class_method or private inside a class << self block instead.

app/models/miq_request_workflow.rb

  • ⚠️ - Line 1524, Col 26 - Lint/UnusedMethodArgument - Unused method argument - values. If it's necessary, use _ or _values as an argument name to indicate that it won't be used. If it's unnecessary, remove it.
  • ⚠️ - Line 1535, Col 25 - Lint/UnusedMethodArgument - Unused method argument - values. If it's necessary, use _ or _values as an argument name to indicate that it won't be used. If it's unnecessary, remove it. You can also write as configure_dialogs(*) if you want the method to accept any arguments but don't care about them.
  • ⚠️ - Line 1535, Col 33 - Lint/UnusedMethodArgument - Unused method argument - options. If it's necessary, use _ or _options as an argument name to indicate that it won't be used. If it's unnecessary, remove it. You can also write as configure_dialogs(*) if you want the method to accept any arguments but don't care about them.
  • ❗ - Line 1530, Col 34 - Style/IfInsideElse - Convert if nested inside else to elsif.

@kbrock
Copy link
Member

kbrock commented Sep 17, 2024

update:

  • rebased to fix conflict

Can fix cops if we deem we want to still work on this

@Fryguy @agrare do we still want this, or just close?

Copy link
Member

@agrare agrare left a comment

Choose a reason for hiding this comment

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

LGTM, a couple of the options[:skip_dialog_load] == true look like they could drop the == true but that is just moving existing code around.

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