pushmi_pullyu 2.0.3 → 2.0.4

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: d64e5d619eb9dee63c358167cd6778034eb72fa2686fbe95fa187cfdfe7525b3
4
- data.tar.gz: 333805bd92b1d5e308949d583e46056ffb1aeac9900d9c23ca59f2b88a7a4d01
3
+ metadata.gz: aabca31fdc4036e26f6fbd682b2e9aece8179973fc1509e7eada08b7bcdaf796
4
+ data.tar.gz: '0678d634ac98e9a4aeefa0bfb5d6df5a4869c0db3ba1b784be38a65caf916d75'
5
5
  SHA512:
6
- metadata.gz: b8b162ca028ca37362d0bcd68737189f6af656c747bfc18a1593e35635bddf606d649e8d02299d092b1b569cab7e8a03950855fe2f7da4f5877a2714c99af8cc
7
- data.tar.gz: 56c8653b1d868993e31607de7cd1d811752ff4de1ab63813dec2f745321f2b7d6a54107eb304f0f93191d6372bf22e55977512155edca08ee25ad96c23fc0099
6
+ metadata.gz: fb769198d6bf7e609fbbe7eec02498756f185e338439983a1ad14391392e9d3f66dd8368438791e237066137edd9bbf0afe355d6ef84cb61a11b5a00acc3e48a
7
+ data.tar.gz: b921457537461cd5512fec7ac072f301c701a98a40ee210236c39cb098b04b9c1206ca2b2a0c759ab6e9fce4f2a4768329ded84a104c1fd8ec51e74e4b7b395b
@@ -18,9 +18,8 @@ jobs:
18
18
  - name: Set up Ruby
19
19
  uses: ruby/setup-ruby@v1
20
20
  with:
21
- ruby-version: 2.6.6
22
- - name: Install dependencies
23
- run: bundle install
21
+ ruby-version: '2.7'
22
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
24
23
  - name: Lint with RuboCop
25
24
  run: bundle exec rubocop --parallel
26
25
  - name: Run Danger
data/.gitignore CHANGED
@@ -1,6 +1,5 @@
1
1
  /.bundle/
2
2
  /.yardoc
3
- /Gemfile.lock
4
3
  /_yardoc/
5
4
  /coverage/
6
5
  /doc/
data/.rubocop.yml CHANGED
@@ -12,7 +12,7 @@ AllCops:
12
12
  - 'vendor/**/*'
13
13
  - 'Dangerfile'
14
14
  ExtraDetails: true
15
- TargetRubyVersion: 2.5
15
+ TargetRubyVersion: 2.7
16
16
  NewCops: enable
17
17
 
18
18
  # readability is Actually Good
