bitfab 0.62.7 → 0.63.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: 0e4a1e837039a5679b239d2c976e5a0ed657b2270c317a9101ded3416acc48fa
4
- data.tar.gz: c9168929101f6b1bea5c853a80384a242d64f69dec8c99fb3b4a202ae62bd7b8
3
+ metadata.gz: 1294a30cd222eeeb8abc13f1f5cf9b14e0b19ebdc1fe9de174aa146587f28edc
4
+ data.tar.gz: 2636b235d5359ebc72fe0aead7121e5b3ac3363302da51f8b0b5f270713702b5
5
5
  SHA512:
6
- metadata.gz: 3474b103e94a7cce451ab5955652836bf84c0300c3719ece113a14b0114ee41ff322314da45f4d9015b7040672fa84439ba3bc268712c6fab7f58af3f3cda026
7
- data.tar.gz: 442acb8bb6b2a72154c40ae99ec3d34a55d0d212eaba2e27f60bebd000d8453b7dbc0e683c872d9bbf9689e016866c90f3afb2d312ff846020f1d886b5d85565
6
+ metadata.gz: e4695438f4fed3999fa5f0da499f639d94efaa9fcdf084b522c037a5a5129420e28895c9be10f8059cca89f80a26bbbb95f9e0d23d667cf419103b60ad28d951
7
+ data.tar.gz: 5ab3ffe5e5bdc8b826d25d2d809c3f5f2acb53910a7294fc0dc6380e2262711e57df10e5e15974c46fa9fc605967326d70e79203ae4ce7c875d105e2ee67e924
data/lib/bitfab/client.rb CHANGED
@@ -198,7 +198,7 @@ module Bitfab
198
198
  # @return [Hash] with :items, :experiment_id, :experiment_url, and the
199
199
  # deprecated aliases :test_run_id and :test_run_url carrying the same values
200
200
  def replay(receiver, method_name = nil, trace_function_key:, limit: nil, trace_ids: nil, concurrency: nil, max_concurrency: ReplayConcurrency::UNSET,
201
- 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, judge_assertions: false, dry_run: false,
201
+ 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,
202
202
  adapt_inputs: nil, mock_override: nil, db_branch: nil, on_item_start: nil, on_item_finish: nil, on_progress: nil,
203
203
  on_experiment_start: nil, experimental_selective_replay: nil)
204
204
  Replay.run(
@@ -215,6 +215,7 @@ module Bitfab
215
215
  max_concurrency:,
216
216
  attempts:,
217
217
  only_with_assertions:,
218
+ skip_assertion_judging:,
218
219
  judge_assertions:,
219
220
  dry_run:,
220
221
  code_change_description:,
@@ -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, judge_assertions: 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)
266
266
  payload = {
267
267
  "traceFunctionKey" => trace_function_key
268
268
  }
@@ -288,7 +288,7 @@ module Bitfab
288
288
  payload["graderIds"] = grader_ids unless grader_ids.nil?
289
289
  payload["attempts"] = attempts if attempts > 1
290
290
  payload["onlyWithAssertions"] = true if only_with_assertions
291
- payload["judgeAssertions"] = true if judge_assertions
291
+ payload["judgeAssertions"] = true unless skip_assertion_judging
292
292
  payload["includeOriginalMetadata"] = true if include_original_metadata
293
293
  payload["experimentalSelectiveReplay"] = experimental_selective_replay if experimental_selective_replay
294
294
  payload["dbBranchSettings"] = db_branch_settings unless db_branch_settings.nil?
data/lib/bitfab/replay.rb CHANGED
@@ -144,6 +144,8 @@ module Bitfab
144
144
  CODE_CHANGE_UNSET = Object.new.freeze
145
145
  PERSISTENCE_TIMEOUT_SECONDS = 30.0
146
146
  PERSISTENCE_POLL_SECONDS = 0.1
147
+ JUDGE_ASSERTIONS_DEPRECATION = "judge_assertions is deprecated. Assertion judging is on by default; " \
148
+ "pass skip_assertion_judging: true (--skip-assertion-judging) to turn it off."
147
149
 
148
150
  module_function
149
151
 
@@ -282,9 +284,10 @@ module Bitfab
282
284
  # deprecated aliases :test_run_id and :test_run_url carrying the same values
