Closed kbrock closed 1 year ago
app/models/miq_ae_datastore.rb
enabled
.match?
instead of =~
when MatchData
is not used.Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
app/models/miq_ae_datastore.rb | 4 | 15 | 26.67% | ||
<!-- | Total: | 4 | 15 | 26.67% | --> |
Totals | |
---|---|
Change from base Build 4325: | -0.2% |
Covered Lines: | 5032 |
Relevant Lines: | 5884 |
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.
@Fryguy I'm guessing we want to close all automate performance efforts?
Lucy and I were making headway (e.g.: #439) mostly in the realm of deleting inconsistent lookup logic so we could just pass objects around. Having Domain
in core and Namespace
in this repo made this work tricky.
Underlying issue:
Even though domains are very ancestry and includes friendly, they currently are not used and basically force N+1's.
My knowledge is rusty, and I don't have Lucy as a resource. I also am a little gunshy introducing issues in bugs
Verifying: we want to just close these efforts
Yeah if we're moving towards workflows let's not put effort into it
Right now, this is opening a conversation with @lfu
As far as I can tell,
get_homonymic
is basicallyfind_best_match_by
get_homonymic
there are 2 very different signatures depending upon if you have arelative_path
or afqname
.find_best_match_by
doesn't check that the domains are enabled.get_homonymic
typically doesn't check if the domain is enabled (expected the default to be to check).get_homonymic
handles urls - not sure if this is a valid use case.find_best_match_by
needs to be split out concepts ofvisible_by_user()
,domain_priority_order
,best_match
(with a where), andfind_by
(use afirst
)find_best_match_by
allows wild characters for some models. Do we really need this? Where is this actually valid?Could we consolidate this functionality and put into the models,
RelativePathMixin
, orMiqAeDatastore
.Since this is basically an enhanced
find_by
, and you need to passself.class
into theget_homonymic
methods, I'm leaning towards moving it intoRelativePathMixin
There are a few changes in the models, but they are basically consolidating to one method call.
Wanted to know where I should consolidate this stuff before I go all in with these changes.
There is a lot of code around homonymic and it is very inefficient the way it looks up domains and sorts the methods/instances/...
Usage:
get_homonymic
is used in 3 places in the ui, 1 of those calls being to the genericklass
.find_best_match_by is called in 1 place by
MiqAeDomainSearch- the call uses a generic
klass`.