dor-services-client 15.16.0 → 15.18.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 +4 -4
- data/.rubocop_todo.yml +16 -6
- data/Gemfile.lock +5 -5
- data/dor-services-client.gemspec +1 -1
- data/lib/dor/services/client/version.rb +1 -1
- data/lib/dor/services/response/workflow.rb +14 -6
- data/lib/dor/services/response/workflows.rb +7 -13
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2eae21e0d4d23ae9cfb36da7241b8426ee6cb4c4091495596388303501294541
|
4
|
+
data.tar.gz: 95e2a5bd0bc3d6b6888ba6d7f5248e81a0f9d652453adda2306e1b084238f4b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5894ff807874edfe03c547bab604e1e6176fc9020e5204eabf6a8da0686f919f2fe453046005b4e9087e209687add460ff949d948973ed1766b4cbed6d519e0
|
7
|
+
data.tar.gz: a62b6f56f78065b9f153b9aeb76f957be2104711d6a8642ed06dd18ec45899bbfcd28b353ed014a70fee79b13385795643e1cff7a17ff2dc5a39c4749f6f06c2
|
data/.rubocop_todo.yml
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config --auto-gen-only-exclude`
|
3
|
-
# on 2025-
|
3
|
+
# on 2025-07-14 17:04:55 UTC using RuboCop version 1.78.0.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
|
-
# Offense count:
|
9
|
+
# Offense count: 66
|
10
10
|
# This cop supports safe autocorrection (--autocorrect).
|
11
|
-
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
|
11
|
+
# Configuration parameters: AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
|
12
12
|
# URISchemes: http, https
|
13
13
|
Layout/LineLength:
|
14
14
|
Max: 174
|
@@ -18,13 +18,23 @@ Lint/UselessConstantScoping:
|
|
18
18
|
Exclude:
|
19
19
|
- 'lib/dor/services/client/object.rb'
|
20
20
|
|
21
|
+
# Offense count: 5
|
22
|
+
# Configuration parameters: EnforcedStyle, AllowedPatterns, ForbiddenIdentifiers, ForbiddenPatterns.
|
23
|
+
# SupportedStyles: snake_case, camelCase
|
24
|
+
# ForbiddenIdentifiers: __id__, __send__
|
25
|
+
Naming/MethodName:
|
26
|
+
Exclude:
|
27
|
+
- 'lib/dor/services/client/members.rb'
|
28
|
+
- 'lib/dor/services/client/object_version.rb'
|
29
|
+
- 'lib/dor/services/client/user_version.rb'
|
30
|
+
|
21
31
|
# Offense count: 3
|
22
32
|
RSpec/AnyInstance:
|
23
33
|
Exclude:
|
24
34
|
- 'spec/dor/services/client/async_result_spec.rb'
|
25
35
|
- 'spec/dor/services/client/object_version_spec.rb'
|
26
36
|
|
27
|
-
# Offense count:
|
37
|
+
# Offense count: 6
|
28
38
|
RSpec/IdenticalEqualityAssertion:
|
29
39
|
Exclude:
|
30
40
|
- 'spec/dor/services/client_spec.rb'
|
@@ -52,14 +62,14 @@ Style/Documentation:
|
|
52
62
|
- 'test/**/*'
|
53
63
|
- 'lib/dor/services/client.rb'
|
54
64
|
|
55
|
-
# Offense count:
|
65
|
+
# Offense count: 3
|
56
66
|
# This cop supports safe autocorrection (--autocorrect).
|
57
67
|
Style/IfUnlessModifier:
|
58
68
|
Exclude:
|
59
69
|
- 'lib/dor/services/client.rb'
|
60
70
|
- 'lib/dor/services/client/object.rb'
|
61
71
|
|
62
|
-
# Offense count:
|
72
|
+
# Offense count: 2
|
63
73
|
# This cop supports safe autocorrection (--autocorrect).
|
64
74
|
Style/KeywordArgumentsMerging:
|
65
75
|
Exclude:
|
data/Gemfile.lock
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
dor-services-client (15.
|
4
|
+
dor-services-client (15.18.0)
|
5
5
|
activesupport (>= 7.0.0)
|
6
|
-
cocina-models (~> 0.
|
6
|
+
cocina-models (~> 0.105.0)
|
7
7
|
deprecation
|
8
8
|
faraday (~> 2.0)
|
9
9
|
faraday-retry
|
@@ -34,7 +34,7 @@ GEM
|
|
34
34
|
benchmark (0.4.1)
|
35
35
|
bigdecimal (3.2.2)
|
36
36
|
byebug (12.0.0)
|
37
|
-
cocina-models (0.
|
37
|
+
cocina-models (0.105.0)
|
38
38
|
activesupport
|
39
39
|
deprecation
|
40
40
|
dry-struct (~> 1.0)
|
@@ -103,7 +103,7 @@ GEM
|
|
103
103
|
lint_roller (1.1.0)
|
104
104
|
logger (1.7.0)
|
105
105
|
minitest (5.25.5)
|
106
|
-
multi_json (1.
|
106
|
+
multi_json (1.16.0)
|
107
107
|
net-http (0.6.0)
|
108
108
|
uri
|
109
109
|
nokogiri (1.18.8-arm64-darwin)
|
@@ -140,7 +140,7 @@ GEM
|
|
140
140
|
diff-lcs (>= 1.2.0, < 2.0)
|
141
141
|
rspec-support (~> 3.13.0)
|
142
142
|
rspec-support (3.13.4)
|
143
|
-
rubocop (1.
|
143
|
+
rubocop (1.78.0)
|
144
144
|
json (~> 2.3)
|
145
145
|
language_server-protocol (~> 3.17.0.2)
|
146
146
|
lint_roller (~> 1.1.0)
|
data/dor-services-client.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.required_ruby_version = '>= 3.0', '< 4'
|
26
26
|
|
27
27
|
spec.add_dependency 'activesupport', '>= 7.0.0'
|
28
|
-
spec.add_dependency 'cocina-models', '~> 0.
|
28
|
+
spec.add_dependency 'cocina-models', '~> 0.105.0'
|
29
29
|
spec.add_dependency 'deprecation', '>= 0'
|
30
30
|
spec.add_dependency 'faraday', '~> 2.0'
|
31
31
|
spec.add_dependency 'faraday-retry'
|
@@ -24,7 +24,12 @@ module Dor
|
|
24
24
|
result ? true : false
|
25
25
|
end
|
26
26
|
|
27
|
-
|
27
|
+
def error_count
|
28
|
+
process_names.map { |process_name| process_for_recent_version(name: process_name) }
|
29
|
+
.count { |process| process.status == 'error' }
|
30
|
+
end
|
31
|
+
|
32
|
+
# Returns the process for the most recent version that matches the given name:
|
28
33
|
def process_for_recent_version(name:)
|
29
34
|
nodes = process_nodes_for(name: name)
|
30
35
|
node = nodes.max { |a, b| a.attr('version').to_i <=> b.attr('version').to_i }
|
@@ -38,12 +43,11 @@ module Dor
|
|
38
43
|
# Check if all processes are skipped or complete for the provided version.
|
39
44
|
# @param [Integer] version the version we are checking for.
|
40
45
|
def complete_for?(version:)
|
41
|
-
# ng_xml.xpath("/workflow/process[@version=#{version}]/@status").map(&:value).all? { |p| %w[skipped completed].include?(p) }
|
42
46
|
incomplete_processes_for(version: version).empty?
|
43
47
|
end
|
44
48
|
|
45
49
|
def complete?
|
46
|
-
complete_for?(version:
|
50
|
+
complete_for?(version: latest_version)
|
47
51
|
end
|
48
52
|
|
49
53
|
def incomplete_processes_for(version:)
|
@@ -53,15 +57,15 @@ module Dor
|
|
53
57
|
end
|
54
58
|
|
55
59
|
def incomplete_processes
|
56
|
-
incomplete_processes_for(version:
|
60
|
+
incomplete_processes_for(version: latest_version)
|
57
61
|
end
|
58
62
|
|
59
63
|
attr_reader :xml
|
60
64
|
|
61
65
|
private
|
62
66
|
|
63
|
-
# Return the
|
64
|
-
def
|
67
|
+
# Return the latest version in this workflow document
|
68
|
+
def latest_version
|
65
69
|
ng_xml.xpath('/workflow/process/@version').map { |attr| attr.value.to_i }.max
|
66
70
|
end
|
67
71
|
|
@@ -81,6 +85,10 @@ module Dor
|
|
81
85
|
attributes = node ? node.attributes.to_h { |k, v| [k.to_sym, v.value] } : {}
|
82
86
|
Process.new(parent: self, **attributes)
|
83
87
|
end
|
88
|
+
|
89
|
+
def process_names(version: latest_version)
|
90
|
+
ng_xml.xpath("/workflow/process[@version=#{version}]").map { |process| process['name'] }
|
91
|
+
end
|
84
92
|
end
|
85
93
|
end
|
86
94
|
end
|
@@ -5,32 +5,26 @@ module Dor
|
|
5
5
|
module Response
|
6
6
|
# The response from asking the server about all workflows for an item
|
7
7
|
class Workflows
|
8
|
+
attr_reader :xml
|
9
|
+
|
10
|
+
# @param [Nokogiri::XML] xml Nokogiri XML document showing all workflows
|
8
11
|
def initialize(xml:)
|
9
12
|
@xml = xml
|
10
13
|
end
|
11
14
|
|
12
15
|
def pid
|
13
|
-
|
16
|
+
xml.at_xpath('/workflows/@objectId').text
|
14
17
|
end
|
15
18
|
|
16
19
|
def workflows
|
17
|
-
@workflows ||=
|
20
|
+
@workflows ||= xml.xpath('/workflows/workflow').map do |node|
|
18
21
|
Workflow.new(xml: node.to_xml)
|
19
22
|
end
|
20
23
|
end
|
21
24
|
|
22
|
-
# @return [Array<String>] returns a list of errors for any process for the
|
25
|
+
# @return [Array<String>] returns a list of errors for any process for the specified version
|
23
26
|
def errors_for(version:)
|
24
|
-
|
25
|
-
.map(&:text)
|
26
|
-
end
|
27
|
-
|
28
|
-
attr_reader :xml
|
29
|
-
|
30
|
-
private
|
31
|
-
|
32
|
-
def ng_xml
|
33
|
-
@ng_xml ||= Nokogiri::XML(@xml)
|
27
|
+
xml.xpath("//workflow/process[@version='#{version}' and @status='error']/@errorMessage").map(&:text)
|
34
28
|
end
|
35
29
|
end
|
36
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dor-services-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 15.
|
4
|
+
version: 15.18.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
8
8
|
- Michael Giarlo
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.105.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.105.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: deprecation
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -292,7 +292,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
292
292
|
- !ruby/object:Gem::Version
|
293
293
|
version: '0'
|
294
294
|
requirements: []
|
295
|
-
rubygems_version: 3.6.
|
295
|
+
rubygems_version: 3.6.2
|
296
296
|
specification_version: 4
|
297
297
|
summary: A client for dor-services-app
|
298
298
|
test_files: []
|