Project

General

Profile

Actions

Feature #17635

closed

Support 'preserve_version' flag on Collection.save

Added by Peter Amstutz over 3 years ago. Updated about 3 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
SDKs
Target version:
Story points:
-
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)

Subtasks 1 (0 open1 closed)

Task #18356: Review 17635-pysdk-collection-preserve-versionResolvedPeter Amstutz11/11/2021Actions

Related issues

Has duplicate Arvados - Idea #18312: Collection versioning tweaksClosedActions
Actions #1

Updated by Peter Amstutz about 3 years ago

  • Description updated (diff)
Actions #2

Updated by Peter Amstutz about 3 years ago

  • Has duplicate Idea #18312: Collection versioning tweaks added
Actions #3

Updated by Peter Amstutz about 3 years ago

  • Target version set to 2021-11-24 sprint
Actions #4

Updated by Ward Vandewege about 3 years ago

  • Release set to 45
Actions #5

Updated by Peter Amstutz about 3 years ago

  • Assigned To set to Lucas Di Pentima
Actions #6

Updated by Lucas Di Pentima about 3 years ago

  • Status changed from New to In Progress
Actions #7

Updated by Lucas Di Pentima about 3 years ago

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.
Actions #8

Updated by Peter Amstutz about 3 years 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 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?

Actions #9

Updated by Lucas Di Pentima about 3 years ago

Updates at b1a88ceac

  • Improved documentation
Actions #10

Updated by Peter Amstutz about 3 years 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."

Actions #11

Updated by Lucas Di Pentima about 3 years ago

  • Status changed from In Progress to Resolved

Applied in changeset arvados-private:commit:arvados|3849ee94bbe65ef79df8f50c87b5445a5b1d4877.

Actions

Also available in: Atom PDF