lyber-core 9.1.0 → 9.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7daa7d13e09727ec9bb08724649d2fcd48429c3cfb96de199a195d38975d2906
4
- data.tar.gz: 0eb8fbde795cf70eb827af89c7eb643864d637cc57c281f1ef37eac8df1bbaa4
3
+ metadata.gz: 53169df32c581350c038edfb364cb984db1efc38c07fdf9a020c5bafd1561754
4
+ data.tar.gz: 353e2d384a91f276b14938894e5dd35c9623bc2401c1f7d27f85daf86b212a18
5
5
  SHA512:
6
- metadata.gz: bd5b2a126f09335d0214169ba3d4db18f89eaa0f8e8e0415e0fc2069774d1a35b5e3991b8868555d8a68b85c769f710fa22a8d7963f74bb098db0f82342b8ff1
7
- data.tar.gz: 166cf3a6d0be197e8fd6849a6a76518f34da7afed1b3b3b7b2d32974274741c5f14e2bb490e441df0d57224e6b3af60669a47c75dec09e4482084e02598f274f
6
+ metadata.gz: e5a9c9a61886c6fd6964d5e434f369554a9a612c38446d6f3487ac74523ff5524eee98096c0a0938913e29b8c9b061844879c101ba3bdab3a4a3f9a58ea604cd
7
+ data.tar.gz: 0bf7528fb4707261665a959d67c68b0aa7c5d1be632c4ff5fcaeec0f278120e060419f6cb3fef1faec5b3498e62f4d34fc750bc02f8c110e4c7ff551c92e939b
data/README.md CHANGED
@@ -82,6 +82,8 @@ module Robots
82
82
  end
83
83
  ```
84
84
 
85
+ A robot that closes the object's version (e.g., the last step of an assembly workflow) should call `close_version` rather than `object_client.version.close`. It passes the workflow's lane and the user version mode from the workflow context (`userVersions`, e.g., set by Argo), so accessioning keeps the deposit's lane and the user's choice of user version. Params passed to `close_version` override these.
86
+
85
87
  ## Robot Environment Setup
86
88
 
87
89
  Create a `config/boot.rb` containing:
@@ -48,6 +48,18 @@ module LyberCore
48
48
  @druid_object ||= DruidTools::Druid.new(druid, Settings.stacks.local_workspace_root)
49
49
  end
50
50
 
51
+ # The workflow context key that holds the user version mode (none, new, update, or update_if_existing) for
52
+ # closing the version, e.g., set by Argo when starting the assembly workflow.
53
+ USER_VERSIONS_CONTEXT_KEY = 'userVersions'
54
+
55
+ # Closes the object's version, which by default starts accessionWF.
56
+ # Accessioning uses this workflow's lane, and closing uses the user version mode from the workflow context, if
57
+ # any; otherwise DSA's defaults apply.
58
+ # @param params [Hash] other params for closing, which override these (see Dor::Services::Client::ObjectVersion#close)
59
+ def close_version(**params)
60
+ object_client.version.close(lane_id:, user_versions: workflow.context[USER_VERSIONS_CONTEXT_KEY], **params)
61
+ end
62
+
51
63
  # Sets up logging, timing and error handling of the job
52
64
  # Calls the #perform_work method, then sets workflow to 'completed' or 'error' depending on success
53
65
  # rubocop:disable Metrics/AbcSize
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LyberCore
4
- VERSION = '9.1.0'
4
+ VERSION = '9.1.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lyber-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.1.0
4
+ version: 9.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alpana Pande
@@ -279,7 +279,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
279
279
  - !ruby/object:Gem::Version
280
280
  version: 1.3.6
281
281
  requirements: []
282
- rubygems_version: 4.0.22
282
+ rubygems_version: 4.0.20
283
283
  specification_version: 4
284
284
  summary: Core services used by the SUL Digital Library
285
285
  test_files: []