ManageIQ / ManageIQ/inventory_refresh
Honor create_only? for Base Saver
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 1
- Forks
- 21
- PR merge metrics
- No merged PRs in 30d
Description
```diff
--- a/lib/inventory_refresh/save_collection/saver/base.rb
+++ b/lib/inventory_refresh/save_collection/saver/base.rb
@@ -163,7 +163,7 @@ module InventoryRefresh::SaveCollection
# Record was found in the DB but not sent for saving, that means it doesn't exist anymore and we should
# delete it from the DB.
delete_record!(record) if inventory_collection.delete_allowed?
- else
+ elsif !inventory_collection.create_only?
# Record was found in the DB and sent for saving, we will be updating the DB.
update_record!(record, hash, inventory_object) if assert_referential_integrity(hash)
```
The create_only? option is honored by concurrent_safe_batch and batch save strategies but not by base.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in lib/inventory_refresh/save_collection/saver/base.rb and inspect the Base Saver branch shown in the issue. Compare how create_only? is handled by the concurrent_safe_batch and batch save strategies, then verify that Base Saver does not update existing records when create_only? is enabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100