dor-workflow-client 7.6.0 → 7.7.0

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: f09cfcba6518009d57900ff9c069be55dab613542f38cb948d503c8bd2754ba6
4
- data.tar.gz: e446798dbeedc9a88784622598ff21b22ae2246a70cb392b2a7842afe08889a3
3
+ metadata.gz: 12fc3722da54e3e3e25ef9bae87ac0fa5e492076fb88a532450fef9adebe5e52
4
+ data.tar.gz: 91113259c02396333c21190914fd79cdcfd66415dcf1b14e9859f2fe8e272084
5
5
  SHA512:
6
- metadata.gz: a45a0cea334788ad551560bc29250e3e37ad2dc17eca40305804e181178815632537ba6ff1ea99147fb292c154605fd0a68dc53a8fadcc06240bb73d4526b4cd
7
- data.tar.gz: 7b4319b9e0bdafc9c08033de8dec348c5bc5204a0798038516415371d819ba6dec4563b07b1497142764f0d6740a28ebb84245947e43391aa0a7b7d98215650b
6
+ metadata.gz: 3521c9c4b2e0156f1ee8a559a7a61786ec441da04695da184be35a261349c895e8f11132a4687d1ca7db7b98993251ac1475cd95da12cfbbf2f2762ed3a447f7
7
+ data.tar.gz: ae4250842e3664aa3978f2ee405b8a217cd149aa5356b74c9a9b2dd0c164643505323271c07891b390f7358295ddc787fdfccc5beb7b361dff343a4573ffb748
data/.circleci/config.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  version: 2.1
2
2
  orbs:
3
- ruby-rails: sul-dlss/ruby-rails@4.2.2
3
+ ruby-rails: sul-dlss/ruby-rails@4.2.3
4
4
  workflows:
5
5
  build:
6
6
  jobs:
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dor-workflow-client (7.6.0)
5
- activesupport (>= 3.2.1, < 8)
4
+ dor-workflow-client (7.7.0)
5
+ activesupport (>= 7.0.0)
6
6
  deprecation (>= 0.99.0)
7
7
  faraday (~> 2.0)
8
8
  faraday-retry (~> 2.0)
@@ -12,7 +12,7 @@ PATH
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- activesupport (7.2.2)
15
+ activesupport (8.0.0)
16
16
  base64
17
17
  benchmark (>= 0.3)
18
18
  bigdecimal
@@ -24,11 +24,12 @@ GEM
24
24
  minitest (>= 5.1)
25
25
  securerandom (>= 0.3)
26
26
  tzinfo (~> 2.0, >= 2.0.5)
27
+ uri (>= 0.13.1)
27
28
  addressable (2.8.7)
28
29
  public_suffix (>= 2.0.2, < 7.0)
29
30
  ast (2.4.2)
30
31
  base64 (0.2.0)
31
- benchmark (0.3.0)
32
+ benchmark (0.4.0)
32
33
  bigdecimal (3.1.8)
33
34
  byebug (11.1.3)
34
35
  concurrent-ruby (1.3.4)
@@ -41,36 +42,36 @@ GEM
41
42
  diff-lcs (1.5.1)
42
43
  docile (1.4.1)
43
44
  drb (2.2.1)
44
- faraday (2.12.0)
45
- faraday-net_http (>= 2.0, < 3.4)
45
+ faraday (2.12.2)
46
+ faraday-net_http (>= 2.0, < 3.5)
46
47
  json
47
48
  logger
48
- faraday-net_http (3.3.0)
49
- net-http
49
+ faraday-net_http (3.4.0)
50
+ net-http (>= 0.5.0)
50
51
  faraday-retry (2.2.1)
51
52
  faraday (~> 2.0)
52
- hashdiff (1.1.1)
53
+ hashdiff (1.1.2)
53
54
  i18n (1.14.6)
54
55
  concurrent-ruby (~> 1.0)
55
- json (2.7.5)
56
+ json (2.9.0)
56
57
  language_server-protocol (3.17.0.3)
57
- logger (1.6.1)
58
- mini_portile2 (2.8.7)
59
- minitest (5.25.1)
60
- net-http (0.4.1)
58
+ logger (1.6.2)
59
+ mini_portile2 (2.8.8)
60
+ minitest (5.25.4)
61
+ net-http (0.6.0)
61
62
  uri
