bitfab 0.57.4 → 0.57.5
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/assertions.rb +14 -0
- data/lib/bitfab/labels.rb +0 -8
- 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: 92165fa184665398bce1631ce854955ecac99ca5cf867e6c1215131eacf7e62d
|
|
4
|
+
data.tar.gz: 739e4b154e2997e2f891cf1f6f75f0122cf43f2a10b6c971813168dbde89be7a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2595c70d4012142a2cee13ccbce4b771559aa69c1a1dab51efa51ff7591345cdcf9ab92cbd1cbf00745782b046d61d71156245a01040db8034b30a01c7d94f40
|
|
7
|
+
data.tar.gz: 43b5a52ab9221eb70c55d13b4d3dcc0cb2934e083439ab75f89ad78a9f01ad8694266ce7132beca8ecaba1a8f129aeb29be963bdeeac74966dd8b669e73c53b9
|
data/lib/bitfab/assertions.rb
CHANGED
|
@@ -3,9 +3,23 @@
|
|
|
3
3
|
require "uri"
|
|
4
4
|
|
|
5
5
|
module Bitfab
|
|
6
|
+
class TraceAssertions
|
|
7
|
+
def initialize(http_client)
|
|
8
|
+
@http_client = http_client
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def get_assertion_evidence(assertion_id)
|
|
12
|
+
encoded_id = URI.encode_www_form_component(assertion_id).gsub("+", "%20")
|
|
13
|
+
@http_client.get("/api/sdk/traces/assertions/#{encoded_id}/evidence")["evidence"]
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
6
17
|
class Traces
|
|
18
|
+
attr_reader :assertions
|
|
19
|
+
|
|
7
20
|
def initialize(http_client)
|
|
8
21
|
@http_client = http_client
|
|
22
|
+
@assertions = TraceAssertions.new(http_client)
|
|
9
23
|
end
|
|
10
24
|
|
|
11
25
|
def get_assertions(trace_id)
|
data/lib/bitfab/labels.rb
CHANGED
|
@@ -6,7 +6,6 @@ module Bitfab
|
|
|
6
6
|
class Labels
|
|
7
7
|
LABELS_PATH = "/api/sdk/traces/labels"
|
|
8
8
|
HUMAN_LABELS_PATH = "#{LABELS_PATH}/human"
|
|
9
|
-
LABEL_EVIDENCE_PATH = "#{LABELS_PATH}/label-evidence"
|
|
10
9
|
EVIDENCE_UNSET = Object.new.freeze
|
|
11
10
|
|
|
12
11
|
private_constant :EVIDENCE_UNSET
|
|
@@ -65,13 +64,6 @@ module Bitfab
|
|
|
65
64
|
@http_client.get("#{LABELS_PATH}?#{query}")["labels"]
|
|
66
65
|
end
|
|
67
66
|
|
|
68
|
-
def get_label_evidence(trace_id, assertion_id: nil)
|
|
69
|
-
params = {"traceId" => trace_id}
|
|
70
|
-
params["assertionId"] = assertion_id unless assertion_id.nil?
|
|
71
|
-
query = URI.encode_www_form(params)
|
|
72
|
-
@http_client.get("#{LABEL_EVIDENCE_PATH}?#{query}")["evidence"]
|
|
73
|
-
end
|
|
74
|
-
|
|
75
67
|
private
|
|
76
68
|
|
|
77
69
|
def label_target(trace_id:, original_trace_id:, attempt:, assertion_id:)
|
data/lib/bitfab/version.rb
CHANGED