bitfab 0.63.1 → 0.63.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: be8f745cae80e29bbcb5fc07bfd46cab706d3f6420e1391b39ccd8f297898711
4
- data.tar.gz: 383d4f086eb11f5344444bb7506e37d5b5928f679dd4e9daa2b25a5db30780d5
3
+ metadata.gz: dc609d9aaa9ba7366c855624027df97620baf1309fc38192316305e94e7de4e5
4
+ data.tar.gz: 2562479d249da81b28b80a8bb176438ac60bdf6c82135f348afb252e09c005a7
5
5
  SHA512:
6
- metadata.gz: 490e9932572e7e0f6521a3ac855eb1f659c6f00349ebc8c174e35eee062a3dff784c52c1ae77f4ae93be2ad1f6f9fd644ada7391dc4fba46b7089aaf2f8291e1
7
- data.tar.gz: de98876f6c6b229c7edc8281adbb5a071b00fcf95d77a2b17620fbee2fa6891a588aed3ae8d773702c23aa239bca92416b00c059ba496e78be3fdd6980b29d16
6
+ metadata.gz: 4df6fafa2a4ae84186457257339cbdabeb88c43713147541aa4b66b4ccc6888f39822f92ee3e11662f70800892066907c9904f61f03ec8c1c1206ee717f5d3bf
7
+ data.tar.gz: 9137bc781a7d3f87b8c4f575ddc90a9bf369d1b7c84657c32f038fd12e6bcffb4d33fd95dda28cb6b0f551fc74bb5d3bb627df7a57116ec88a31c8060b459793
@@ -262,7 +262,7 @@ module Bitfab
262
262
  # same org and trace function or the server rejects the replay
263
263
  def start_replay(trace_function_key, limit, trace_ids: nil, code_change_description: nil,
264
264
  code_change_files: nil, experiment_group_id: nil, name: nil, notes: nil, metadata: nil, include_db_branch_lease: false, dataset_ids: nil,
265
- 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)
265
+ 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)
266
266
  payload = {
267
267
  "traceFunctionKey" => trace_function_key
268
268
  }
@@ -289,6 +289,7 @@ module Bitfab
289
289
  payload["attempts"] = attempts if attempts > 1
290
290
  payload["onlyWithAssertions"] = true if only_with_assertions
291
291
  payload["judgeAssertions"] = true unless skip_assertion_judging
292
+ payload["dryRun"] = true if dry_run
292
293
  payload["includeOriginalMetadata"] = true if include_original_metadata
293
294
  payload["experimentalSelectiveReplay"] = experimental_selective_replay if experimental_selective_replay
294
295
  payload["dbBranchSettings"] = db_branch_settings unless db_branch_settings.nil?
data/lib/bitfab/replay.rb CHANGED
@@ -279,9 +279,11 @@ module Bitfab
279
279
  # right after the server creates the experiment and before any item runs,
280
280
  # with a hash { experiment_id:, experiment_url: }. Use it to show the
281
281
  # experiment link even if the run later fails. A raising callback never
282
- # crashes the run.
282
+ # crashes the run. Not called for a dry run, which creates no experiment.
283
283
  # @return [Hash] with :items, :experiment_id, :experiment_url, and the
284
- # deprecated aliases :test_run_id and :test_run_url carrying the same values
284
+ # deprecated aliases :test_run_id and :test_run_url carrying the same values.
285
+ # The experiment fields are nil for a dry run, which creates no experiment,
286
+ # and progress events then carry a nil :experiment_id too.
285
287
  def run(client, receiver, method_name, trace_function_key:, limit: nil, trace_ids: nil, name: nil, notes: nil, metadata: nil,
286
288
  concurrency: nil, max_concurrency: ReplayConcurrency::UNSET, code_change_description: CODE_CHANGE_UNSET, code_change_files: CODE_CHANGE_UNSET, experiment_group_id: nil,
287
289
  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,
@@ -393,12 +395,14 @@ module Bitfab
393
395
  skip_assertion_judging:,
394
396
  include_original_metadata: !adapt_inputs.nil?,
395
397
  db_branch_settings: resolved_db_branch_settings,
398
+ dry_run:,
396
399
  **(experimental_selective_replay ? {experimental_selective_replay: SelectiveReplay.wire_options(experimental_selective_replay)} : {})
397
400
  )
398
401
  experiment_id = replay_data["experimentId"] || replay_data["testRunId"]
399
402
  experiment_url = replay_data["experimentUrl"] || replay_data["testRunUrl"]
400
- full_experiment_url = "#{client.service_url}#{experiment_url}"
401
- if on_experiment_start
403
+ # Nil for a dry run: current servers create no experiment for one.
404
+ full_experiment_url = experiment_url && "#{client.service_url}#{experiment_url}"
405
+ if on_experiment_start && experiment_id
402
406
  begin
403
407
  on_experiment_start.call({experiment_id:, experiment_url: full_experiment_url})
404
408
  rescue => e
@@ -426,10 +430,14 @@ module Bitfab
426
430
  end
427
431
 
428
432
  if dry_run
429
- begin
430
- http_client.complete_replay(experiment_id)
431
- rescue => e
432
- warn "Bitfab: could not finalize dry run: #{e.message}"
433
+ # An older server still creates an experiment for a dry run; finalize it
434
+ # so it does not sit unfinished in the experiments list.
435
+ if experiment_id
436
+ begin
437
+ http_client.complete_replay(experiment_id)
438
+ rescue => e
439
+ warn "Bitfab: could not finalize dry run: #{e.message}"
440
+ end
433
441
  end
434
442
  result = {
435
443
  items: public_replay_items(result_items), experiment_id:, experiment_url: full_experiment_url,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bitfab
4
- VERSION = "0.63.1"
4
+ VERSION = "0.63.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.63.1
4
+ version: 0.63.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harvest Team