bitfab 0.64.21 → 0.64.23

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: 01e0c3dff10bb4315c2d7501e397c6e466679dd8a26ae99c98f682f7f91d0584
4
- data.tar.gz: 9135b87f009d87e024b567bbf795fb78f3ca2da88560eca0c8f4a81ca9054223
3
+ metadata.gz: ea8473d1108c410cab9e21e334b155b36be99ddf83207260dfa510815bb8dc64
4
+ data.tar.gz: f6ac0d40b0a6941ab06428882ac5a66a12ed2b0c4f9f83401f315cd2592dc8c3
5
5
  SHA512:
6
- metadata.gz: 8cf6468e184bcc18a6de04a739f55fcc4f35e31c8e95664ab5f054e6a260933ceaf6f3f8aea3478b0ac91756b16e84d69b6971b76549ce1152403ff3f37b6f5c
7
- data.tar.gz: 4fa5a6541e6f234ae28637aba7371c40a1dd80a1800e2d4113d4fda5a507d0652fe12650458a02557661d67d1161225f66ce483daee4d6ce988d068d5494429b
6
+ metadata.gz: f4acbd07a27cfdb78e158193580c937346d56bcc8bf9d3c5489c71be6ac4af55d25813c01e7d359091261634020bd7a6fc852a003e176c0d107191194acfc063
7
+ data.tar.gz: f0005a0fc2fa952f93b8488881dbb8e7806eae1b1fa86e81dc5656949d48e035374cb9bacec418ce39650af2b0f658d514745007e1ca398b3d353f9a1df1251a
data/lib/bitfab/client.rb CHANGED
@@ -137,7 +137,12 @@ module Bitfab
137
137
  # each as { path:, before:, after: } (use "" for new/deleted files).
138
138
  # Omit to capture automatically, or pass nil to suppress file capture.
139
139
  # @param experiment_group_id [String, nil] optional UUID grouping multiple
140
- # replay runs into a single experiment batch
140
+ # replay runs into a single experiment batch. The run joins that group,
141
+ # and an id no group has yet creates it
142
+ # @param experiment_group_name [String, nil] optional display name for the
143
+ # experiment group, applied when this replay creates the group or the group
144
+ # has no name yet. A group that already has a name keeps it. Requires
145
+ # experiment_group_id; passing it alone raises ArgumentError
141
146
  # @param dataset_ids [Array<String>, nil] optional UUIDs of the datasets this
142
147
  # replay runs against, for benchmarking one method against several corpora
143
148
  # in a single run; mutually exclusive with dataset_id. Passing trace_ids
@@ -196,7 +201,7 @@ module Bitfab
196
201
  # @return [Hash] with :items, :experiment_id, :experiment_url, and the
197
202
  # deprecated aliases :test_run_id and :test_run_url carrying the same values
198
203
  def replay(receiver, method_name = nil, trace_function_key:, limit: nil, trace_ids: nil, concurrency: nil, max_concurrency: ReplayConcurrency::UNSET,
199
- name: nil, notes: nil, metadata: nil, code_change_description: Replay::CODE_CHANGE_UNSET, code_change_files: Replay::CODE_CHANGE_UNSET, experiment_group_id: nil, dataset_id: nil, dataset_ids: nil, grader_ids: nil, mock: "marked", attempts: ReplayConcurrency::UNSET, only_with_assertions: false, skip_assertion_judging: false, judge_assertions: nil, dry_run: false,
204
+ name: nil, notes: nil, metadata: nil, code_change_description: Replay::CODE_CHANGE_UNSET, code_change_files: Replay::CODE_CHANGE_UNSET, experiment_group_id: nil, experiment_group_name: nil, dataset_id: nil, dataset_ids: nil, grader_ids: nil, mock: "marked", attempts: ReplayConcurrency::UNSET, only_with_assertions: false, skip_assertion_judging: false, judge_assertions: nil, dry_run: false,
200
205
  adapt_inputs: nil, mock_override: nil, db_branch: nil, on_item_start: nil, on_item_finish: nil, on_progress: nil,
201
206
  on_experiment_start: nil, experimental_selective_replay: nil)
