dor-services-client 7.3.1 → 7.7.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: f323448e52df870c23823d8c30a556fdd3ab2fbba7ef69c9d438ac6bc541109e
4
- data.tar.gz: 5c5aec3aca02df4c3af40865d8f479a8d38487bc8ae03e66f83bbccee224875c
3
+ metadata.gz: '091ec3a6c3f6f594c1278e13a2b0894bc74e929431cb50fc17dc3c84e76c1288'
4
+ data.tar.gz: c193a207bc072aa4b43f52c5626b37ef2858ff793d853f3a253ab85349d72d38
5
5
  SHA512:
6
- metadata.gz: 0667a7d719b7078a66a2ab6907fd939a9a35530d766134a5c93425b347a16a2b580fc4f529f8d52567bf7cf08790e32bda0d2041df948801c95b006f4cfdaaf5
7
- data.tar.gz: 615e0d7542a2082d3c9a4460414d96ecfc74c0f343cb96f1b545530f885316ae8917f69748476b7b4b9d136fa0effee127e24fb66dda9dd819cb4038c12d3f09
6
+ metadata.gz: 9eaba7067afd9ecc31bc273b707b973d1d51a1e938d7dabd5f3d74624357fb02bf7850261ba4d622d970d3547df1977c915321236da4c504eef4fff78d255da3
7
+ data.tar.gz: 93ea4a403b1ff59a4656685c6c5df47678d15601dbe14832e6cfa2c56fdda48a9af22c7d4ae0666b521f383200fe99d3ed30f6e0aa002227b1a98d97f63566b1
data/.circleci/config.yml CHANGED
@@ -1,35 +1,10 @@
1
1
  version: 2.1
2
-
3
- jobs:
2
+ orbs:
3
+ ruby-rails: sul-dlss/ruby-rails@2.0.0
4
+ workflows:
4
5
  build:
5
- docker:
6
- - image: circleci/ruby:2.7.1
7
- environment:
8
- CC_TEST_REPORTER_ID: 47b57fbbf65654b17f33b6ff4a108ce2abed31a86468033f20eb4d4e9e09935a
9
- RAILS_ENV: test
10
- steps:
11
- - checkout
12
- - run:
13
- name: Install Bundler
14
- command: gem install bundler
15
- - run:
16
- name: Which bundler?
17
- command: bundle -v
18
- - run:
19
- name: Bundle Install
20
- command: bundle check || bundle install
21
- - run:
22
- name: Lint using rubocop
23
- command: bundle exec rubocop
24
- - run:
25
- name: Setup Code Climate test-reporter
26
- command: |
27
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
28
- chmod +x ./cc-test-reporter
29
- ./cc-test-reporter before-build
30
- - run:
31
- name: rspec
32
- command: bundle exec rspec
33
- - run:
34
- name: upload test coverage report to Code Climate
35
- command: ./cc-test-reporter after-build --coverage-input-type simplecov --exit-code $?
6
+ jobs:
7
+ - ruby-rails/lint:
8
+ name: lint
9
+ - ruby-rails/test-gem:
10
+ name: test
data/.rubocop.yml CHANGED
@@ -1,7 +1,10 @@
1
1
  inherit_from: .rubocop_todo.yml
2
2
 
3
+ require:
4
+ - rubocop-rspec
5
+
3
6
  AllCops:
4
- TargetRubyVersion: 2.6
7
+ TargetRubyVersion: 2.7 # dor-services-app can't be 3 due to fedora3
5
8
  SuggestExtensions: false
6
9
 
7
10
  Metrics/BlockLength:
@@ -81,3 +84,47 @@ Layout/LineEndStringConcatenationIndentation: # (new in 1.18)
81
84
  Enabled: true
82
85
  Naming/InclusiveLanguage: # (new in 1.18)
83
86
  Enabled: true
