pushmi_pullyu 2.1.0 → 2.1.1

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: da4560ad8303a06ea455d4da2915bd9be6a98edb70a8ee91bc12cb25d977f3b5
4
- data.tar.gz: db98dc991f3149b0d217f6ae61f9c07c34ecc8ab7c878d4e60ecdbc08aed95bd
3
+ metadata.gz: b4380518d529c79ac7972e3ab29dee3524082df9e66a3f0f1e3eefbb5c08855d
4
+ data.tar.gz: c43b7f5a944ceb4fafa298ebbb7ec47725a8bbff04a8b04ea51874b6bacc2ba6
5
5
  SHA512:
6
- metadata.gz: 5d565b6ecf4fcd0cab2690f04aaf619dc70d83848a8fc48960de393fac94b83ff18f9751528dbbb184c4f411d270113ec90c807146c8c14e35010c8a40434734
7
- data.tar.gz: 478f4047534baaf2931733f0f48d199dd51088262e0076f5b52ad1f63f74fb5fee6dc5265ec8c8b5064f8b87d1ecaebf94513a5d9ecf299c3455df4526fbc9cb
6
+ metadata.gz: 0c7e9b00f0e8a6727393da41e9060dff06a6b8aba0baf9f7ed84bbc89e17e0988e1858a8c0bd925983ccda379e249374af0c738be976ec21708a3cf6be35b20e
7
+ data.tar.gz: 6ed33393e60e371ea74b9eba143ff3ce3f6ddac81954ddf944d68f3d75087f2adc777ac4f8a8db4037c20131201ec0f1325a90d465b3cd06be6fa04a878a728d
data/CHANGELOG.md CHANGED
@@ -6,6 +6,9 @@ PushmiPullyu is a Ruby application, whose primary job is to manage the flow of c
6
6
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
7
7
  and releases in PushmiPullyu adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
8
8
 
