dor-workflow-client 7.4.1 → 7.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +1 -1
- data/Gemfile.lock +22 -22
- data/lib/dor/workflow/client/version.rb +1 -1
- data/lib/dor/workflow/client/workflow_routes.rb +7 -0
- data/lib/dor/workflow/client.rb +1 -7
- data/spec/dor/workflow/client/workflow_routes_spec.rb +16 -0
- metadata +3 -5
- data/lib/dor/workflow/client/version_routes.rb +0 -40
- data/spec/dor/workflow/client/version_routes_spec.rb +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 345824c332c0c9924a29f4189eea47d59a9ad3f65a99a4cf03cd4eca153fb4ba
|
4
|
+
data.tar.gz: 81d446a74ca5b8e585db805350d0ca278e15bc23606ea51b9223e62ebc81f839
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6a4ca91c098a131637d5af1c001354d9d749cdf34b47d4f161d91a3085bfc108820eb33d2563eed8082dda74274aa63fd3b80660975a0005477cd6e59d2472c
|
7
|
+
data.tar.gz: 8d24d0561c7d2f80201c4f1d39dc68efdd694e126fc972e339fd2b87ba16d2f27062c1213c6e9e0eed2ba22df69f1803b8d0bc823dad6cdf9d99e48d693f884d
|
data/.circleci/config.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
dor-workflow-client (7.
|
4
|
+
dor-workflow-client (7.5.0)
|
5
5
|
activesupport (>= 3.2.1, < 8)
|
6
6
|
deprecation (>= 0.99.0)
|
7
7
|
faraday (~> 2.0)
|
@@ -12,7 +12,7 @@ PATH
|
|
12
12
|
GEM
|
13
13
|
remote: https://rubygems.org/
|
14
14
|
specs:
|
15
|
-
activesupport (7.1.3.
|
15
|
+
activesupport (7.1.3.4)
|
16
16
|
base64
|
17
17
|
bigdecimal
|
18
18
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
@@ -28,7 +28,7 @@ GEM
|
|
28
28
|
base64 (0.2.0)
|
29
29
|
bigdecimal (3.1.8)
|
30
30
|
byebug (11.1.3)
|
31
|
-
concurrent-ruby (1.
|
31
|
+
concurrent-ruby (1.3.3)
|
32
32
|
connection_pool (2.4.1)
|
33
33
|
crack (1.0.0)
|
34
34
|
bigdecimal
|
@@ -38,7 +38,7 @@ GEM
|
|
38
38
|
diff-lcs (1.5.1)
|
39
39
|
docile (1.4.0)
|
40
40
|
drb (2.2.1)
|
41
|
-
faraday (2.9.
|
41
|
+
faraday (2.9.1)
|
42
42
|
faraday-net_http (>= 2.0, < 3.2)
|
43
43
|
faraday-net_http (3.1.0)
|
44
44
|
net-http
|
@@ -49,32 +49,32 @@ GEM
|
|
49
49
|
concurrent-ruby (~> 1.0)
|
50
50
|
json (2.7.2)
|
51
51
|
language_server-protocol (3.17.0.3)
|
52
|
-
mini_portile2 (2.8.
|
53
|
-
minitest (5.23.
|
52
|
+
mini_portile2 (2.8.7)
|
53
|
+
minitest (5.23.1)
|
54
54
|
mutex_m (0.2.0)
|
55
55
|
net-http (0.4.1)
|
56
56
|
uri
|
57
|
-
nokogiri (1.16.
|
57
|
+
nokogiri (1.16.6)
|
58
58
|
mini_portile2 (~> 2.8.2)
|
59
59
|
racc (~> 1.4)
|
60
|
-
parallel (1.
|
61
|
-
parser (3.3.
|
60
|
+
parallel (1.25.1)
|
61
|
+
parser (3.3.3.0)
|
62
62
|
ast (~> 2.4.1)
|
63
63
|
racc
|
64
|
-
public_suffix (5.
|
64
|
+
public_suffix (5.1.1)
|
65
65
|
racc (1.8.0)
|
66
66
|
rainbow (3.1.1)
|
67
67
|
rake (13.2.1)
|
68
68
|
regexp_parser (2.9.2)
|
69
|
-
rexml (3.
|
70
|
-
strscan
|
69
|
+
rexml (3.3.0)
|
70
|
+
strscan
|
71
71
|
rspec (3.13.0)
|
72
72
|
rspec-core (~> 3.13.0)
|
73
73
|
rspec-expectations (~> 3.13.0)
|
74
74
|
rspec-mocks (~> 3.13.0)
|
75
75
|
rspec-core (3.13.0)
|
76
76
|
rspec-support (~> 3.13.0)
|
77
|
-
rspec-expectations (3.13.
|
77
|
+
rspec-expectations (3.13.1)
|
78
78
|
diff-lcs (>= 1.2.0, < 2.0)
|
79
79
|
rspec-support (~> 3.13.0)
|
80
80
|
rspec-mocks (3.13.1)
|
@@ -83,7 +83,7 @@ GEM
|
|
83
83
|
rspec-support (3.13.1)
|
84
84
|
rspec_junit_formatter (0.6.0)
|
85
85
|
rspec-core (>= 2, < 4, != 2.12.0)
|
86
|
-
rubocop (1.
|
86
|
+
rubocop (1.64.1)
|
87
87
|
json (~> 2.3)
|
88
88
|
language_server-protocol (>= 3.17.0)
|
89
89
|
parallel (~> 1.10)
|
@@ -96,19 +96,19 @@ GEM
|
|
96
96
|
unicode-display_width (>= 2.4.0, < 3.0)
|
97
97
|
rubocop-ast (1.31.3)
|
98
98
|
parser (>= 3.3.1.0)
|
99
|
-
rubocop-capybara (2.
|
100
|
-
rubocop (~> 1.41)
|
101
|
-
rubocop-factory_bot (2.25.1)
|
99
|
+
rubocop-capybara (2.21.0)
|
102
100
|
rubocop (~> 1.41)
|
101
|
+
rubocop-factory_bot (2.26.1)
|
102
|
+
rubocop (~> 1.61)
|
103
103
|
rubocop-rake (0.6.0)
|
104
104
|
rubocop (~> 1.0)
|
105
|
-
rubocop-rspec (2.
|
105
|
+
rubocop-rspec (2.31.0)
|
106
106
|
rubocop (~> 1.40)
|
107
107
|
rubocop-capybara (~> 2.17)
|
108
108
|
rubocop-factory_bot (~> 2.22)
|
109
109
|
rubocop-rspec_rails (~> 2.28)
|
110
|
-
rubocop-rspec_rails (2.
|
111
|
-
rubocop (~> 1.
|
110
|
+
rubocop-rspec_rails (2.29.1)
|
111
|
+
rubocop (~> 1.61)
|
112
112
|
ruby-progressbar (1.13.0)
|
113
113
|
simplecov (0.22.0)
|
114
114
|
docile (~> 1.1)
|
@@ -121,12 +121,12 @@ GEM
|
|
121
121
|
concurrent-ruby (~> 1.0)
|
122
122
|
unicode-display_width (2.5.0)
|
123
123
|
uri (0.13.0)
|
124
|
-
webmock (3.23.
|
124
|
+
webmock (3.23.1)
|
125
125
|
addressable (>= 2.8.0)
|
126
126
|
crack (>= 0.3.2)
|
127
127
|
hashdiff (>= 0.4.0, < 2.0.0)
|
128
128
|
yard (0.9.36)
|
129
|
-
zeitwerk (2.6.
|
129
|
+
zeitwerk (2.6.16)
|
130
130
|
|
131
131
|
PLATFORMS
|
132
132
|
ruby
|
@@ -107,6 +107,13 @@ module Dor
|
|
107
107
|
Workflow::Response::Workflows.new(xml: xml)
|
108
108
|
end
|
109
109
|
|
110
|
+
# Skips all steps in a WF
|
111
|
+
def skip_all(druid:, workflow:, note:)
|
112
|
+
xml = create_process_xml(name: 'skip-all', status: 'skipped', note: note)
|
113
|
+
response = requestor.request "objects/#{druid}/workflows/#{workflow}/skip-all", 'post', xml, content_type: 'application/xml'
|
114
|
+
Workflow::Response::Workflows.new(xml: response)
|
115
|
+
end
|
116
|
+
|
110
117
|
# Get workflow names into an array for given PID
|
111
118
|
# This method only works when this gem is used in a project that is configured to connect to DOR
|
112
119
|
#
|
data/lib/dor/workflow/client.rb
CHANGED
@@ -40,7 +40,7 @@ module Dor
|
|
40
40
|
@requestor = Requestor.new(connection: connection || ConnectionFactory.build_connection(url, timeout: timeout, logger: logger))
|
41
41
|
end
|
42
42
|
|
43
|
-
delegate :create_workflow_by_name, :workflow_status, :workflows, :all_workflows,
|
43
|
+
delegate :create_workflow_by_name, :workflow_status, :workflows, :all_workflows, :skip_all,
|
44
44
|
:workflow, :process, :delete_workflow, :delete_all_workflows, :update_status, :update_error_status,
|
45
45
|
to: :workflow_routes
|
46
46
|
|
@@ -49,8 +49,6 @@ module Dor
|
|
49
49
|
delegate :lane_ids, :objects_for_workstep,
|
50
50
|
to: :queues
|
51
51
|
|
52
|
-
delegate :close_version, to: :version_routes
|
53
|
-
|
54
52
|
def queues
|
55
53
|
@queues ||= Queues.new(requestor: requestor)
|
56
54
|
end
|
@@ -63,10 +61,6 @@ module Dor
|
|
63
61
|
@lifecycle_routes ||= LifecycleRoutes.new(requestor: requestor)
|
64
62
|
end
|
65
63
|
|
66
|
-
def version_routes
|
67
|
-
@version_routes ||= VersionRoutes.new(requestor: requestor)
|
68
|
-
end
|
69
|
-
|
70
64
|
def workflow_template(name)
|
71
65
|
templates.retrieve(name)
|
72
66
|
end
|
@@ -156,6 +156,22 @@ RSpec.describe Dor::Workflow::Client::WorkflowRoutes do
|
|
156
156
|
end
|
157
157
|
end
|
158
158
|
|
159
|
+
describe '#skip_all' do
|
160
|
+
subject(:skip_all) do
|
161
|
+
routes.skip_all(druid: 'druid:mw971zk1113', note: 'test note', workflow: 'ocrWF')
|
162
|
+
end
|
163
|
+
|
164
|
+
let(:mock_requestor) { instance_double(Dor::Workflow::Client::Requestor, request: nil) }
|
165
|
+
|
166
|
+
it 'sends a skip all request' do
|
167
|
+
skip_all
|
168
|
+
expect(mock_requestor).to have_received(:request)
|
169
|
+
.with('objects/druid:mw971zk1113/workflows/ocrWF/skip-all', 'post',
|
170
|
+
"<?xml version=\"1.0\"?>\n<process name=\"skip-all\" status=\"skipped\" note=\"test note\"/>\n",
|
171
|
+
{ content_type: 'application/xml' })
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
159
175
|
describe '#all_workflows' do
|
160
176
|
let(:xml) do
|
161
177
|
<<~XML
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dor-workflow-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.
|
4
|
+
version: 7.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Willy Mene
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-06-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -130,7 +130,6 @@ files:
|
|
130
130
|
- lib/dor/workflow/client/requestor.rb
|
131
131
|
- lib/dor/workflow/client/status.rb
|
132
132
|
- lib/dor/workflow/client/version.rb
|
133
|
-
- lib/dor/workflow/client/version_routes.rb
|
134
133
|
- lib/dor/workflow/client/workflow_routes.rb
|
135
134
|
- lib/dor/workflow/client/workflow_template.rb
|
136
135
|
- lib/dor/workflow/response/process.rb
|
@@ -142,7 +141,6 @@ files:
|
|
142
141
|
- spec/dor/workflow/client/lifecycle_routes_spec.rb
|
143
142
|
- spec/dor/workflow/client/requestor_spec.rb
|
144
143
|
- spec/dor/workflow/client/status_spec.rb
|
145
|
-
- spec/dor/workflow/client/version_routes_spec.rb
|
146
144
|
- spec/dor/workflow/client/workflow_routes_spec.rb
|
147
145
|
- spec/dor/workflow/client/workflow_template_spec.rb
|
148
146
|
- spec/dor/workflow/client_spec.rb
|
@@ -169,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
169
167
|
- !ruby/object:Gem::Version
|
170
168
|
version: '0'
|
171
169
|
requirements: []
|
172
|
-
rubygems_version: 3.5.
|
170
|
+
rubygems_version: 3.5.10
|
173
171
|
signing_key:
|
174
172
|
specification_version: 4
|
175
173
|
summary: Provides convenience methods to work with the DOR Workflow Service
|
@@ -1,40 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Dor
|
4
|
-
module Workflow
|
5
|
-
class Client
|
6
|
-
# Makes requests relating to versions
|
7
|
-
class VersionRoutes
|
8
|
-
def initialize(requestor:)
|
9
|
-
@requestor = requestor
|
10
|
-
end
|
11
|
-
|
12
|
-
# Calls the versionClose endpoint of the workflow service:
|
13
|
-
#
|
14
|
-
# - completes the versioningWF:submit-version and versioningWF:start-accession steps
|
15
|
-
# - initiates accesssionWF
|
16
|
-
#
|
17
|
-
# @param [String] druid The id of the object to delete the workflow from
|
18
|
-
# @param [Boolean] create_accession_wf Option to create accessionWF when closing a version. Defaults to true
|
19
|
-
def close_version(druid:, version:, create_accession_wf: true)
|
20
|
-
requestor.request(construct_url(druid, version, create_accession_wf), 'post', '')
|
21
|
-
true
|
22
|
-
end
|
23
|
-
|
24
|
-
private
|
25
|
-
|
26
|
-
attr_reader :requestor
|
27
|
-
|
28
|
-
def construct_url(druid, version, create_accession_wf)
|
29
|
-
url = "objects/#{druid}/versionClose"
|
30
|
-
|
31
|
-
qs_args = []
|
32
|
-
qs_args << "version=#{version}" if version
|
33
|
-
qs_args << 'create-accession=false' unless create_accession_wf
|
34
|
-
url += "?#{qs_args.join('&')}" unless qs_args.empty?
|
35
|
-
url
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
|
-
RSpec.describe Dor::Workflow::Client::VersionRoutes do
|
6
|
-
let(:mock_requestor) { instance_double(Dor::Workflow::Client::Requestor, request: nil) }
|
7
|
-
|
8
|
-
let(:routes) { described_class.new(requestor: mock_requestor) }
|
9
|
-
|
10
|
-
let(:repo) { 'dor' }
|
11
|
-
|
12
|
-
let(:druid) { 'druid:123' }
|
13
|
-
|
14
|
-
describe '#close_version' do
|
15
|
-
context 'with kwargs' do
|
16
|
-
it 'passes version' do
|
17
|
-
routes.close_version(druid: druid, version: 3)
|
18
|
-
expect(mock_requestor).to have_received(:request)
|
19
|
-
.with('objects/druid:123/versionClose?version=3', 'post', '')
|
20
|
-
end
|
21
|
-
|
22
|
-
it 'optionally prevents creation of accessionWF and passes version' do
|
23
|
-
routes.close_version(druid: druid, create_accession_wf: false, version: 3)
|
24
|
-
expect(mock_requestor).to have_received(:request)
|
25
|
-
.with('objects/druid:123/versionClose?version=3&create-accession=false', 'post', '')
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|