87
+
88
+ Gemspec/RequireMFA: # new in 1.23
89
+ Enabled: true
90
+ Lint/AmbiguousOperatorPrecedence: # new in 1.21
91
+ Enabled: true
92
+ Lint/AmbiguousRange: # new in 1.19
93
+ Enabled: true
94
+ Lint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21
95
+ Enabled: true
96
+ Lint/RequireRelativeSelfPath: # new in 1.22
97
+ Enabled: true
98
+ Lint/UselessRuby2Keywords: # new in 1.23
99
+ Enabled: true
100
+ Naming/BlockForwarding: # new in 1.24
101
+ Enabled: true
102
+ Security/IoMethods: # new in 1.22
103
+ Enabled: true
104
+ Style/FileRead: # new in 1.24
105
+ Enabled: true
106
+ Style/FileWrite: # new in 1.24
107
+ Enabled: true
108
+ Style/MapToHash: # new in 1.24
109
+ Enabled: true
110
+ Style/NumberedParameters: # new in 1.22
111
+ Enabled: true
112
+ Style/NumberedParametersLimit: # new in 1.22
113
+ Enabled: true
114
+ Style/OpenStructUse: # new in 1.23
115
+ Enabled: true
116
+ Style/RedundantSelfAssignmentBranch: # new in 1.19
117
+ Enabled: true
118
+ Style/SelectByRegexp: # new in 1.22
119
+ Enabled: true
120
+
121
+ RSpec/ExcessiveDocstringSpacing: # new in 2.5
122
+ Enabled: true
123
+ RSpec/IdenticalEqualityAssertion: # new in 2.4
124
+ Enabled: true
125
+ RSpec/SubjectDeclaration: # new in 2.5
126
+ Enabled: true
127
+ RSpec/FactoryBot/SyntaxMethods: # new in 2.7
128
+ Enabled: true
129
+ RSpec/Rails/AvoidSetupHook: # new in 2.4
130
+ Enabled: true
data/.rubocop_todo.yml CHANGED
@@ -1,22 +1,86 @@
1
1
  # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2021-03-17 17:24:07 UTC using RuboCop version 1.11.0.
2
+ # `rubocop --auto-gen-config --auto-gen-only-exclude`
3
+ # on 2022-01-14 01:12:44 UTC using RuboCop version 1.24.1.
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
9
  # Offense count: 2
10
- # Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
10
+ # Configuration parameters: IgnoredMethods, CountRepeatedAttributes, Max.
11
11
  Metrics/AbcSize:
12
- Max: 22
12
+ Exclude:
13
+ - 'lib/dor/services/client/marcxml.rb'
13
14
 
14
15
  # Offense count: 1
15
- # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
16
+ # Configuration parameters: CountComments, Max, CountAsOne, ExcludedMethods, IgnoredMethods.
16
17
  Metrics/MethodLength:
17
- Max: 11
18
+ Exclude:
19
+ - 'lib/dor/services/client/transfer.rb'
20
+
21
+ # Offense count: 4
22
+ RSpec/AnyInstance:
23
+ Exclude:
24
+ - 'spec/dor/services/client/async_result_spec.rb'
25
+ - 'spec/dor/services/client/metadata_spec.rb'
26
+ - 'spec/dor/services/client/object_version_spec.rb'
27
+
28
+ # Offense count: 1
29
+ # Configuration parameters: Max, CountAsOne.
30
+ RSpec/ExampleLength:
31
+ Exclude:
32
+ - 'spec/dor/services/client/metadata_spec.rb'
33
+
34
+ # Offense count: 6
35
+ RSpec/IdenticalEqualityAssertion:
36
+ Exclude:
37
+ - 'spec/dor/services/client_spec.rb'
38
+
39
+ # Offense count: 8
40
+ # Configuration parameters: Max.
41
+ RSpec/MultipleExpectations:
42
+ Exclude:
43
+ - 'spec/dor/services/client/async_result_spec.rb'
44
+ - 'spec/dor/services/client/background_job_results_spec.rb'
45
+ - 'spec/dor/services/client/events_spec.rb'
46
+ - 'spec/dor/services/client/object_spec.rb'
47
+ - 'spec/dor/services/client/response_error_formatter_spec.rb'
48
+
49
+ # Offense count: 7
50
+ # Configuration parameters: AllowSubject, Max.
51
+ RSpec/MultipleMemoizedHelpers:
52
+ Exclude:
53
+ - 'spec/dor/services/client/objects_spec.rb'
54
+
55
+ # Offense count: 1
56
+ # Cop supports --auto-correct.
57
+ RSpec/MultipleSubjects:
58
+ Exclude:
59
+ - 'spec/dor/services/client/object_spec.rb'
60
+
61
+ # Offense count: 13
62
+ # Configuration parameters: Max.
63
+ RSpec/NestedGroups:
64
+ Exclude:
65
+ - 'spec/dor/services/client/accession_spec.rb'
66
+ - 'spec/dor/services/client/background_job_results_spec.rb'
67
+ - 'spec/dor/services/client/metadata_spec.rb'
68
+ - 'spec/dor/services/client/objects_spec.rb'
69
+ - 'spec/dor/services/client_spec.rb'
70
+
71
+ # Offense count: 4
72
+ RSpec/RepeatedDescription:
73
+ Exclude:
74
+ - 'spec/dor/services/client/object_spec.rb'
75
+
76
+ # Offense count: 3
77
+ # Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
78
+ RSpec/VerifiedDoubles:
79
+ Exclude:
80
+ - 'spec/dor/services/client/response_error_formatter_spec.rb'
18
81
 
