bitfab 0.33.4 → 0.33.5

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: 12cae09488f9200115e768e31661e55be850acc2dbcf2b53eece9c4ab4d59ca2
4
- data.tar.gz: 3242cb27cbd71d15094bc4024cb914a494eefa2eeee317e1d45c8ba77c77f4a0
3
+ metadata.gz: 40eaaf83e783c54b0a0b373b681d82e1d96b01f4e99a424f68af1fffcd82a79e
4
+ data.tar.gz: ed01d854b7ed2ee101a6bab9d659bd977c7f5ee6f0cbd0b481675d76dba449ec
5
5
  SHA512:
6
- metadata.gz: 11f4111de6c94527b2f4b14757b50ccaddea211d3366bf1a5241e8e7e0ffa065138a84fa7f6db84baaec926cfeb9754fe7024a090b297ecb35e7916a1fc517f1
7
- data.tar.gz: 880b440e2610064045ff1e753d65167c46be2a7220897aa0631b739e24affec2e99cd05de12acf2d39f162474d8fbec6ff13b614f60c6390529395ad2478e4ab
6
+ metadata.gz: 8965c0c940f603355b3ddb75c9a93fc33e56d839a730bcbe750f2eee6db558cb4fcc2de79e9551ce5431737c8907284a7593abaa63935c84d49268b2a7eb1ed2
7
+ data.tar.gz: 6c8883368d7b7bc68c823cd73860722a6460543484c2a5b687b4beec7b26f8737f46d935a33fdaf9b5760fc413ba04f6313426e67b4cc624429840ec0d9d12f7
data/lib/bitfab/replay.rb CHANGED
@@ -127,10 +127,10 @@ module Bitfab
127
127
  # source_trace_id/source_span_id aliases), and returns [new_args, new_kwargs].
128
128
  # Runs per item inside the same rescue as the method, so a raising adapter
129
129
  # sets that item's :error rather than crashing the run.
130
- # @param db_branch [Hash, nil] passing it at all turns database branching
131
- # on, so +{}+ enables it with the mirror project's own sizing. Keys
132
- # +:min_cu+/+:max_cu+ are the branch compute's autoscaling floor and
133
- # ceiling in Neon Compute Units, and +:warmup_sql+ warms the branch's
130
+ # @param db_branch [Boolean, Hash, nil] +true+ branches with the mirror
131
+ # project's own sizing; a Hash tunes it and +false+/+nil+ leave branching
132
+ # off. Keys +:min_cu+/+:max_cu+ are the branch compute's autoscaling floor
133
+ # and ceiling in Neon Compute Units, and +:warmup_sql+ warms the branch's
134
134
  # cache before the replayed method sees it. Read the resolved branch
135
135
  # inside the method with +Bitfab.current_replay_branch+.
136
136
  # @param on_progress [#call, nil] optional callback invoked once per item as
@@ -192,7 +192,7 @@ module Bitfab
192
192
  # the count), so it's omitted from the request entirely.
193
193
  effective_limit = trace_ids ? nil : (limit || 5)
194
194
 
195
- include_db_branch_lease = !db_branch.nil?
195
+ include_db_branch_lease = db_branch_enabled?(db_branch)
196
196
 
197
197
  # code_change_files controls capture: omitted auto-captures, an array
198
198
  # wins, and explicit nil opts out. Preserve a caller-supplied description
@@ -335,16 +335,26 @@ module Bitfab
335
335
  CC_MAX_FILE_BYTES = 500_000
336
336
  CC_MAX_TOTAL_BYTES = 2_000_000
337
337
 
338
+ # Whether the caller asked for database branching. +true+ and a Hash both
339
+ # turn it on; +false+ and +nil+ leave it off. Kept separate from
340
+ # +db_branch_settings+ because +db_branch: true+ enables branching while
341
+ # contributing no settings, so the presence of settings can't stand in for
342
+ # the switch.
343
+ def db_branch_enabled?(db_branch)
344
+ !db_branch.nil? && db_branch != false
345
+ end
346
+
338
347
  # Convert the caller's +db_branch+ options to the wire shape, or nil when
339
348
  # nothing was set. Dropping the key entirely keeps the request identical to
340
- # what older SDKs send.
349
+ # what older SDKs send. Booleans carry no settings: they only move the
350
+ # switch.
341
351
  #
342
352
  # Keys: :min_cu and :max_cu are the branch compute's autoscaling floor and
343
353
  # ceiling in Neon Compute Units (equal values pin the size, keeping items
344
354
  # comparable); :warmup_sql is appended to the branch's readiness check so it
345
355
  # warms the cache before the replayed function sees the lease.
346
356
  def db_branch_settings(db_branch)
347
- return nil if db_branch.nil? || db_branch.empty?
357
+ return nil if db_branch.nil? || db_branch == true || db_branch == false || db_branch.empty?
348
358
 
349
359
  # Symbol or string keys, matching normalize_code_change_files: a hash
350
360
  # assembled from JSON or YAML would otherwise be read as empty, leaving
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bitfab
4
- VERSION = "0.33.4"
4
+ VERSION = "0.33.5"
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.33.4
4
+ version: 0.33.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harvest Team