bitfab 0.36.1 → 0.36.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: e0b827ad6e9bca08b3025f9c2419290910999a5985705369e6375aee8091232c
4
- data.tar.gz: e6e0a414013d3bee0efda22415430d9690fe537973a36e5f3dda540fcda3d5e4
3
+ metadata.gz: 44af81a548095fe4bf8a347b6e58bb1c3bdcf2726becd78f029ec5c7c9507ca9
4
+ data.tar.gz: 4a00a95452cf45e5992e7eee4754850923eed8767713368a063fa1fed84d4b7c
5
5
  SHA512:
6
- metadata.gz: ee72cf5ed5c81ad34dbd4d980091523c90c7cb1d11fc716499ab5f604f1829f5653851350942b2cea6660e20e67c065ae8807e0778153a0ccf08a1397cc08491
7
- data.tar.gz: 297efa6c3e5d9b1086536dd5e560168e9f9d4c638638b562a67d69ccb1c37253534da6447778032f93e186532f0a563eb7b7f41148eb6b9e0e2ac91c4ed2196e
6
+ metadata.gz: 9043c05ffb79c8830299127c39de0dc77b77dc3fa1fd2a573813696bcd9a7ba3fa95d7a06a7371ff596ed04781f439311f773bdff24afe055b252b36e0d36bb5
7
+ data.tar.gz: d73327657254114a22c091bb58503c17f1f8d0fcc19f0179c283b452df4c7240d446ff8d36962b16fcc47ea13e0315c80f554280b79f47b684f24ba50b11ce23
@@ -181,9 +181,11 @@ module Bitfab
181
181
  request("/api/sdk/replay/start", payload, timeout:)
182
182
  end
183
183
 
184
- # Fetch an external span by ID. Blocking GET request.
185
- def get_external_span(span_id)
186
- get("/api/sdk/externalSpans/#{span_id}", timeout: 30)
184
+ # Fetch an external span by ID. Blocking GET request. The replay view keeps
185
+ # only the input/output serialization fields used by replay.
186
+ def get_external_span(span_id, replay_view: false)
187
+ query = replay_view ? "?view=replay" : ""
188
+ get("/api/sdk/externalSpans/#{span_id}#{query}", timeout: 30)
187
189
  end
188
190
 
189
191
  def get_trace_span(trace_id, id: nil, name: nil, occurrence: "last")
@@ -210,9 +212,12 @@ module Bitfab
210
212
  # payloads so only the spans actually mocked are fetched later (by
211
213
  # externalSpanId), avoiding dragging down every span's output when only a
212
214
  # few are mocked.
213
- def get_span_tree(external_span_id, include_outputs: true)
215
+ def get_span_tree(external_span_id, include_outputs: true, include_root_output: true)
214
216
  endpoint = "/api/sdk/replay/spanTree/#{external_span_id}"
215
- endpoint += "?includeOutputs=false" unless include_outputs
217
+ query = []
218
+ query << "includeOutputs=false" unless include_outputs
219
+ query << "includeRootOutput=false" unless include_root_output
220
+ endpoint += "?#{query.join("&")}" unless query.empty?
216
221
  get(endpoint, timeout: 30)
217
222
  end
218
223
 
data/lib/bitfab/replay.rb CHANGED
@@ -676,7 +676,7 @@ module Bitfab
676
676
  "produce a result that looks valid but did not use the historical data you asked for."
677
677
  end
678
678
 
679
- span = http_client.get_external_span(original_span_id)
679
+ span = http_client.get_external_span(original_span_id, replay_view: true)
680
680
  item_data = extract_span_data(span)
681
681
 
682
682
  # Fetch the span tree when the base strategy needs recorded outputs
@@ -694,7 +694,11 @@ module Bitfab
694
694
  mock_tree = nil
695
695
  if mock_strategy == "all" || mock_strategy == "marked" || overrides_present
696
696
  begin
697
- tree = http_client.get_span_tree(original_span_id, include_outputs:)
697
+ tree = http_client.get_span_tree(
698
+ original_span_id,
699
+ include_outputs:,
700
+ include_root_output: false
701
+ )
698
702
  mock_tree = build_mock_tree(tree["root"] || {})
699
703
  rescue Exception => e # rubocop:disable Lint/RescueException
700
704
  raise if e.is_a?(SystemExit) || e.is_a?(SignalException)
@@ -843,7 +847,7 @@ module Bitfab
843
847
  lambda do |external_span_id|
844
848
  return cache[external_span_id] if cache.key?(external_span_id)
845
849
 
846
- span = http_client.get_external_span(external_span_id)
850
+ span = http_client.get_external_span(external_span_id, replay_view: true)
847
851
  span_data = (span["rawData"] || {})["span_data"] || {}
848
852
  # Prefer the Ruby Marshal payload (output_serialized) written by this
849
853
  # SDK; fall back to another SDK's output_meta, then the raw JSON output.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bitfab
4
- VERSION = "0.36.1"
4
+ VERSION = "0.36.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.36.1
4
+ version: 0.36.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harvest Team