ManageIQ / ManageIQ/inventory_refresh

Honor create_only? for Base Saver

Open
#57 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug help wanted size/s
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.