Feature #17635
closed
Support 'preserve_version' flag on Collection.save
Added by Peter Amstutz over 3 years ago.
Updated about 3 years ago.
Release relationship:
Auto
Description
- Collection class in the Python SDK should support the "preserve_version" flag on the save() method
- If
preserve_version
is true
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)
- Description updated (diff)
- Has duplicate Idea #18312: Collection versioning tweaks added
- Target version set to 2021-11-24 sprint
- Assigned To set to Lucas Di Pentima
- Status changed from New to In Progress
Updates at d35c1a749 - branch 17635-pysdk-collection-preserve-version
Test run: developer-run-tests: #2790
- Exports
Collections.CollectionVersioning
config so that arvados.Collection
knows when to return an error.
- Adds
preserve_version
(False
by default) parameter to save()
and save_new()
methods on the arvados.Collection
class. When collection versioning isn't enabled and the parameter is set to True
, it raises an exception.
- Adds tests.
Lucas Di Pentima wrote:
Updates at d35c1a749 - branch 17635-pysdk-collection-preserve-version
Test run: developer-run-tests: #2790
- Exports
Collections.CollectionVersioning
config so that arvados.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 to save()
and save_new()
methods on the arvados.Collection
class. When collection versioning isn't enabled and the parameter is set to True
, 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?
Lucas Di Pentima wrote:
Updates at b1a88ceac
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."
- Status changed from In Progress to Resolved
Applied in changeset arvados-private:commit:arvados|3849ee94bbe65ef79df8f50c87b5445a5b1d4877.
Also available in: Atom
PDF