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

Graph refresh use advanced references #16659

Merged
merged 21 commits into from
Feb 1, 2018

Conversation

Ladas
Copy link
Contributor

@Ladas Ladas commented Dec 13, 2017

Depends on:

Using advanced references for finders

lazy_find_vm       = persister.vms.lazy_find(:ems_ref => vm_data(1)[:ems_ref])
lazy_find_hardware = persister.hardwares.lazy_find(:vm_or_template => lazy_find_vm)
persister.networks.lazy_find(
        {:hardware => lazy_find_hardware, :description => "public"},
        :key     => :hostname,
        :default => 'default_value_unknown'),

will help us to build db based queries automatically (so we do not have to pass custom_db... parameters)

And keeping the references around will help with automatic building of targeted_arel queries.

Also it will help us to do skeletal precreate of nested model (e.g. to link to network, we need to first skeletaly precreate the hardware and vm)

@Ladas Ladas changed the title Graph refresh use advanced references [WIP] Graph refresh use advanced references Dec 13, 2017
@Ladas
Copy link
Contributor Author

Ladas commented Dec 13, 2017

@miq-bot add_label enhancement
@miq-bot assign @agrare

@miq-bot miq-bot added the wip label Dec 13, 2017
@Ladas Ladas force-pushed the graph_refresh_use_advanced_references branch from 909eb2b to 3d31e05 Compare January 3, 2018 08:41
@Ladas Ladas changed the title [WIP] Graph refresh use advanced references Graph refresh use advanced references Jan 3, 2018
@Ladas Ladas force-pushed the graph_refresh_use_advanced_references branch from b617110 to 3d31e05 Compare January 3, 2018 08:54
@miq-bot miq-bot removed the wip label Jan 3, 2018
@Ladas Ladas force-pushed the graph_refresh_use_advanced_references branch 2 times, most recently from bf41528 to 7faf9c9 Compare January 4, 2018 11:02
@Ladas
Copy link
Contributor Author

Ladas commented Jan 4, 2018

@agrare we will need to merge ManageIQ/manageiq-providers-ansible_tower#47 before this, there seems to be a cyclical dependency

@Ladas Ladas closed this Jan 15, 2018
@Ladas Ladas reopened this Jan 15, 2018
@miq-bot
Copy link
Member

miq-bot commented Jan 26, 2018

This pull request is not mergeable. Please rebase and repush.

@Ladas Ladas force-pushed the graph_refresh_use_advanced_references branch from 7faf9c9 to 4a4a75c Compare January 26, 2018 13:52
Ladas added 8 commits January 29, 2018 18:07
Move references out of InventoryCollection to ReferencesStorage
All finders are using references now
Pass index name and use references
Add IC reference class, which serves for all referencing
but also to track additional info about the reference.
This info will help us to construct complex queries.
Add Storage for references, separating it from IC
Use references in LocalDb index
Use add_reference in scanner
Use reference in InventoryObject
Ladas added 12 commits January 29, 2018 18:07
Use reference in InventoryObjectLazy
Use reference builder in savers
Changed reference builder interface
Move spec parsed data to common helpers
Add detailed asserts for all finders
Add advanced specs for finders
Rename index_data to full_reference
Fix exceptions to better format
Add vm_and_template_labels to base defaults
Fix specs to use new references
Autofix rubocop issues
Fix rubocop issue about useless protected and private methods
return if manager_uuid.nil?

manager_uuid = stringify_index_value(manager_uuid, ref)
# TODO(lsmola) this method shoul return lazy too, the rest of the finders should be deprecated
Copy link
Member

Choose a reason for hiding this comment

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

shoul/should

@agrare
Copy link
Member

agrare commented Feb 1, 2018

Good looking tests, just the one typo and looks good to me

Fix TODO typo
@Ladas Ladas force-pushed the graph_refresh_use_advanced_references branch from 4a4a75c to 88019a6 Compare February 1, 2018 13:22
@miq-bot
Copy link
Member

miq-bot commented Feb 1, 2018

Checked commits Ladas/manageiq@36ee4ef~...88019a6 with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0
22 files checked, 17 offenses detected

app/models/manager_refresh/inventory_collection_default/cloud_manager.rb

spec/models/manager_refresh/persister/finders_spec.rb

spec/models/manager_refresh/save_inventory/acyclic_graph_of_inventory_collections_spec.rb

@agrare agrare merged commit a07ec73 into ManageIQ:master Feb 1, 2018
@agrare agrare added this to the Sprint 79 Ending Feb 12, 2018 milestone Feb 1, 2018
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.

3 participants