Implement force_identicial_write#260
Conversation
|
I've realized the best place to add docs is probably the However, it's hard to demonstrate the functionality without encountering the same issue as described in #258. Perhaps the solution is For now, I have used |
|
just wanted to say that I've seen this and will give it a closer look in the next |
|
I hope the conference went well! I think the test that's failing needs to change based on the new default behaviour, I'll take a look now. |
4c31b9b to
c95ecea
Compare
|
It did! It's one of my favorites (not that I am biased or anything 😆)
++ I can kick off the full set of tests again in a moment here to pick up your new commits! |
Late comment, but some history here is that Posit Connect cannot delete the most recent pin. IIRC that is in place since |
isabelizimm
left a comment
There was a problem hiding this comment.
did some small update around the tests, but this looks good to me!
|
|
||
| # Pre-emptively fetch the most recent pin's meta if it exists - this is used | ||
| # for the force_identical_write check | ||
| abort_if_identical = not force_identical_write and self.pin_exists(name) |
There was a problem hiding this comment.
this may make writing pins slightly slower by making a call to the pin in self.pin_exists(). I think it's right move here (and I don't see a significant slowdown in tests at all), but just noting it if other calls get added and things start to feel sluggish
To resolve #241.
I struggled for a while to realize that
prepare_pin_versiondeletes the old pin viaversion_setupfor unversioned boards. To deal with this, I have pre-emptively retrieved the meta object before it is deleted, and then used that to compare the hash.I think part of the issue is perhaps that
version_setupdoesn't belong inpins/versions.py- I am of the view that it is currently too decontextualized and would be better closer to the place where it is invoked, inprepare_pin_version. A docstring would help too.It's worth noting that this is a breaking change - as a result some of the existing tests needed modifying to opt-in to the old behaviour.
I'm not sure whether the READMEs need any updates. I took a read but I think it would be distracting to detail this feature.