283
285
  def run(client, receiver, method_name, trace_function_key:, limit: nil, trace_ids: nil, name: nil, notes: nil, metadata: nil,
284
286
  concurrency: nil, max_concurrency: ReplayConcurrency::UNSET, code_change_description: CODE_CHANGE_UNSET, code_change_files: CODE_CHANGE_UNSET, experiment_group_id: nil,
285
- dataset_id: nil, dataset_ids: nil, grader_ids: nil, mock: "marked", attempts: ReplayConcurrency::UNSET, only_with_assertions: false, judge_assertions: false, dry_run: false,
287
+ 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,
286
288
  adapt_inputs: nil, mock_override: nil, db_branch: nil, on_item_start: nil, on_item_finish: nil, on_progress: nil,
287
289
  on_experiment_start: nil, experimental_selective_replay: nil)
290
+ skip_assertion_judging = resolve_skip_assertion_judging(skip_assertion_judging, judge_assertions)
288
291
  concurrency_options = ReplayConcurrency.resolve(concurrency, attempts, max_concurrency)
289
292
  attempts = concurrency_options.attempts
290
293
  max_concurrency = concurrency_options.max_concurrency
@@ -387,7 +390,7 @@ module Bitfab
387
390
  grader_ids:,
388
391
  attempts:,
389
392
  only_with_assertions:,
390
- judge_assertions:,
393
+ skip_assertion_judging:,
391
394
  include_original_metadata: !adapt_inputs.nil?,
392
395
  db_branch_settings: resolved_db_branch_settings,
393
396
  **(experimental_selective_replay ? {experimental_selective_replay: SelectiveReplay.wire_options(experimental_selective_replay)} : {})
@@ -566,6 +569,13 @@ module Bitfab
566
569
  CC_MAX_FILE_BYTES = 500_000
567
570
  CC_MAX_TOTAL_BYTES = 2_000_000
568
571
 
572
+ def resolve_skip_assertion_judging(skip_assertion_judging, judge_assertions)
573
+ return skip_assertion_judging if judge_assertions.nil?
574
+
575
+ Bitfab.warn_once("judge-assertions-deprecated", JUDGE_ASSERTIONS_DEPRECATION)
576
+ skip_assertion_judging || judge_assertions == false
577
+ end
578
+
569
579
  def resolve_dataset_ids(dataset_id, dataset_ids)
570
580
  if dataset_id && dataset_ids
571
581
  raise ArgumentError,
@@ -21,7 +21,7 @@ module Bitfab
21
21
  OPTION_NAMES = %i[
22
22
  limit trace_ids name notes metadata concurrency max_concurrency code_change_description
23
23
  code_change_files experiment_group_id dataset_id dataset_ids grader_ids mock
24
- mock_override adapt_inputs db_branch attempts only_with_assertions judge_assertions dry_run on_item_finish
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
 
27
27
  def initialize
@@ -140,6 +140,7 @@ module Bitfab
140
140
  def run(registry, argv: ARGV, stdout: $stdout, stderr: $stderr)
141
141
  args = parse(registry, argv.dup)
142
142
  return SeedCli.run(registry, argv:, stdout:, stderr:) if args[:seed] || args[:from_trace]
143
+ stderr.puts "Bitfab: #{Replay::JUDGE_ASSERTIONS_DEPRECATION}" if args[:judge_assertions]
143
144
 
144
145
  registration = registry.fetch(args.fetch(:pipeline))
145
146
  options = registration.options.dup
@@ -188,7 +189,7 @@ module Bitfab
188
189
  options[:limit] = bound || 10
189
190
  end
190
191
 
191
- %i[name notes metadata max_concurrency experiment_group_id dataset_ids grader_ids mock attempts only_with_assertions judge_assertions dry_run].each do |key|
192
+ %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|
192
193
  options[key] = args[key] unless args[key].nil?
193
194
  end
194
195
 
@@ -325,8 +326,9 @@ module Bitfab
325
326
  options.on("--grader-ids IDS") { |value| args[:grader_ids] = comma_separated("--grader-ids", value) }
326
327
  options.on("--attempts N", Integer) { |value| args[:attempts] = positive_integer("--attempts", value) }
327
328
  options.on("--only-with-assertions") { args[:only_with_assertions] = true }
328
- options.on("--judge-assertions",
329
- "Judge each replay's approved assertions as it finishes (costs model calls)") { args[:judge_assertions] = true }
329
+ options.on("--skip-assertion-judging",
330
+ "Don't judge approved assertions on each replay; judging is on by default and costs model calls") { args[:skip_assertion_judging] = true }
331
+ options.on("--judge-assertions", "Deprecated: judging is on by default") { args[:judge_assertions] = true }
330
332
  options.on("--dry-run") { args[:dry_run] = true }
331
333
  options.on("--fail-on-error",
332
334
  "Exit 1 after printing the result when any replayed item errored. " \
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bitfab
4
- VERSION = "0.62.7"
4
+ VERSION = "0.63.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.62.7
4
+ version: 0.63.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harvest Team