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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 488dda33535eda47414a948c57ff554befb7a0658508c35a34087a65bc5094f2
4
- data.tar.gz: 4131b466f418780ea0cc44ff6d141a6ff7b4a16fcd780fcb468a6d4bd5e65c46
3
+ metadata.gz: '054905de819e592d260f623159ed33c50c6062e24a35f28005940005c45c8652'
4
+ data.tar.gz: fbf28893c51b904efc74fc2d880d375df4c2d8cd6af46b2421d554083e706a87
5
5
  SHA512:
6
- metadata.gz: 1edd6b9e75b7e8040ef046a91027eafa47eafea6a602feaa6e8416a8495aa3f247fcff9906635daf898d5d3939831ead3396a8bd36afc1f2a6f429974d88841f
7
- data.tar.gz: 787c103a564e9e14a57ffd737ed9693bd46f8dfab5d37b90e63236b6a13566b20c4bc3a757cba337820a9c59dd2b63ca2f2dff81ec8704f1e8de6fa95d23b847
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? && !result.fetch("assertions").empty?
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 active assertions matched this replay selection."
117
+ raise ArgumentError, "No traces with approved assertions matched this replay selection."
110
118
  end
111
119
  selected
112
120
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bitfab
4
- VERSION = "0.57.1"
4
+ VERSION = "0.57.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitfab
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.57.1
4
+ version: 0.57.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harvest Team