dor-services 8.2.0 → 8.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 55aca082954da26152f1a29b2212755d957a1d7fdf1d2dd87ff373555ab4d66e
4
- data.tar.gz: ca157bb92f8dabe93a9d49e9d862f8cdfcaee9b7d59fe6510cfd8180b67cd19c
3
+ metadata.gz: 122c50609b2053d3b4083b985fcc128fd89726687a5bdf1230a4bbfafb55355f
4
+ data.tar.gz: 5c375fe22a648e6a697902a056b6752962cd78d7ecaa6c58d3b7c7049b1181fc
5
5
  SHA512:
6
- metadata.gz: a4ca1272b55af9e0c828fa678d6a51a669f3614c72b367a51c2bf22ba29dc69ccc1ad44482756c704bca319b3b7decc47a7a44a24ef62457062b38975c472a3c
7
- data.tar.gz: 609b3cb8a631c40979aea5e37086ed50550fd42d3ea1e3bede01b10942c01942b0fc2db86fcaaf893d7fb8ad9389c93c6be25abbe34acca042527c79ab19e96e
6
+ metadata.gz: 073f7a22dfe87e282a156ea6f1b14ad1971bafa79e29334d95da14a89c094b0c0e68f7b706519b0ea5d928de665383846c33563e8f4c98a6d9e7b291192c07aa
7
+ data.tar.gz: 8c5424ada3a28d7acee8061d398a436f8cc9b214a299d40e4ad15a8337967ff176f5a376b59eed55239a0e412c0f99ef0870b3865e515627fd2a12f655bfe338
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'scanf'
4
3
  require 'uri'
5
4
 
6
5
  module Dor
@@ -20,17 +20,18 @@ module Dor
20
20
  WorkflowSolrDocument.new do |solr_doc|
21
21
  definition = Dor::Config.workflow.client.workflow_template(workflow_name)
22
22
  solr_doc.name = workflow_name
23
- processes_names = definition['processes'].map { |p| p['name'] }
23
+ definition_process_names = definition['processes'].map { |p| p['name'] }
24
24
 
25
25
  errors = 0 # The error count is used by the Report class in Argo
26
- processes = processes_names.map do |process_name|
26
+ processes = definition_process_names.map do |process_name|
27
27
  workflow.process_for_recent_version(name: process_name)
28
28
  end
29
+
29
30
  processes.each do |process|
30
31
  index_process(solr_doc, process)
31
32
  errors += 1 if process.status == 'error'
32
33
  end
33
- solr_doc.status = [workflow_name, workflow_status(processes), errors, repository].join('|')
34
+ solr_doc.status = [workflow_name, workflow_status(workflow), errors, repository].join('|')
34
35
  end
35
36
  end
36
37
 
@@ -62,14 +63,8 @@ module Dor
62
63
  process.datetime && process.status && (process.status == 'completed' || process.status == 'error')
63
64
  end
64
65
 
65
- def workflow_status(processes)
66
- return 'empty' if processes.empty?
67
-
68
- workflow_should_show_completed?(processes) ? 'completed' : 'active'
69
- end
70
-
71
- def workflow_should_show_completed?(processes)
72
- processes.all? { |p| %w[skipped completed].include?(p.status) }
66
+ def workflow_status(workflow)
67
+ workflow.complete? ? 'completed' : 'active'
73
68
  end
74
69
 
75
70
  # index the error message without the druid so we hopefully get some overlap
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dor
4
- VERSION = '8.2.0'
4
+ VERSION = '8.3.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dor-services
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.2.0
4
+ version: 8.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Klein
@@ -20,7 +20,7 @@ authors:
20
20
  autorequire:
21
21
  bindir: bin
22
22
  cert_chain: []
23
- date: 2019-12-20 00:00:00.000000000 Z
23
+ date: 2020-01-08 00:00:00.000000000 Z
24
24
  dependencies:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: active-fedora
@@ -240,14 +240,14 @@ dependencies:
240
240
  requirements:
241
241
  - - "~>"
242
242
  - !ruby/object:Gem::Version
243
- version: '3.9'
243
+ version: '3.1'
244
244
  type: :runtime
245
245
  prerelease: false
246
246
  version_requirements: !ruby/object:Gem::Requirement
247
247
  requirements:
248
248
  - - "~>"
249
249
  - !ruby/object:Gem::Version
250
- version: '3.9'
250
+ version: '3.1'
251
251
  - !ruby/object:Gem::Dependency
252
252
  name: druid-tools
253
253
  requirement: !ruby/object:Gem::Requirement