202
207
  Replay.run(
@@ -219,6 +224,7 @@ module Bitfab
219
224
  code_change_description:,
220
225
  code_change_files:,
221
226
  experiment_group_id:,
227
+ experiment_group_name:,
222
228
  dataset_id:,
223
229
  dataset_ids:,
224
230
  grader_ids:,
@@ -254,6 +254,9 @@ module Bitfab
254
254
  # each as { path:, before:, after: } (use "" for new/deleted files)
255
255
  # @param experiment_group_id [String, nil] optional UUID grouping multiple
256
256
  # replay runs into a single experiment batch
257
+ # @param experiment_group_name [String, nil] optional display name for the
258
+ # experiment group, applied when this replay creates the group or the group
259
+ # has no name yet; only sent together with experiment_group_id
257
260
  # @param name [String, nil] optional display name for the resulting
258
261
  # experiment
259
262
  # @param dataset_ids [Array<String>, nil] optional UUIDs of the datasets this
@@ -266,7 +269,7 @@ module Bitfab
266
269
  # runnable graders at completion; each must be an active/live grader in the
267
270
  # same org and trace function or the server rejects the replay
268
271
  def start_replay(trace_function_key, limit, trace_ids: nil, code_change_description: nil,
269
- code_change_files: nil, experiment_group_id: nil, name: nil, notes: nil, metadata: nil, include_db_branch_lease: false, dataset_ids: nil,
272
+ code_change_files: nil, experiment_group_id: nil, experiment_group_name: nil, name: nil, notes: nil, metadata: nil, include_db_branch_lease: false, dataset_ids: nil,
270
273
  grader_ids: nil, db_branch_settings: nil, attempts: 1, only_with_assertions: false, skip_assertion_judging: false, include_original_metadata: false, experimental_selective_replay: nil, dry_run: false, invocation: nil)
271
274
  payload = {
272
275
  "traceFunctionKey" => trace_function_key
@@ -281,6 +284,7 @@ module Bitfab
281
284
  payload["codeChangeDescription"] = code_change_description unless code_change_description.nil?
282
285
  payload["codeChangeFiles"] = normalize_code_change_files(code_change_files) unless code_change_files.nil?
283
286
  payload["experimentGroupId"] = experiment_group_id unless experiment_group_id.nil?
287
+ payload["experimentGroupName"] = experiment_group_name unless experiment_group_name.nil?
284
288
  payload["includeDbBranchLease"] = true if include_db_branch_lease
285
289
  payload["lazyDbBranchLease"] = true if include_db_branch_lease
286
290
  unless dataset_ids.nil?
data/lib/bitfab/replay.rb CHANGED
@@ -235,7 +235,12 @@ module Bitfab
235
235
  # each as { path:, before:, after: } (empty string for new/deleted files).
236
236
  # Omit to capture automatically, or pass nil to suppress file capture.
237
237
  # @param experiment_group_id [String, nil] optional UUID grouping multiple
238
- # replay runs into a single experiment batch
238
+ # replay runs into a single experiment batch. The run joins that group,
239
+ # and an id no group has yet creates it
240
+ # @param experiment_group_name [String, nil] optional display name for the
241
+ # experiment group, applied when this replay creates the group or the group
242
+ # has no name yet. A group that already has a name keeps it. Requires
243
+ # experiment_group_id; passing it alone raises ArgumentError
239
244
  # @param dataset_id [String, nil] optional UUID of the dataset this replay
240
245
  # runs against, stored on the resulting experiment for durable attribution;
241
246
  # mutually exclusive with dataset_ids. Alone it replays the dataset's full
@@ -295,7 +300,7 @@ module Bitfab
295
300
  # The experiment fields are nil for a dry run, which creates no experiment,
296
301
  # and progress events then carry a nil :experiment_id too.
297
302
  def run(client, receiver, method_name, trace_function_key:, limit: nil, trace_ids: nil, name: nil, notes: nil, metadata: nil,
298
- concurrency: nil, max_concurrency: ReplayConcurrency::UNSET, code_change_description: CODE_CHANGE_UNSET, code_change_files: CODE_CHANGE_UNSET, experiment_group_id: nil,
303
+ concurrency: nil, max_concurrency: ReplayConcurrency::UNSET, code_change_description: CODE_CHANGE_UNSET, code_change_files: CODE_CHANGE_UNSET, experiment_group_id: nil, experiment_group_name: nil,
299
304
  dataset_id: nil, dataset_ids: nil, grader_ids: nil, mock: "marked", attempts: ReplayConcurrency::UNSET, only_with_assertions: false, skip_assertion_judging: false, judge_assertions: nil, dry_run: false,
300
305
  adapt_inputs: nil, mock_override: nil, db_branch: nil, on_item_start: nil, on_item_finish: nil, on_progress: nil,
301
306
  on_experiment_start: nil, experimental_selective_replay: nil)
@@ -319,6 +324,9 @@ module Bitfab
319
324
  unless attempts.is_a?(Integer) && attempts.between?(1, 100)
320
325
  raise ArgumentError, "attempts must be an integer from 1 to 100."
321
326
  end
327
+ if experiment_group_name && experiment_group_id.nil?
328
+ raise ArgumentError, "experiment_group_name only applies with experiment_group_id. Pass it together with experiment_group_id."
329
+ end
322
330
  item_finish_callback = on_item_finish || on_progress
323
331
  if trace_ids
324
332
  raise ArgumentError, "trace_ids must contain at least one trace ID." if trace_ids.empty?
@@ -398,6 +406,7 @@ module Bitfab
398
406
  code_change_description:,
399
407
  code_change_files:,
400
408
  experiment_group_id:,
409
+ experiment_group_name:,
401
410
  include_db_branch_lease:,
402
411
  dataset_ids: resolved_dataset_ids,
403
412
  grader_ids:,
@@ -20,7 +20,7 @@ module Bitfab
20
20
  class ReplayRegistry
21
21
  OPTION_NAMES = %i[
22
22
  limit trace_ids name notes metadata concurrency max_concurrency code_change_description
23
- code_change_files experiment_group_id dataset_id dataset_ids grader_ids mock
23
+ code_change_files experiment_group_id experiment_group_name dataset_id dataset_ids grader_ids mock
24
24
  mock_override adapt_inputs db_branch attempts only_with_assertions skip_assertion_judging judge_assertions dry_run on_item_finish
25
25
  ].freeze
26
26
 
@@ -190,7 +190,7 @@ module Bitfab
190
190
  options[:limit] = bound || 10
191
191
  end
192
192
 
193
- %i[name notes metadata max_concurrency experiment_group_id dataset_ids grader_ids mock attempts only_with_assertions skip_assertion_judging dry_run].each do |key|
193
+ %i[name notes metadata max_concurrency experiment_group_id experiment_group_name dataset_ids grader_ids mock attempts only_with_assertions skip_assertion_judging dry_run].each do |key|
194
194
  options[key] = args[key] unless args[key].nil?
195
195
  end
196
196
 
@@ -339,7 +339,11 @@ module Bitfab
339
339
  args[:max_concurrency] = positive_integer("--max-concurrency", value)
340
340
  end
341
341
  options.on("--code-change PATH") { |value| args[:code_change] = value }
342
- options.on("--experiment-group-id UUID") { |value| args[:experiment_group_id] = value }
342
+ options.on("--experiment-group-id UUID",
343
+ "Add this run to an experiment group. A UUID no group has yet creates the group.") { |value| args[:experiment_group_id] = value }
344
+ options.on("--experiment-group-name NAME",
345
+ "Name the experiment group when this run creates it or it has no name yet. " \
346
+ "A group that already has a name keeps it. Requires --experiment-group-id.") { |value| args[:experiment_group_name] = value }
343
347
  options.on("--dataset-ids IDS", "--dataset-id IDS") { |value| args[:dataset_ids] = comma_separated("--dataset-ids", value) }
344
348
  options.on("--grader-ids IDS") { |value| args[:grader_ids] = comma_separated("--grader-ids", value) }
345
349
  options.on("--attempts N", Integer) { |value| args[:attempts] = positive_integer("--attempts", value) }
data/lib/bitfab/traces.rb CHANGED
@@ -7,11 +7,15 @@ module Bitfab
7
7
  @http_client = http_client
8
8
  end
9
9
 
10
- def search(caller_metadata: nil, name: nil, name_contains: nil, trace_function_key: nil, cursor: nil, limit: nil)
10
+ # Search traces by caller metadata, name, or experiment. experiment_id
11
+ # returns only the replay traces that experiment produced. Each result
12
+ # carries "durationMs" and "tokens", either of which is nil when not recorded.
13
+ def search(caller_metadata: nil, name: nil, name_contains: nil, experiment_id: nil, trace_function_key: nil, cursor: nil, limit: nil)
11
14
  payload = {}
12
15
  payload["callerMetadata"] = caller_metadata unless caller_metadata.nil?
13
16
  payload["name"] = name unless name.nil?
14
17
  payload["nameContains"] = name_contains unless name_contains.nil?
18
+ payload["experimentId"] = experiment_id unless experiment_id.nil?
15
19
  payload["traceFunctionKey"] = trace_function_key unless trace_function_key.nil?
16
20
  payload["cursor"] = cursor unless cursor.nil?
17
21
  payload["limit"] = limit unless limit.nil?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bitfab
4
- VERSION = "0.64.21"
4
+ VERSION = "0.64.23"
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.64.21
4
+ version: 0.64.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harvest Team