bitfab 0.18.0 → 0.20.0

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: 4401b0c7aa47516909e636557ab23f325fb0cbbd4ca8564f3d8864078e58f975
4
- data.tar.gz: 2b11fbfee500e0e03ec7b4b61772d623e2c236479965441b659aafbed4a687a6
3
+ metadata.gz: 9624757032370e1e318121cabcf2bfa984c7bcdcd07c9ecd5dcee449fef57a7c
4
+ data.tar.gz: c3925bbae804c16d21c3f373ec6cde4de340ee645fc6423505fc0b5d5f5e638e
5
5
  SHA512:
6
- metadata.gz: e720bb8dd79d572f4671b5f891cb1528dac2b610d2357d1f16ec5a7e04656fff0969f434e5e683be991d8745865bacbbe1e37993380e1a09d2cc9377e221eda5
7
- data.tar.gz: c197da185d7966cd9861213c49f0db4e3246a5eab0bdb70e800d8a4a5a4e8f174b5294d833511232555d43f0ca026a7988297fa3660743a8fef94b05b17a7ca9
6
+ metadata.gz: d2c33cd4a3432d79703685f00bb8c8278e2bebbd694b3a695f1dee646680a5af11370f233635f04590eeb0d5cedee850c496b40bee2fc176c34cf22fb721cde8
7
+ data.tar.gz: c64be06a07ca8ea807bca23e0f96acb15e1647945b33c3ea731f10c0b52759870b88637d86b680aee07caac7836e3818946f2fb85f0979d83b3ea89ef8ea1704
data/lib/bitfab/client.rb CHANGED
@@ -50,6 +50,8 @@ module Bitfab
50
50
  # each as { path:, before:, after: } (use "" for new/deleted files)
51
51
  # @param experiment_group_id [String, nil] optional UUID grouping multiple
52
52
  # replay runs into a single experiment batch
53
+ # @param dataset_id [String, nil] optional UUID of the dataset this replay
54
+ # runs against, stored on the resulting experiment for durable attribution
53
55
  # @param mock [String] mock strategy for child spans: "none" (default),
54
56
  # "all", or "marked". "all" mocks every child span; "marked" only mocks
55
57
  # spans declared with mock_on_replay: true.
@@ -59,12 +61,12 @@ module Bitfab
59
61
  # { trace_id:, source_span_id: }, and returns [new_args, new_kwargs].
60
62
  # @return [Hash] with :items, :test_run_id, :test_run_url
61
63
  def replay(receiver, method_name, trace_function_key:, limit: nil, trace_ids: nil, max_concurrency: 10,
62
- code_change_description: nil, code_change_files: nil, experiment_group_id: nil, mock: "none",
64
+ code_change_description: nil, code_change_files: nil, experiment_group_id: nil, dataset_id: nil, mock: "none",
63
65
  adapt_inputs: nil, environment: nil)
64
66
  Replay.run(
65
67
  self, receiver, method_name,
66
68
  trace_function_key:, limit:, trace_ids:, max_concurrency:,
67
- code_change_description:, code_change_files:, experiment_group_id:, mock:, adapt_inputs:, environment:
69
+ code_change_description:, code_change_files:, experiment_group_id:, dataset_id:, mock:, adapt_inputs:, environment:
68
70
  )
69
71
  end
70
72
 
@@ -106,8 +106,10 @@ module Bitfab
106
106
  # each as { path:, before:, after: } (use "" for new/deleted files)
107
107
  # @param experiment_group_id [String, nil] optional UUID grouping multiple
108
108
  # replay runs into a single experiment batch
109
+ # @param dataset_id [String, nil] optional UUID of the dataset this replay
110
+ # runs against, stored on the resulting experiment for durable attribution
109
111
  def start_replay(trace_function_key, limit, trace_ids: nil, code_change_description: nil,
110
- code_change_files: nil, experiment_group_id: nil, include_db_branch_lease: false)
112
+ code_change_files: nil, experiment_group_id: nil, include_db_branch_lease: false, dataset_id: nil)
111
113
  payload = {
112
114
  "traceFunctionKey" => trace_function_key
113
115
  }
@@ -119,6 +121,7 @@ module Bitfab
119
121
  payload["codeChangeFiles"] = normalize_code_change_files(code_change_files) unless code_change_files.nil?
120
122
  payload["experimentGroupId"] = experiment_group_id unless experiment_group_id.nil?
121
123
  payload["includeDbBranchLease"] = true if include_db_branch_lease
124
+ payload["datasetId"] = dataset_id unless dataset_id.nil?
122
125
 
123
126
  # When DB branching is on, the server resolves a Neon preview branch per
124
127
  # item (snapshot + restore + poll), which can run several seconds each.
data/lib/bitfab/replay.rb CHANGED
@@ -88,6 +88,8 @@ module Bitfab
88
88
  # each as { path:, before:, after: } (empty string for new/deleted files)
89
89
  # @param experiment_group_id [String, nil] optional UUID grouping multiple
90
90
  # replay runs into a single experiment batch
91
+ # @param dataset_id [String, nil] optional UUID of the dataset this replay
92
+ # runs against, stored on the resulting experiment for durable attribution
91
93
  # @param mock [String] mock strategy for child spans: "none" (default),
92
94
  # "all", or "marked". "all" mocks every child span; "marked" only mocks
93
95
  # spans declared with mock_on_replay: true.
@@ -99,7 +101,7 @@ module Bitfab
99
101
  # that item's :error rather than crashing the run.
100
102
  # @return [Hash] with :items, :test_run_id, :test_run_url
101
103
  def run(client, receiver, method_name, trace_function_key:, limit: nil, trace_ids: nil, max_concurrency: 10,
102
- code_change_description: nil, code_change_files: nil, experiment_group_id: nil, mock: "none",
104
+ code_change_description: nil, code_change_files: nil, experiment_group_id: nil, dataset_id: nil, mock: "none",
103
105
  adapt_inputs: nil, environment: nil)
104
106
  unless MOCK_STRATEGIES.include?(mock.to_s)
105
107
  raise ArgumentError, "Invalid mock strategy '#{mock}'. Must be one of: #{MOCK_STRATEGIES.join(", ")}"
@@ -130,7 +132,8 @@ module Bitfab
130
132
  code_change_description:,
131
133
  code_change_files:,
132
134
  experiment_group_id:,
133
- include_db_branch_lease:
135
+ include_db_branch_lease:,
136
+ dataset_id:
134
137
  )
135
138
  test_run_id = replay_data["testRunId"]
136
139
  test_run_url = replay_data["testRunUrl"]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bitfab
4
- VERSION = "0.18.0"
4
+ VERSION = "0.20.0"
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.18.0
4
+ version: 0.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harvest Team