bitfab 0.57.1 → 0.57.2
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 +4 -4
- data/lib/bitfab/replay_registry.rb +10 -2
- data/lib/bitfab/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '054905de819e592d260f623159ed33c50c6062e24a35f28005940005c45c8652'
|
|
4
|
+
data.tar.gz: fbf28893c51b904efc74fc2d880d375df4c2d8cd6af46b2421d554083e706a87
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0d5dfb24ef74d933781ad9b6f8d445583dceffcfe0eaf5189b9ba2ec2405b5ef4b108ed828ea8fbb42c66f3bd3e82d171f88d873bb77ae99640185fcbbacf01c
|
|
7
|
+
data.tar.gz: f5509659a2e3f8d8df265d3abba09b106f6553bce8b7d1d9c4227d43c10f58ad74b01400f102e6140d2b37d6a8f518217a11a5914269b7a1a1de779489e0bcf0
|
|
@@ -91,6 +91,14 @@ module Bitfab
|
|
|
91
91
|
|
|
92
92
|
module_function
|
|
93
93
|
|
|
94
|
+
# get_assertions returns every state so a reviewer can see drafts, but only an
|
|
95
|
+
# approved assertion is checked on a replay, so narrowing on anything else
|
|
96
|
+
# would pick traces the run cannot be judged against. The server applies the
|
|
97
|
+
# same rule when it revalidates the selection.
|
|
98
|
+
def approved_assertion?(assertions)
|
|
99
|
+
assertions.any? { |assertion| assertion["approvalState"] == "approved" }
|
|
100
|
+
end
|
|
101
|
+
|
|
94
102
|
def bound_trace_ids(client, trace_ids, limit, only_with_assertions)
|
|
95
103
|
unless limit.is_a?(Integer) && limit.positive?
|
|
96
104
|
raise ArgumentError, "Replay limit must be a positive integer."
|
|
@@ -100,13 +108,13 @@ module Bitfab
|
|
|
100
108
|
selected = []
|
|
101
109
|
trace_ids.each do |trace_id|
|
|
102
110
|
result = client.traces.get_assertions(trace_id)
|
|
103
|
-
if result.fetch("inheritedFrom").nil? &&
|
|
111
|
+
if result.fetch("inheritedFrom").nil? && approved_assertion?(result.fetch("assertions"))
|
|
104
112
|
selected << trace_id
|
|
105
113
|
break if selected.length == limit
|
|
106
114
|
end
|
|
107
115
|
end
|
|
108
116
|
if selected.empty?
|
|
109
|
-
raise ArgumentError, "No traces with
|
|
117
|
+
raise ArgumentError, "No traces with approved assertions matched this replay selection."
|
|
110
118
|
end
|
|
111
119
|
selected
|
|
112
120
|
end
|
data/lib/bitfab/version.rb
CHANGED