Feature #17635
Support 'preserve_version' flag on Collection.save
100%
Description
- Collection class in the Python SDK should support the "preserve_version" flag on the save() method
- If
preserve_version
istrue
and CollectionVersioning is false in the config, decide which one of these things should happen:- Save a snapshot version as if CollectionVersioning is true (since it was asked for explicitly)
- Return an error (so the user knows the version won't be preserved)
Subtasks
Related issues
History
#1
Updated by Peter Amstutz 7 months ago
- Description updated (diff)
#2
Updated by Peter Amstutz 7 months ago
- Has duplicate Story #18312: Collection versioning tweaks added
#3
Updated by Peter Amstutz 7 months ago
- Target version set to 2021-11-24 sprint
#4
Updated by Ward Vandewege 7 months ago
- Release set to 45
#5
Updated by Peter Amstutz 6 months ago
- Assigned To set to Lucas Di Pentima
#6
Updated by Lucas Di Pentima 6 months ago
- Status changed from New to In Progress
#7
Updated by Lucas Di Pentima 6 months ago
Updates at d35c1a749 - branch 17635-pysdk-collection-preserve-version
Test run: developer-run-tests: #2790
- Exports
Collections.CollectionVersioning
config so thatarvados.Collection
knows when to return an error. - Adds
preserve_version
(False
by default) parameter tosave()
andsave_new()
methods on thearvados.Collection
class. When collection versioning isn't enabled and the parameter is set toTrue
, it raises an exception. - Adds tests.
#8
Updated by Peter Amstutz 6 months ago
Lucas Di Pentima wrote:
Updates at d35c1a749 - branch
17635-pysdk-collection-preserve-version
Test run: developer-run-tests: #2790
- Exports
Collections.CollectionVersioning
config so thatarvados.Collection
knows when to return an error.
I had envisioned that the API server would return an error, instead of just doing a client side check. The main drawback is that it will break clients (like wb2) that always send preserve_version=true. So maybe a client side check is the best we can do. Changing the the API server behavior seems out of scope for this ticket.
- Adds
preserve_version
(False
by default) parameter tosave()
andsave_new()
methods on thearvados.Collection
class. When collection versioning isn't enabled and the parameter is set toTrue
, it raises an exception.
I had to think really hard about how it could make sense to have preserve_version
parameter on save_new()
before remembering the original meaning/behavior of the preserve_version flag (that we make sure the version we just wrote will be preserved on future update). Can we explain it better somehow?
#9
Updated by Lucas Di Pentima 6 months ago
Updates at b1a88ceac
- Improved documentation
#10
Updated by Peter Amstutz 6 months ago
Lucas Di Pentima wrote:
Updates at b1a88ceac
- Improved documentation
If True, the newly saved collection will generate a new snapshot of
itself on the next versionable update. This parameter requires that
the Collections.CollectionVersioning is enabled and will raise an
exception otherwise.
Can we rephrase this a little bit, like
"If True, indicate that the collection content being saved right now should be preserved in a version snapshot if the collection record is updated in the future. Requires that the API server has Collections.CollectionVersioning enabled, if not, setting this will raise an exception."
#11
Updated by Lucas Di Pentima 6 months ago
- Status changed from In Progress to Resolved
Applied in changeset arvados-private:commit:arvados|3849ee94bbe65ef79df8f50c87b5445a5b1d4877.