19
82
  # Offense count: 1
83
+ # Configuration parameters: AllowedConstants.
20
84
  Style/Documentation:
21
85
  Exclude:
22
86
  - 'spec/**/*'
@@ -25,7 +89,7 @@ Style/Documentation:
25
89
 
26
90
  # Offense count: 77
27
91
  # Cop supports --auto-correct.
28
- # Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
92
+ # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
29
93
  # URISchemes: http, https
30
94
  Layout/LineLength:
31
95
  Max: 164
data/README.md CHANGED
@@ -96,6 +96,9 @@ object_client.update(params: dro)
96
96
  # Publish an object (push to PURL)
97
97
  object_client.publish(workflow: 'releaseWF', lane_id: 'low')
98
98
 
99
+ # Unpublish an object (yank from PURL)
100
+ object_client.unpublish()
101
+
99
102
  # Shelve an object (push to Stacks)
100
103
  object_client.shelve(lane_id: 'low')
101
104
 
@@ -22,10 +22,10 @@ Gem::Specification.new do |spec|
22
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
23
  spec.require_paths = ['lib']
24
24
 
25
- spec.required_ruby_version = '~> 2.6'
25
+ spec.required_ruby_version = '>= 2.7', '< 4' # dor-services-app needs 2.7 due to fedora3
26
26
 
27
- spec.add_dependency 'activesupport', '>= 4.2', '< 7'
28
- spec.add_dependency 'cocina-models', '~> 0.62.0' # leave pinned to patch level until cocina-models hits 1.0
27
+ spec.add_dependency 'activesupport', '>= 4.2', '< 8'
28
+ spec.add_dependency 'cocina-models', '~> 0.63.0' # leave pinned to patch level until cocina-models hits 1.0
29
29
  spec.add_dependency 'deprecation', '>= 0'
30
30
  spec.add_dependency 'faraday', '>= 0.15', '< 2'
31
31
  spec.add_dependency 'zeitwerk', '~> 2.1'
@@ -35,6 +35,8 @@ Gem::Specification.new do |spec|
35
35
  spec.add_development_dependency 'rake', '>= 12.3.3'
36
36
  spec.add_development_dependency 'rspec', '~> 3.0'
37
37
  spec.add_development_dependency 'rubocop', '~> 1.0'
38
- spec.add_development_dependency 'simplecov', '~> 0.17.0' # CodeClimate cannot use SimpleCov >= 0.18.0 for generating test coverage
38
+ spec.add_development_dependency 'rubocop-rspec', '~> 2.1'
39
+ spec.add_development_dependency 'simplecov'
39
40
  spec.add_development_dependency 'webmock'
41
+ spec.metadata['rubygems_mfa_required'] = 'true'
40
42
  end
@@ -83,7 +83,7 @@ module Dor
83
83
  Transfer.new(**parent_params)
84
84
  end
85
85
 
86
- delegate :publish, :preserve, :shelve, to: :transfer
86
+ delegate :publish, :unpublish, :preserve, :shelve, to: :transfer
87
87
 
88
88
  def mutate
89
89
  Mutate.new(**parent_params)
@@ -14,9 +14,9 @@ module Dor
14
14
  # Publish an object (send to PURL)
15
15
  # @raise [NotFoundResponse] when the response is a 404 (object not found)
16
16
  # @raise [UnexpectedResponse] when the response is not successful.
17
- # @param [String] workflow ('accessionWF') which workflow to callback to.
17
+ # @param [String] workflow (nil) which workflow to callback to.
18
18
  # @param [String] lane_id for prioritization (default or low)
19
- # @return [boolean] true on success
19
+ # @return [String] the URL of the background job on dor-service-app
20
20
  def publish(workflow: nil, lane_id: nil)
