-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Allow updating things/items/sitemaps by recreating them #157
Conversation
5acf7df
to
b77c018
Compare
ce06fb8
to
92f226d
Compare
f7cdbd9
to
eacb972
Compare
7bb71b4
to
8ddc165
Compare
The way it handles metadata now is probably not right. It doesn't wipe out the metadata when updating an item.
|
8ddc165
to
7671a2d
Compare
Updated to remove managed metadata that isn't specified in the new config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thoughts on instead of a update: true
kwarg, to build
, have a separate method rebuild
that implies update: true
?
alternately, would it make sense to have update default to true? given how it's currently implemented, it will already make sure you're not trying to replace an item from another provider, which is my biggest worry about not checking if an item already exists.
Signed-off-by: Jimmy Tanagra <[email protected]>
b625512
to
27e82de
Compare
Please don't merge it yet - still need to change the default to true, or refactor into separate methods |
I think this makes it a bit ambiguous because you can use
I'd go with this option, which is to set the default to true. I am wondering though, would it even be necessary to offer the option of |
a6d024d
to
519da81
Compare
Signed-off-by: Jimmy Tanagra <[email protected]>
519da81
to
969e51b
Compare
Also includes some minor bug fixes
.to_h.compare_by_identity
, but it didn't do as expected.Previously a newly created item will replace the existing one accidentally when calling
NewItem.label = "label"
during the building process.#label=
callsprovider&.update
and because provider look up is based on item's uid (item name) it found a provider, and proceeded to update/replace the existing item with the new item. This happens even though the newly created item hadn't been officially added to the provider, and in fact the subsequent call to provider.add will fail because it already had an element with the same uid, but the new element is now the active one, despite the failure to add.Random notes as I come to think of them about the implementation within this PR:
When updating an item, the old metadata doesn't get deleted.It is now deleted.