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

Move reportable metric and cost fields to method #11647

Merged

Conversation

lpichler
Copy link
Contributor

@lpichler lpichler commented Oct 3, 2016

@miq-bot add_label chargeback, refactoring

@miq-bot assign @gtanzillo

@miq-bot
Copy link
Member

miq-bot commented Oct 3, 2016

Checked commit lpichler@cd9dfc0 with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1
1 file checked, 0 offenses detected
Everything looks good. 🍰

@chrisarcand
Copy link
Member

What benefits does this change provide?

This provides YACM (Yet Another Class Method™) that simply provides an even larger public interface to an otherwise private implementation (Class Method Spaghetti™), so unless it's removing duplication, has some sort of public API consideration...I see it as a more negative change than beneficial.

@isimluk
Copy link
Member

isimluk commented Oct 4, 2016

I see it as a slightly positive change more than negative, as it reduces complexity of overly complex algorithm. The other benefit is that the chunk of code got somewhat useful name, so it can be better understood.

We have discussed this with @lpichler and I think he will be able to put this method into ChargebackRateDetail once we refactor defined_column_for_report condition out of it.

I think this became more obvious only after we started thinking about this chunk of code as a method. Finding a proper class to define it and perhaps changing scope is natural next step. :)

@chrisarcand
Copy link
Member

as it reduces complexity of overly complex algorithm.

No complexity is saved here; it's simply moved and given another name.

Finding a proper class to define it and perhaps changing scope is natural next step. :)

Yup, a step toward something even better I can understand :) If this helps in future refactoring, sounds good. My main gripe is that it opens a public API that may or may not be appropriate for consumption by anything but the way it is now, so when possible I'd love to privatize whatever you extract. You can even use private_class_method. But as you're talking about moving this around soon, I won't block you further!

LGTM 👍

@chrisarcand chrisarcand merged commit cb340f9 into ManageIQ:master Oct 4, 2016
@chrisarcand chrisarcand added this to the Sprint 48 Ending Oct 24, 2016 milestone Oct 4, 2016
@lpichler
Copy link
Contributor Author

lpichler commented Oct 4, 2016

thanks!

@chrisarcand
Copy link
Member

chrisarcand commented Oct 4, 2016

Whoops, we're now in stabilization period for Euwe.

@lpichler
Copy link
Contributor Author

lpichler commented Oct 20, 2016

marking back to euwe/yes because we have PRs (#11685, #11648 ) which depends on this.

@miq-bot remove_label euwe/no

@miq-bot
Copy link
Member

miq-bot commented Oct 20, 2016

@lpichler unrecognized command 'remove_add', ignoring...

Accepted commands are: add_label, remove_label, rm_label, assign, set_milestone

@miq-bot miq-bot removed the euwe/no label Oct 20, 2016
@lpichler
Copy link
Contributor Author

@miq-bot add_label euwe/yes

lpichler pushed a commit to lpichler/manageiq that referenced this pull request Oct 21, 2016
…s_to_method

Move reportable metric and cost fields to method
(cherry picked from commit cb340f9)
chessbyte pushed a commit that referenced this pull request Oct 21, 2016
Move reportable metric and cost fields to method
(cherry picked from commit cb340f9)
@chessbyte
Copy link
Member

Euwe Backport details:

$ git log -1
commit fb25610d7f6edd98d6deb0910044ccaa8458ec11
Author: Chris Arcand <chrisarcand@users.noreply.github.com>
Date:   Tue Oct 4 09:55:21 2016 -0500

    Merge pull request #11647 from lpichler/move_reportable_fields_to_method

    Move reportable metric and cost fields to method
    (cherry picked from commit cb340f9d83dc9480ec7b35725ec2ebcec0acaaf9)

@lpichler lpichler deleted the move_reportable_fields_to_method branch March 3, 2017 09:41
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.

6 participants