ManageIQ / inventory_refresh

Apache License 2.0
1 stars 23 forks source link

InventoryCollection Builder and Persister #18

Closed slemrmartin closed 6 years ago

slemrmartin commented 6 years ago

Moving of IC Builder and Persister from ManageIQ's core.

slemrmartin commented 6 years ago

cc @Ladas @agrare

This PR requires Vm and MiqTemplate models now

slemrmartin commented 6 years ago

Differences from miq's core:

agrare commented 6 years ago

@slemrmartin hm I pictured this sort of thing belonging in a client gem rather than here.

The collector's ruby-client will be based on a json schema and probably won't even include this gem, and I don't think that the backend persisters will need the builder since it will most likely just do InventoryCollection.from_json on each collection that is passed.

Ladas commented 6 years ago

@agrare ah, no, this will be used in the persister, not in the client gem. Same as it is used in the specs, this interface will be used to define what the persister can persist. (we are getting away from using InventoryCollection as interface, since that will be refactored to smaller pieces)

Btw. it always needs to be wrapped to something bigger than just InventoryCollection.from_json, since that inventory collection can have links to other inventory collections, so we need to init more of them (now it's all ICs under persister)

miq-bot commented 6 years ago

Checked commits https://github.com/slemrmartin/inventory_refresh/compare/de0f67a3587192ec2016e7f04454fef15cd789c2~...f2f03fba1fe65ef7985502f9a1bcc72ed4cb67f6 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 6 files checked, 0 offenses detected Everything looks fine. :trophy:

agrare commented 6 years ago

Same as it is used in the specs, this interface will be used to define what the persister can persist. (we are getting away from using InventoryCollection as interface, since that will be refactored to smaller pieces)

I'd like to get to simplifying the IC interface quickly because I think most of the builder can be simplified as well

Btw. it always needs to be wrapped to something bigger than just InventoryCollection.from_json, since that inventory collection can have links to other inventory collections, so we need to init more of them (now it's all ICs under persister)

Yes of course but it could be as simple as a collection of ICs and a to_json/from_json

I'll merge this but I want to get to refactoring the IC interface soon