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

Delete complement strategy for deleting top level entities using batches #15229

Conversation

Ladas
Copy link
Contributor

@Ladas Ladas commented May 25, 2017

Depends on:

:delete_complement strategy for deleting top level entities using batch saving

@chessbyte
Copy link
Member

Marking as WIP because this PR depends on #15227

@chessbyte chessbyte changed the title Delete complement strategy for deleting top level entities using batches [WIP] Delete complement strategy for deleting top level entities using batches May 26, 2017
@chessbyte chessbyte added the wip label May 26, 2017
Ladas added 9 commits May 29, 2017 14:59
Allow all_manager_uuids to be serialized/deserialized
Adding :all_manager_uuids for complement deletion, used in batched
targeted strategies.
Implement delete_complement method
Expose noop? method on InventoryCollection, being able to
quickly check if the IC processing can be skipped.

 #Please enter the commit message for your changes. Lines starting
Check for noop before starting any work in IC. Helps to lower
down the number of unnecessary queries.
Turn all foreign_keys to symbols, for consistent comparing.
Store skeletal_manager_uuids to optimize the where queries
Remove a wrong IC reference because it's self
Always return data with symbolized keys
@Ladas Ladas force-pushed the delete_complement_strategy_for_deleting_top_level_entities_using_batches branch from a41d95a to be3ddac Compare May 29, 2017 13:00
@Ladas Ladas changed the title [WIP] Delete complement strategy for deleting top level entities using batches Delete complement strategy for deleting top level entities using batches May 29, 2017
@Ladas
Copy link
Contributor Author

Ladas commented May 29, 2017

@miq-bot remove_label wip

@miq-bot miq-bot removed the wip label May 29, 2017
Remove to_s since we want to compare symbols
@miq-bot
Copy link
Member

miq-bot commented May 29, 2017

Checked commits Ladas/manageiq@c8904ae~...f822325 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
4 files checked, 1 offense detected

app/models/manager_refresh/save_collection/saver/base.rb

@Ladas
Copy link
Contributor Author

Ladas commented May 30, 2017

@miq-bot assign @agrare

@Ladas
Copy link
Contributor Author

Ladas commented May 30, 2017

@miq-bot add_label enhancement

@@ -155,12 +155,13 @@ def add_remaining_inventory_collections(defaults, options = {})

def to_raw_data
collections_data = collections.map do |key, collection|
next if collection.data.blank?
next if collection.data.blank? && collection.manager_uuids.blank? && collection.all_manager_uuids.nil?
Copy link
Member

Choose a reason for hiding this comment

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

Why .blank? for manager_uuids but .nil? for all_manager_uuids?? They both look like arrays...

Copy link
Contributor Author

@Ladas Ladas May 31, 2017

Choose a reason for hiding this comment

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

collection.all_manager_uuids = [] will delete everything and nil is ignored

collection.manager_uuids [] or nil is equivalent, it should be marking that the collection will not be saving any data.

@agrare agrare merged commit 1665b37 into ManageIQ:master May 31, 2017
@agrare agrare added this to the Sprint 62 Ending Jun 5, 2017 milestone May 31, 2017
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.

4 participants