gitlab-labkit 0.41.0 → 0.41.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d9f3f7db908df4f839a96f74ce39650dad4a132e5b72e3ac4d7fb1358bc48f1
|
4
|
+
data.tar.gz: 125b63a4f1716bfbb8dca8ab986c5f824dd2a56f8df46079041c6c62f5e385e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92907d96e457abebe07567df0506f80c585f159ead4b78b6bdf8c57b3eb82d19c7700b88d2733415dad5c0d3bba792c23ae9b1e2281df9fef6ec44b7069d453c
|
7
|
+
data.tar.gz: 678ab5ad3290e93ff0682ef1f5f08681ea85e01c65919c3c16f21c95949065fa70c20507499b20c2c72f1a856838650fe79963533b529a463d9fc5a6f99a3bfc
|
data/.copier-answers.yml
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
# See the project for instructions on how to update the project
|
4
4
|
#
|
5
5
|
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
|
6
|
-
_commit: v1.
|
6
|
+
_commit: v1.36.0
|
7
7
|
_src_path: https://gitlab.com/gitlab-com/gl-infra/common-template-copier.git
|
8
8
|
ee_licensed: false
|
9
9
|
golang: false
|
data/.tool-versions
CHANGED
@@ -149,7 +149,7 @@ experience.checkpoint
|
|
149
149
|
experience.complete
|
150
150
|
```
|
151
151
|
|
152
|
-
**Note:** The `resume` method loads the start time from the Labkit context. If no covered experience data exists in the context, it behaves the same as calling methods on an unstarted experience
|
152
|
+
**Note:** The `resume` method loads the start time from the Labkit context. If no covered experience data exists in the context, it behaves the same as calling methods on an unstarted experience and safely ignores the operation.
|
153
153
|
|
154
154
|
### Error Handling
|
155
155
|
|
@@ -182,4 +182,4 @@ end
|
|
182
182
|
|
183
183
|
- In `development` and `test` environments, accessing a non-existent covered experience will raise a `NotFoundError`
|
184
184
|
- In other environments, a null object is returned that safely ignores all method calls
|
185
|
-
- Attempting to checkpoint or complete an unstarted experience will
|
185
|
+
- Attempting to checkpoint or complete an unstarted experience will safely ignore the operation
|
@@ -3,8 +3,6 @@
|
|
3
3
|
module Labkit
|
4
4
|
module CoveredExperience
|
5
5
|
CoveredExperienceError = Class.new(StandardError)
|
6
|
-
UnstartedError = Class.new(CoveredExperienceError)
|
7
|
-
CompletedError = Class.new(CoveredExperienceError)
|
8
6
|
NotFoundError = Class.new(CoveredExperienceError)
|
9
7
|
ReservedKeywordError = Class.new(CoveredExperienceError)
|
10
8
|
end
|
@@ -90,7 +90,6 @@ module Labkit
|
|
90
90
|
# Checkpoint the Covered Experience.
|
91
91
|
#
|
92
92
|
# @param extra [Hash] Additional data to include in the log event
|
93
|
-
# @raise [UnstartedError] If the experience has not been started and RAILS_ENV is development or test.
|
94
93
|
# @return [self]
|
95
94
|
def checkpoint(**extra)
|
96
95
|
return unless ensure_started!
|
@@ -119,7 +118,6 @@ module Labkit
|
|
119
118
|
# Complete the Covered Experience.
|
120
119
|
#
|
121
120
|
# @param extra [Hash] Additional data to include in the log event
|
122
|
-
# @raise [UnstartedError] If the experience has not been started and RAILS_ENV is development or test.
|
123
121
|
# @return [self]
|
124
122
|
def complete(**extra)
|
125
123
|
return unless ensure_started!
|
@@ -166,10 +164,8 @@ module Labkit
|
|
166
164
|
def ensure_started!
|
167
165
|
return @start_time unless @start_time.nil?
|
168
166
|
|
169
|
-
|
170
|
-
|
171
|
-
warn(err)
|
172
|
-
raise(err) if %w[development test].include?(ENV['RAILS_ENV'])
|
167
|
+
warn("Covered Experience #{@definition.covered_experience} not started")
|
168
|
+
false
|
173
169
|
end
|
174
170
|
|
175
171
|
def completable(**extra, &)
|
@@ -188,10 +184,8 @@ module Labkit
|
|
188
184
|
def ensure_incomplete!
|
189
185
|
return true if @end_time.nil?
|
190
186
|
|
191
|
-
|
192
|
-
|
193
|
-
warn(err)
|
194
|
-
raise(err) if %w[development test].include?(ENV['RAILS_ENV'])
|
187
|
+
warn("Covered Experience #{@definition.covered_experience} already completed")
|
188
|
+
false
|
195
189
|
end
|
196
190
|
|
197
191
|
def urgency_threshold
|
@@ -199,6 +193,8 @@ module Labkit
|
|
199
193
|
end
|
200
194
|
|
201
195
|
def elapsed_time
|
196
|
+
return 0 unless @start_time
|
197
|
+
|
202
198
|
last_time = @end_time || @checkpoint_time || @start_time
|
203
199
|
last_time - @start_time
|
204
200
|
end
|