ManageIQ / manageiq-automation_engine

Automation engine for ManageIQ
Apache License 2.0
11 stars 74 forks source link

[WIP] prune down get_homonymic #452

Closed kbrock closed 1 year ago

kbrock commented 4 years ago

Right now, this is opening a conversation with @lfu

As far as I can tell, get_homonymic is basically find_best_match_by

Could we consolidate this functionality and put into the models, RelativePathMixin, or MiqAeDatastore.

Since this is basically an enhanced find_by, and you need to pass self.class into the get_homonymic methods, I'm leaning towards moving it into RelativePathMixin

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:

miq-bot commented 4 years ago

Checked commit https://github.com/kbrock/manageiq-automation_engine/commit/eb121c15f93170ddd76f9d8bd287bfe12f626ac5 with ruby 2.5.7, rubocop 0.69.0, haml-lint 0.28.0, and yamllint 1 file checked, 5 offenses detected

app/models/miq_ae_datastore.rb

coveralls commented 4 years ago

Pull Request Test Coverage Report for Build 4351


Changes Missing Coverage Covered Lines Changed/Added Lines %
app/models/miq_ae_datastore.rb 4 15 26.67%
<!-- Total: 4 15 26.67% -->
Totals Coverage Status
Change from base Build 4325: -0.2%
Covered Lines: 5032
Relevant Lines: 5884

💛 - Coveralls
miq-bot commented 1 year ago

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 commented 1 year ago

@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

Fryguy commented 1 year ago

Yeah if we're moving towards workflows let's not put effort into it