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

Use MiqPreloader/Relationship improvements in MiqRequestWorkflow #17461

Commits on May 21, 2018

  1. Add MiqPreloader.polymorphic_preload_for_child_classes

    This is a specialized preloader for classes with polymorphic
    relationships that allows for targeted preloading for those specific
    class types on said polymorphic relationships.  This allows for taking
    advantage of those associations by allowing scopes to be applied to the
    specific relationships and subsequent calls to the relationship can have
    those query definitions applied.
    NickLaMuro committed May 21, 2018
    Configuration menu
    Copy the full SHA
    2f971d5 View commit details
    Browse the repository at this point in the history

Commits on May 22, 2018

  1. Move miq_preloader_spec tree building logic to shared_context

    This makes a new rspec shared_context that can be used to replicate the
    tree building functionality in the specs that test the method
    `MiqPreloader.polymorphic_preload_for_child_classes`.  The same data can
    then be used in higher level abstraction tests to confirm the
    functionality works as expected there as well.
    NickLaMuro committed May 22, 2018
    Configuration menu
    Copy the full SHA
    4980f77 View commit details
    Browse the repository at this point in the history
  2. Use .polymorphic_preload_for_child_classes in .fulltree_arranged

    Makes use of MiqPreloader.polymorphic_preload_for_child_classes in
    RelationshipMixin.fulltree_arranged to allow the caller to preload
    specific resource relationships and sub relationships.
    NickLaMuro committed May 22, 2018
    Configuration menu
    Copy the full SHA
    5d016ab View commit details
    Browse the repository at this point in the history
  3. Add polymorphic relationship improvements in MiqRequestWorkflow

    Implements the MiqPreloader.polymorphic_preload_for_child_classes
    improvements into the MiqRequestWorkflow#ems_metadata_tree method.  This
    significantly cuts down the number of N+1's when accessing the
    v_total_vms method from Hosts via EmsClusters.
    
    Also includes the `:v_total_vms` select to the individual hosts in the
    ems_metadata_tree incase that method is accessed from those records as
    well.
    NickLaMuro committed May 22, 2018
    Configuration menu
    Copy the full SHA
    aaf21ce View commit details
    Browse the repository at this point in the history