62
- nokogiri (1.16.7)
63
+ nokogiri (1.17.0)
63
64
  mini_portile2 (~> 2.8.2)
64
65
  racc (~> 1.4)
65
66
  parallel (1.26.3)
66
- parser (3.3.5.0)
67
+ parser (3.3.6.0)
67
68
  ast (~> 2.4.1)
68
69
  racc
69
70
  public_suffix (6.0.1)
70
71
  racc (1.8.1)
71
72
  rainbow (3.1.1)
72
73
  rake (13.2.1)
73
- regexp_parser (2.9.2)
74
+ regexp_parser (2.9.3)
74
75
  rexml (3.3.9)
75
76
  rspec (3.13.0)
76
77
  rspec-core (~> 3.13.0)
@@ -84,20 +85,20 @@ GEM
84
85
  rspec-mocks (3.13.2)
85
86
  diff-lcs (>= 1.2.0, < 2.0)
86
87
  rspec-support (~> 3.13.0)
87
- rspec-support (3.13.1)
88
+ rspec-support (3.13.2)
88
89
  rspec_junit_formatter (0.6.0)
89
90
  rspec-core (>= 2, < 4, != 2.12.0)
90
- rubocop (1.68.0)
91
+ rubocop (1.69.1)
91
92
  json (~> 2.3)
92
93
  language_server-protocol (>= 3.17.0)
93
94
  parallel (~> 1.10)
94
95
  parser (>= 3.3.0.2)
95
96
  rainbow (>= 2.2.2, < 4.0)
96
- regexp_parser (>= 2.4, < 3.0)
97
- rubocop-ast (>= 1.32.2, < 2.0)
97
+ regexp_parser (>= 2.9.3, < 3.0)
98
+ rubocop-ast (>= 1.36.2, < 2.0)
98
99
  ruby-progressbar (~> 1.7)
99
- unicode-display_width (>= 2.4.0, < 3.0)
100
- rubocop-ast (1.33.0)
100
+ unicode-display_width (>= 2.4.0, < 4.0)
101
+ rubocop-ast (1.36.2)
101
102
  parser (>= 3.3.1.0)
102
103
  rubocop-capybara (2.21.0)
103
104
  rubocop (~> 1.41)
@@ -113,7 +114,7 @@ GEM
113
114
  rubocop-rspec_rails (2.29.1)
114
115
  rubocop (~> 1.61)
115
116
  ruby-progressbar (1.13.0)
116
- securerandom (0.3.1)
117
+ securerandom (0.4.0)
117
118
  simplecov (0.22.0)
118
119
  docile (~> 1.1)
119
120
  simplecov-html (~> 0.11)
@@ -122,8 +123,10 @@ GEM
122
123
  simplecov_json_formatter (0.1.4)
123
124
  tzinfo (2.0.6)
124
125
  concurrent-ruby (~> 1.0)
125
- unicode-display_width (2.6.0)
126
- uri (0.13.1)
126
+ unicode-display_width (3.1.2)
127
+ unicode-emoji (~> 4.0, >= 4.0.4)
128
+ unicode-emoji (4.0.4)
129
+ uri (1.0.2)
127
130
  webmock (3.24.0)
128
131
  addressable (>= 2.8.0)
129
132
  crack (>= 0.3.2)
@@ -17,7 +17,7 @@ Gem::Specification.new do |gem|
17
17
  gem.require_paths = ['lib']
18
18
  gem.required_ruby_version = '>= 3.0'
19
19
 
20
- gem.add_dependency 'activesupport', '>= 3.2.1', '< 8'
20
+ gem.add_dependency 'activesupport', '>= 7.0.0'
21
21
  gem.add_dependency 'deprecation', '>= 0.99.0'
22
22
  gem.add_dependency 'faraday', '~> 2.0'
23
23
  gem.add_dependency 'faraday-retry', '~> 2.0'
@@ -80,6 +80,25 @@ module Dor
80
80
  Nokogiri::XML(resp).xpath('//object[@id]').map { |n| n[:id] }
81
81
  end
82
82
 