data/CHANGELOG.md CHANGED
@@ -8,6 +8,17 @@ and releases in PushmiPullyu adheres to [Semantic Versioning](https://semver.org
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [2.0.4] - 2022-11-22
12
+
13
+ - Fix issue with temporary work files not being deleted after a failed swift deposit [#242](https://github.com/ualbertalib/pushmi_pullyu/issues/242)
14
+ - Bump to Ruby 2.7
15
+ - Fix issue with entity information consumed even after failed deposit [#232](https://github.com/ualbertalib/pushmi_pullyu/issues/232)
16
+ - Bump rspec from 3.10.0 to 3.12.0
17
+ - Bump rollbar from 3.3.0 to 3.3.2
18
+ - Bump pry-byebug from 3.8.0 to 3.10.1
19
+ - Bump webmock from 3.14.0 to 3.18.1
20
+ - Bump rubocop-rspec from 2.6.0 to 2.11.1
21
+ - Bump timecop from 0.9.4 to 0.9.5
11
22
  ## [2.0.3] - 2022-04-28
12
23
 
13
24
  - Changed Danger token in Github Actions
data/Gemfile.lock ADDED
@@ -0,0 +1,250 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ pushmi_pullyu (2.0.4)
5
+ activesupport (>= 5, < 8)
6
+ bagit (~> 0.4)
7
+ connection_pool (~> 2.2)
8
+ daemons (~> 1.2, >= 1.2.4)
9
+ minitar (~> 0.7)
10
+ openstack (~> 3.3, >= 3.3.10)
11
+ rdf (>= 1.99, < 4.0)
12
+ rdf-n3 (>= 1.99, < 4.0)
13
+ redis (>= 3.3, < 5.0)
14
+ rest-client (>= 1.8, < 3.0)
15
+ rollbar (>= 2.18, < 4.0)
16
+ uuid (~> 2.3.9)
17
+
18
+ GEM
19
+ remote: https://rubygems.org/
20
+ specs:
21
+ activesupport (7.0.2.4)
22
+ concurrent-ruby (~> 1.0, >= 1.0.2)
23
+ i18n (>= 1.6, < 2)
24
+ minitest (>= 5.1)
25
+ tzinfo (~> 2.0)
26
+ addressable (2.8.1)
27
+ public_suffix (>= 2.0.2, < 6.0)
28
+ amazing_print (1.4.0)
29
+ ast (2.4.2)
30
+ bagit (0.4.5)
31
+ docopt (~> 0.5.0)
32
+ validatable (~> 1.6)
33
+ builder (3.2.4)
34
+ byebug (11.1.3)
35
+ claide (1.0.3)
36
+ claide-plugins (0.9.2)
37
+ cork
38
+ nap
39
+ open4 (~> 1.3)
40
+ coderay (1.1.3)
41
+ colored2 (3.1.2)
42
+ concurrent-ruby (1.1.10)
43
+ connection_pool (2.2.5)
44
+ cork (0.3.0)
45
+ colored2 (~> 3.1)
46
+ crack (0.4.5)
47
+ rexml
48
+ daemons (1.4.1)
49
+ danger (8.4.2)
50
+ claide (~> 1.0)
51
+ claide-plugins (>= 0.9.2)
52
+ colored2 (~> 3.1)
53
+ cork (~> 0.1)
54
+ faraday (>= 0.9.0, < 2.0)
55
+ faraday-http-cache (~> 2.0)
56
+ git (~> 1.7)
57
+ kramdown (~> 2.3)
58
+ kramdown-parser-gfm (~> 1.0)
59
+ no_proxy_fix
60
+ octokit (~> 4.7)
61
+ terminal-table (>= 1, < 4)
62
+ diff-lcs (1.5.0)
63
+ docopt (0.5.0)
64
+ domain_name (0.5.20190701)
65
+ unf (>= 0.0.5, < 1.0.0)
66
+ ebnf (2.3.1)
67
+ amazing_print (~> 1.4)
68
+ htmlentities (~> 4.3)
69
+ rdf (~> 3.2)
70
+ scanf (~> 1.0)
71
+ sxp (~> 1.2)
72
+ unicode-types (~> 1.7)
73
+ faraday (1.8.0)
74
+ faraday-em_http (~> 1.0)
75
+ faraday-em_synchrony (~> 1.0)
76
+ faraday-excon (~> 1.1)
77
+ faraday-httpclient (~> 1.0.1)
78
+ faraday-net_http (~> 1.0)
79
+ faraday-net_http_persistent (~> 1.1)
80
+ faraday-patron (~> 1.0)
81
+ faraday-rack (~> 1.0)
82
+ multipart-post (>= 1.2, < 3)
83
+ ruby2_keywords (>= 0.0.4)
84
+ faraday-em_http (1.0.0)
85
+ faraday-em_synchrony (1.0.0)
86
+ faraday-excon (1.1.0)
87
+ faraday-http-cache (2.2.0)
88
+ faraday (>= 0.8)
89
+ faraday-httpclient (1.0.1)
90
+ faraday-net_http (1.0.1)
91
+ faraday-net_http_persistent (1.2.0)
92
+ faraday-patron (1.0.0)
93
+ faraday-rack (1.0.0)
94
+ git (1.9.1)
95
+ rchardet (~> 1.8)
96
+ hashdiff (1.0.1)
97
+ htmlentities (4.3.4)
98
+ http-accept (1.7.0)
99
+ http-cookie (1.0.4)
100
+ domain_name (~> 0.5)
101
+ i18n (1.10.0)
102
+ concurrent-ruby (~> 1.0)
103
+ json (2.6.1)
104
+ kramdown (2.3.1)
105
+ rexml
106
+ kramdown-parser-gfm (1.1.0)
107
+ kramdown (~> 2.0)
108
+ link_header (0.0.8)
109
+ logger (1.5.1)
110
+ macaddr (1.7.2)
111
+ systemu (~> 2.6.5)
112
+ matrix (0.4.2)
113
+ method_source (1.0.0)
114
+ mime-types (3.4.1)
115
+ mime-types-data (~> 3.2015)
116
+ mime-types-data (3.2022.0105)
117
+ minitar (0.9)
118
+ minitest (5.15.0)
119
+ multipart-post (2.1.1)
120
+ nap (1.1.0)
121
+ net-http-persistent (4.0.1)
122
+ connection_pool (~> 2.2)
123
+ netrc (0.11.0)
124
+ no_proxy_fix (0.1.2)
125
+ octokit (4.21.0)
126
+ faraday (>= 0.9)
127
+ sawyer (~> 0.8.0, >= 0.5.3)
128
+ open4 (1.3.4)
129
+ openstack (3.3.21)
130
+ json
131
+ parallel (1.22.1)
132
+ parser (3.1.2.1)
133
+ ast (~> 2.4.1)
134
+ pry (0.14.1)
135
+ coderay (~> 1.1)
136
+ method_source (~> 1.0)
137
+ pry-byebug (3.10.1)
138
+ byebug (~> 11.0)
139
+ pry (>= 0.13, < 0.15)
140
+ public_suffix (5.0.0)
141
+ rainbow (3.1.1)
142
+ rake (13.0.6)
143
+ rchardet (1.8.0)
144
+ rdf (3.2.7)
145
+ link_header (~> 0.0, >= 0.0.8)
146
+ rdf-aggregate-repo (3.2.0)
147
+ rdf (~> 3.2)
148
+ rdf-n3 (3.2.1)
149
+ ebnf (~> 2.2)
150
+ rdf (~> 3.2)
151
+ sparql (~> 3.2)
152
+ sxp (~> 1.2)
153
+ rdf-xsd (3.2.1)
154
+ rdf (~> 3.2)
155
+ rexml (~> 3.2)
156
+ redis (4.6.0)
157
+ regexp_parser (2.6.0)
158
+ rest-client (2.1.0)
159
+ http-accept (>= 1.7.0, < 2.0)
160
+ http-cookie (>= 1.0.2, < 2.0)
161
+ mime-types (>= 1.16, < 4.0)
162
+ netrc (~> 0.8)
163
+ rexml (3.2.5)
164
+ rollbar (3.3.0)
165
+ rspec (3.12.0)
166
+ rspec-core (~> 3.12.0)
167
+ rspec-expectations (~> 3.12.0)
168
+ rspec-mocks (~> 3.12.0)
169
+ rspec-core (3.12.0)
170
+ rspec-support (~> 3.12.0)
171
+ rspec-expectations (3.12.0)
172
+ diff-lcs (>= 1.2.0, < 2.0)
173
+ rspec-support (~> 3.12.0)
174
+ rspec-mocks (3.12.0)
175
+ diff-lcs (>= 1.2.0, < 2.0)
176
+ rspec-support (~> 3.12.0)
177
+ rspec-support (3.12.0)
178
+ rubocop (1.28.1)
179
+ parallel (~> 1.10)
180
+ parser (>= 3.1.0.0)
181
+ rainbow (>= 2.2.2, < 4.0)
182
+ regexp_parser (>= 1.8, < 3.0)
183
+ rexml
184
+ rubocop-ast (>= 1.17.0, < 2.0)
185
+ ruby-progressbar (~> 1.7)
186
+ unicode-display_width (>= 1.4.0, < 3.0)
187
+ rubocop-ast (1.23.0)
188
+ parser (>= 3.1.1.0)
189
+ rubocop-rspec (2.11.1)
190
+ rubocop (~> 1.19)
191
+ ruby-progressbar (1.11.0)
192
+ ruby2_keywords (0.0.5)
193
+ sawyer (0.8.2)
194
+ addressable (>= 2.3.5)
195
+ faraday (> 0.8, < 2.0)
196
+ scanf (1.0.0)
197
+ sparql (3.2.1)
198
+ builder (~> 3.2)
199
+ ebnf (~> 2.2)
200
+ logger (~> 1.4)
201
+ rdf (~> 3.2, >= 3.2.3)
202
+ rdf-aggregate-repo (~> 3.2)
203
+ rdf-xsd (~> 3.2)
204
+ sparql-client (~> 3.2)
205
+ sxp (~> 1.2, >= 1.2.1)
206
+ sparql-client (3.2.1)
207
+ net-http-persistent (~> 4.0, >= 4.0.1)
208
+ rdf (~> 3.2, >= 3.2.6)
209
+ sxp (1.2.2)
210
+ matrix
211
+ rdf (~> 3.2)
212
+ systemu (2.6.5)
213
+ terminal-table (3.0.2)
214
+ unicode-display_width (>= 1.1.1, < 3)
215
+ timecop (0.9.5)
216
+ tzinfo (2.0.4)
217
+ concurrent-ruby (~> 1.0)
218
+ unf (0.1.4)
219
+ unf_ext
220
+ unf_ext (0.0.8.1)
221
+ unicode-display_width (2.3.0)
222
+ unicode-types (1.7.0)
223
+ uuid (2.3.9)
224
+ macaddr (~> 1.0)
225
+ validatable (1.6.7)
226
+ vcr (5.1.0)
227
+ webmock (3.18.1)
228
+ addressable (>= 2.8.0)
229
+ crack (>= 0.3.2)
230
+ hashdiff (>= 0.4.0, < 2.0.0)
231
+
232
+ PLATFORMS
233
+ x86_64-linux
234
+
235
+ DEPENDENCIES
236
+ bundler (~> 2.0)
237
+ danger (~> 8.0)
238
+ pry (~> 0.10, >= 0.10.4)
239
+ pry-byebug (~> 3.6)
240
+ pushmi_pullyu!
241
+ rake (~> 13.0)
242
+ rspec (~> 3.0)
243
+ rubocop (~> 1.23)
244
+ rubocop-rspec (~> 2.6)
245
+ timecop (~> 0.8)
246
+ vcr (~> 5.0)
247
+ webmock (~> 3.3)
248
+
249
+ BUNDLED WITH
250
+ 2.3.12
data/README.md CHANGED
@@ -26,7 +26,7 @@ Its primary job is to manage the flow of content from Jupiter into Swift for pre
26
26
 
27
27
  ## Requirements
28
28
 
29
- PushmiPullyu supports Ruby 2.3.1+
29
+ PushmiPullyu supports Ruby 2.7
30
30
 
31
31
  ## Installation
32
32
 
@@ -6,19 +6,22 @@ module PushmiPullyu::AIP
6
6
  module_function
7
7
 
8
8
  def create(entity)
9
- raise EntityInvalid if entity.nil? ||
10
- UUID.validate(entity[:uuid]) != true ||
9
+ raise EntityInvalid if entity.blank? ||
10
+ UUID.validate(entity[:uuid]).blank? ||
11
11
  entity[:type].blank?
12
12
 
13
13
  aip_directory = "#{PushmiPullyu.options[:workdir]}/#{entity[:uuid]}"
14
14
  aip_filename = "#{aip_directory}.tar"
15
+ begin
16
+ PushmiPullyu::AIP::Downloader.new(entity, aip_directory).run
17
+ PushmiPullyu::AIP::Creator.new(entity[:uuid], aip_directory, aip_filename).run
15
18
 
16
- PushmiPullyu::AIP::Downloader.new(entity, aip_directory).run
17
- PushmiPullyu::AIP::Creator.new(entity[:uuid], aip_directory, aip_filename).run
18
-
19
- yield aip_filename, aip_directory
20
-
21
- FileUtils.rm_rf(aip_filename) if File.exist?(aip_filename)
22
- FileUtils.rm_rf(aip_directory) if File.exist?(aip_directory)
19
+ yield aip_filename, aip_directory
20
+ # Here we will ensure the files are removed even if an exception comes up.
21
+ # You will notice there is no rescue block. We will catch exceptions in `PushmiPullyu::CLI`
22
+ ensure
23
+ FileUtils.rm_rf(aip_filename)
24
+ FileUtils.rm_rf(aip_directory)
25
+ end
23
26
  end
24
27
  end
@@ -182,11 +182,10 @@ class PushmiPullyu::CLI
182
182
  end
183
183
 
184
184
  def run_preservation_cycle
185
- entity_json = JSON.parse(queue.wait_next_item)
186
- entity = {
187
- type: entity_json['type'],
188
- uuid: entity_json['uuid']
189
- }
185
+ entity_json = queue.wait_next_item
186
+ # jupiter is submitting the entries to reddis in a hash format using fat arrows. We need to change them to colons in
187
+ # order to parse them correctly from json
188
+ entity = JSON.parse(entity_json.gsub('=>', ':'), { symbolize_names: true })
190
189
  return unless entity[:type].present? && entity[:uuid].present?
191
190
 
192
191
  # add additional information about the error context to errors that occur while processing this item.
@@ -199,13 +198,21 @@ class PushmiPullyu::CLI
199
198
  # Log successful preservation event to the log files
200
199
  PushmiPullyu::Logging.log_preservation_event(deposited_file, aip_directory)
201
200
  end
202
- # rubocop:disable Lint/RescueException
201
+ # An EntityInvalid expection means there is a problem with the entity information format so there is no point in
202
+ # readding it to the queue as it will always fail
203
+ rescue PushmiPullyu::AIP::EntityInvalid => e
204
+ rescue StandardError => e
205
+ queue.add_entity_json(entity_json)
206
+
207
+ # rubocop:disable Lint/RescueException
208
+ # Something other than a StandardError exception means something happened which we were not expecting!
209
+ # Make sure we log the problem
203
210
  rescue Exception => e
211
+ raise e
212
+ # rubocop:enable Lint/RescueException
213
+ ensure
204
214
  Rollbar.error(e)
205
215
  logger.error(e)
206
- # TODO: we could re-raise here and let the daemon die on any preservation error, or just log the issue and
207
- # move on to the next item.
208
- # rubocop:enable Lint/RescueException
209
216
  end
210
217
  end
211
218
 
@@ -47,12 +47,12 @@ module PushmiPullyu::Logging
47
47
  preservation_logger = Logger.new("#{PushmiPullyu.options[:logdir]}/preservation_events.log")
48
48
  preservation_json_logger = Logger.new("#{PushmiPullyu.options[:logdir]}/preservation_events.json")
49
49
 
50
- message = "#{deposited_file.name} was successfully deposited into Swift Storage!\n"\
51
- "Here are the details of this preservation event:\n"\
52
- "\tUUID: '#{deposited_file.name}'\n"\
53
- "\tTimestamp of Completion: '#{deposited_file.last_modified}'\n"\
54
- "\tAIP Checksum: '#{deposited_file.etag}'\n"\
55
- "\tMetadata: #{deposited_file.metadata}\n"\
50
+ message = "#{deposited_file.name} was successfully deposited into Swift Storage!\n" \
51
+ "Here are the details of this preservation event:\n" \
52
+ "\tUUID: '#{deposited_file.name}'\n" \
53
+ "\tTimestamp of Completion: '#{deposited_file.last_modified}'\n" \
54
+ "\tAIP Checksum: '#{deposited_file.etag}'\n" \
55
+ "\tMetadata: #{deposited_file.metadata}\n" \
56
56
 
57
57
  file_details = file_log_details(aip_directory)
58
58
 
@@ -155,7 +155,7 @@ module PushmiPullyu::Logging
155
155
  fileset_name: File.dirname(file).split('/')[-1],
156
156
  file_name: File.basename(file),
157
157
  file_size: File.size(file),
158
- file_extension: File.extname(file).strip.downcase[1..-1]
158
+ file_extension: File.extname(file).strip.downcase[1..]
159
159
  }
160
160
  end
161
161
  end
@@ -68,6 +68,12 @@ class PushmiPullyu::PreservationQueue
68
68
  end
69
69
  end
70
70
 
71
+ def add_entity_json(entity_json)
72
+ @redis.with do |connection|
73
+ connection.zadd @queue_name, Time.now.to_f, entity_json
74
+ end
75
+ end
76
+
71
77
  protected
72
78
 
73
79
  def connected?
@@ -1,3 +1,3 @@
1
1
  module PushmiPullyu
2
- VERSION = '2.0.3'.freeze
2
+ VERSION = '2.0.4'.freeze
3
3
  end
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ['lib']
21
21
 
22
- spec.required_ruby_version = '>= 2.5'
22
+ spec.required_ruby_version = '>= 2.7'
23
23
 
24
24
  spec.add_runtime_dependency 'activesupport', '>= 5', '< 8'
25
25
  spec.add_runtime_dependency 'bagit', '~> 0.4'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pushmi_pullyu
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Murnaghan
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2022-04-28 00:00:00.000000000 Z
12
+ date: 2022-11-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -409,6 +409,7 @@ files:
409
409
  - CHANGELOG.md
410
410
  - Dangerfile
411
411
  - Gemfile
412
+ - Gemfile.lock
412
413
  - LICENSE.txt
413
414
  - README.md
414
415
  - Rakefile
@@ -446,7 +447,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
446
447
  requirements:
447
448
  - - ">="
448
449
  - !ruby/object:Gem::Version
449
- version: '2.5'
450
+ version: '2.7'
450
451
  required_rubygems_version: !ruby/object:Gem::Requirement
451
452
  requirements:
452
453
  - - ">="