21
21
  query_params = [].tap do |params|
22
22
  params << "workflow=#{workflow}" if workflow
@@ -32,6 +32,19 @@ module Dor
32
32
  raise_exception_based_on_response!(resp)
33
33
  end
34
34
 
35
+ # Unpublish an object (yank from to PURL)
36
+ # @raise [NotFoundResponse] when the response is a 404 (object not found)
37
+ # @raise [UnexpectedResponse] when the response is not successful.
38
+ # @return [String] the URL of the background job on dor-service-app
39
+ def unpublish
40
+ resp = connection.post do |req|
41
+ req.url "#{object_path}/unpublish"
42
+ end
43
+ return resp.headers['Location'] if resp.success?
44
+
45
+ raise_exception_based_on_response!(resp)
46
+ end
47
+
35
48
  # Preserve an object (send to SDR)
36
49
  # @raise [NotFoundResponse] when the response is a 404 (object not found)
37
50
  # @raise [UnexpectedResponse] when the response is not successful.
@@ -3,7 +3,7 @@
3
3
  module Dor
4
4
  module Services
5
5
  class Client
6
- VERSION = '7.3.1'
6
+ VERSION = '7.7.0'
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dor-services-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.3.1
4
+ version: 7.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2021-10-19 00:00:00.000000000 Z
12
+ date: 2022-01-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -20,7 +20,7 @@ dependencies:
20
20
  version: '4.2'
21
21
  - - "<"
22
22
  - !ruby/object:Gem::Version
23
- version: '7'
23
+ version: '8'
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
@@ -30,21 +30,21 @@ dependencies:
30
30
  version: '4.2'
31
31
  - - "<"
32
32
  - !ruby/object:Gem::Version
33
- version: '7'
33
+ version: '8'
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: cocina-models
36
36
  requirement: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.62.0
40
+ version: 0.63.0
41
41
  type: :runtime
42
42
  prerelease: false
43
43
  version_requirements: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.62.0
47
+ version: 0.63.0
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: deprecation
50
50
  requirement: !ruby/object:Gem::Requirement
@@ -164,19 +164,33 @@ dependencies:
164
164
  - !ruby/object:Gem::Version
165
165
  version: '1.0'
166
166
  - !ruby/object:Gem::Dependency
167
- name: simplecov
167
+ name: rubocop-rspec
168
168
  requirement: !ruby/object:Gem::Requirement
169
169
  requirements:
170
170
  - - "~>"
171
171
  - !ruby/object:Gem::Version
172
- version: 0.17.0
172
+ version: '2.1'
173
173
  type: :development
174
174
  prerelease: false
175
175
  version_requirements: !ruby/object:Gem::Requirement
176
176
  requirements:
177
177
  - - "~>"
178
178
  - !ruby/object:Gem::Version
179
- version: 0.17.0
179
+ version: '2.1'
180
+ - !ruby/object:Gem::Dependency
181
+ name: simplecov
182
+ requirement: !ruby/object:Gem::Requirement
183
+ requirements:
184
+ - - ">="
185
+ - !ruby/object:Gem::Version
186
+ version: '0'
187
+ type: :development
188
+ prerelease: false
189
+ version_requirements: !ruby/object:Gem::Requirement
190
+ requirements:
191
+ - - ">="
192
+ - !ruby/object:Gem::Version
193
+ version: '0'
180
194
  - !ruby/object:Gem::Dependency
181
195
  name: webmock
182
196
  requirement: !ruby/object:Gem::Requirement
@@ -237,16 +251,20 @@ files:
237
251
  - lib/dor/services/client/workspace.rb
238
252
  homepage: https://github.com/sul-dlss/dor-services-client
239
253
  licenses: []
240
- metadata: {}
254
+ metadata:
255
+ rubygems_mfa_required: 'true'
241
256
  post_install_message:
242
257
  rdoc_options: []
243
258
  require_paths:
244
259
  - lib
245
260
  required_ruby_version: !ruby/object:Gem::Requirement
246
261
  requirements:
247
- - - "~>"
262
+ - - ">="
263
+ - !ruby/object:Gem::Version
264
+ version: '2.7'
265
+ - - "<"
248
266
  - !ruby/object:Gem::Version
249
- version: '2.6'
267
+ version: '4'
250
268
  required_rubygems_version: !ruby/object:Gem::Requirement
251
269
  requirements:
252
270
  - - ">="