83
+ # Returns a list of druids from the workflow service that meet the criteria
84
+ # of the passed in error param
85
+ #
86
+ # @see `#objects_for_workstep`
87
+ #
88
+ # @param [String] error name of the error step
89
+ # @param [Hash] options
90
+ # @param options [String] :default_workflow workflow to query for if not using the qualified format
91
+ # @option options [Integer] :limit maximum number of druids to return (nil for no limit)
92
+ # @return [Array<String>] Array of druids
93
+ def objects_erroring_at_workstep(error, options = {})
94
+ uri_string = "workflow_queue?error=#{error}"
95
+ uri_string += "&limit=#{options[:limit].to_i}" if options[:limit]&.to_i&.positive?
96
+
97
+ resp = requestor.request uri_string
98
+
99
+ Nokogiri::XML(resp).xpath('//object[@id]').map { |n| n[:id] }
100
+ end
101
+
83
102
  private
84
103
 
85
104
  attr_reader :requestor
@@ -3,7 +3,7 @@
3
3
  module Dor
4
4
  module Workflow
5
5
  class Client
6
- VERSION = '7.6.0'
6
+ VERSION = '7.7.0'
7
7
  end
8
8
  end
9
9
  end
@@ -46,8 +46,7 @@ module Dor
46
46
 
47
47
  delegate :lifecycle, :active_lifecycle, :milestones, to: :lifecycle_routes
48
48
 
49
- delegate :lane_ids, :objects_for_workstep,
50
- to: :queues
49
+ delegate :lane_ids, :objects_for_workstep, :objects_erroring_at_workstep, to: :queues
51
50
 
52
51
  def queues
53
52
  @queues ||= Queues.new(requestor: requestor)
@@ -391,6 +391,38 @@ RSpec.describe Dor::Workflow::Client do
391
391
  end
392
392
  end
393
393
 
394
+ describe '#objects_erroring_at_workstep' do
395
+ before do
396
+ @workflow = 'googleScannedBookWF'
397
+ @error = 'process-content'
398
+ end
399
+
400
+ let(:stubs) do
401
+ Faraday::Adapter::Test::Stubs.new do |stub|
402
+ stub.get("workflow_queue?error=#{@workflow}:#{@error}") do |_env|
403
+ [200, {}, '<objects count="1"><object id="druid:ab123de4567"/><object id="druid:ab123de9012"/></objects>']
404
+ end
405
+ end
406
+ end
407
+
408
+ context 'with a query using qualified workflow name for error' do
409
+ before do
410
+ @qualified_error = "#{@workflow}:#{@error}"
411
+ end
412
+
413
+ context 'with URI string creation' do
414
+ before do
415
+ @xml = %(<objects count="1"><object id="druid:ab123de4567"/></objects>)
416
+ end
417
+
418
+ it 'with lane ID' do
419
+ allow(mock_http_connection).to receive(:get).with("workflow_queue?error=#{@qualified_error}").and_return(double(Faraday::Response, body: @xml))
420
+ expect(client.objects_erroring_at_workstep(@qualified_error)).to eq(['druid:ab123de4567'])
421
+ end
422
+ end
423
+ end
424
+ end
425
+
394
426
  context 'when empty workflow queue' do
395
427
  before do
396
428
  @workflow = 'googleScannedBookWF'
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.6.0
4
+ version: 7.7.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-10-31 00:00:00.000000000 Z
12
+ date: 2024-12-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -17,20 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: 3.2.1
21
- - - "<"
22
- - !ruby/object:Gem::Version
23
- version: '8'
20
+ version: 7.0.0
24
21
  type: :runtime
25
22
  prerelease: false
26
23
  version_requirements: !ruby/object:Gem::Requirement
27
24
  requirements:
28
25
  - - ">="
29
26
  - !ruby/object:Gem::Version
30
- version: 3.2.1
31
- - - "<"
32
- - !ruby/object:Gem::Version
33
- version: '8'
27
+ version: 7.0.0
34
28
  - !ruby/object:Gem::Dependency
35
29
  name: deprecation
36
30
  requirement: !ruby/object:Gem::Requirement
@@ -167,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
167
161
  - !ruby/object:Gem::Version
168
162
  version: '0'
169
163
  requirements: []
170
- rubygems_version: 3.5.11
164
+ rubygems_version: 3.5.22
171
165
  signing_key:
172
166
  specification_version: 4
173
167
  summary: Provides convenience methods to work with the DOR Workflow Service