9
+ ## [2.1.1]
10
+ - Increase clarity of log files [#433](https://github.com/ualbertalib/pushmi_pullyu/issues/433)
11
+
9
12
  ## [2.1.0]
10
13
  - Add more logging information [#433](https://github.com/ualbertalib/pushmi_pullyu/issues/433)
11
14
  - Add V3 authentication [#349](https://github.com/ualbertalib/pushmi_pullyu/issues/349)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pushmi_pullyu (2.1.0)
4
+ pushmi_pullyu (2.1.1)
5
5
  activesupport (>= 5, < 8)
6
6
  bagit (~> 0.4)
7
7
  connection_pool (~> 2.2)
@@ -214,7 +214,7 @@ class PushmiPullyu::CLI
214
214
  # Push tarred AIP to swift API
215
215
  deposited_file = swift.deposit_file(aip_filename, options[:swift][:container])
216
216
  # Log successful preservation event to the log files
217
- PushmiPullyu::Logging.log_preservation_success(deposited_file, aip_directory)
217
+ PushmiPullyu::Logging.log_preservation_success(entity, deposited_file, aip_directory)
218
218
  end
219
219
  # An EntityInvalid expection means there is a problem with the entity information format so there is no point in
220
220
  # readding it to the queue as it will always fail
@@ -52,7 +52,7 @@ module PushmiPullyu::Logging
52
52
  @preservation_json_logger.info("#{message_json},")
53
53
  end
54
54
 
55
- def log_preservation_success(deposited_file, aip_directory)
55
+ def log_preservation_success(entity, deposited_file, aip_directory)
56
56
  message = "#{deposited_file.name} was successfully deposited into Swift Storage!\n" \
57
57
  "Here are the details of this preservation event:\n" \
58
58
  "\tUUID: '#{deposited_file.name}'\n" \
@@ -74,14 +74,24 @@ module PushmiPullyu::Logging
74
74
  end
75
75
  end
76
76
 
77
- log_preservation_event(message, preservation_success_to_json(deposited_file, aip_directory))
77
+ message_information = {
78
+ event_type: :success,
79
+ event_time: Time.now.to_s,
80
+ entity_type: entity[:type],
81
+ entity_uuid: entity[:uuid],
82
+ event_details: preservation_success_to_json(deposited_file, aip_directory)
83
+ }
84
+
85
+ log_preservation_event(message, message_information.to_json)
78
86
  end
79
87
 
80
- def log_preservation_fail_and_retry(entity, retry_attempt, exception)
88
+ def log_preservation_fail_and_retry(entity, try_attempt, exception)
89
+ # We add + 1 to try_attempt because humans like to start counting from 1
90
+ try_attempt += 1
81
91
  message = "#{entity[:type]} failed to be deposited and will try again.\n" \
82
92
  "Here are the details of this preservation event:\n" \
83
93
  "\t#{entity[:type]} uuid: #{entity[:uuid]}" \
84
- "\tReadding to preservation queue with retry attempt: #{retry_attempt}\n" \
94
+ "\tReadding to preservation queue with try attempt: #{try_attempt}\n" \
85
95
  "\tError of type: #{exception.class.name}\n" \
86
96
  "\tError message: #{exception.message}\n"
87
97
 
@@ -90,43 +100,47 @@ module PushmiPullyu::Logging
90
100
  event_time: Time.now.to_s,
91
101
  entity_type: entity[:type],
92
102
  entity_uuid: entity[:uuid],
93
- retry_attempt: retry_attempt,
103
+ try_attempt: try_attempt,
94
104
  error_message: exception.message
95
105
  }
96
106
 
97
107
  log_preservation_event(message, message_information.to_json)
98
108
  end
99
109
 
100
- def log_preservation_failure(entity, retry_attempt, exception)
110
+ def log_preservation_failure(entity, try_attempt, exception)
111
+ # We add + 1 to try_attempt because humans like to start counting from 1
112
+ try_attempt += 1
101
113
  message = "#{entity[:type]} failed to be deposited.\n" \
102
114
  "Here are the details of this preservation event:\n" \
103
115
  "\t#{entity[:type]} uuid: #{entity[:uuid]}" \
104
- "\tRetry attempt: #{retry_attempt}\n"
116
+ "\tTry attempt: #{try_attempt}\n"
105
117
 
106
118
  message_information = {
107
- event_type: :fail_and_retry,
119
+ event_type: :failure,
108
120
  event_time: Time.now.to_s,
109
121
  entity_type: entity[:type],
110
122
  entity_uuid: entity[:uuid],
111
- retry_attempt: retry_attempt,
123
+ try_attempt: try_attempt,
112
124
  error_message: exception.message
113
125
  }
114
126
 
115
127
  log_preservation_event(message, message_information.to_json)
116
128
  end
117
129
 
118
- def log_preservation_attempt(entity, retry_attempt)
130
+ def log_preservation_attempt(entity, try_attempt)
131
+ # We add + 1 to try_attempt because humans like to start counting from 1
132
+ try_attempt += 1
119
133
  message = "#{entity[:type]} will attempt to be deposited.\n" \
120
134
  "Here are the details of this preservation event:\n" \
121
135
  "\t#{entity[:type]} uuid: #{entity[:uuid]}" \
122
- "\tRetry attempt: #{retry_attempt}\n"
136
+ "\tTry attempt: #{try_attempt}\n"
123
137
 
124
138
  message_information = {
125
139
  event_type: :attempt,
126
140
  event_time: Time.now.to_s,
127
141
  entity_type: entity[:type],
128
142
  entity_uuid: entity[:uuid],
129
- retry_attempt: retry_attempt
143
+ try_attempt: try_attempt
130
144
  }
131
145
 
132
146
  log_preservation_event(message, message_information.to_json)
@@ -184,7 +198,7 @@ module PushmiPullyu::Logging
184
198
  end
185
199
 
186
200
  message['aip_file_details'] = tmp_details
187
- message.to_json
201
+ message
188
202
  end
189
203
 
190
204
  def reopen
@@ -73,7 +73,7 @@ class PushmiPullyu::PreservationQueue
73
73
  def get_entity_ingestion_attempt(entity)
74
74
  entity_attempts_key = "#{PushmiPullyu.options[:ingestion_prefix]}#{entity[:uuid]}"
75
75
  @redis.with do |connection|
76
- return connection.get entity_attempts_key
76
+ return connection.get(entity_attempts_key).to_i
77
77
  end
78
78
  end
79
79
 
@@ -1,3 +1,3 @@
1
1
  module PushmiPullyu
2
- VERSION = '2.1.0'.freeze
2
+ VERSION = '2.1.1'.freeze
3
3
  end
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.1.0
4
+ version: 2.1.1
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: 2024-05-27 00:00:00.000000000 Z
12
+ date: 2024-06-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -294,7 +294,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
294
294
  - !ruby/object:Gem::Version
295
295
  version: '0'
296
296
  requirements: []
297
- rubygems_version: 3.3.26
297
+ rubygems_version: 3.1.6
298
298
  signing_key:
299
299
  specification_version: 4
300
300
  summary: Ruby application to manage flow of content from Jupiter into Swift for preservation