carson 3.23.1 → 3.23.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: 74175b83073b45d8ffdf3ee6aa1af6ebe02f4e8c7eacbc315d5cb7fb42d89578
4
- data.tar.gz: 9f7eae79be834f3a7b78f9caa5b415946a1205a3d5e09029b88b5f9234a962bc
3
+ metadata.gz: b22f115d99fffc1ed689ceb214523b8a33da08fc84a955fcc766d778be21e40c
4
+ data.tar.gz: 6a270c175cb8affabba0d6d747e08701a50c61124a4c5486525113ff350cedbf
5
5
  SHA512:
6
- metadata.gz: dfc053ce86819ec64133a52a436a52c5719f2f2af60aebbe85ee0316f1173bc706b6c9e9158254319ff3d3c5cd457bd5583d86c818bbc3b4c866a5b90f53c427
7
- data.tar.gz: 608c6af987bc8351db9febdb9c5d5ef7f181f4b19b0991c20e4033b98f788ba227c9da1bde01f3b40b92299110e91c0bee0f7a23acc95d25f26f44c0ccaddee9
6
+ metadata.gz: 00ac0ad1897f1d04520f4653aec941e6d9c0dfeb7d13656a4ecb1eff6a3cffe24af0b839447f1324ac11c6eb6c40e00b01e1cba6c3fa86a5d21871576b4bb2d2
7
+ data.tar.gz: fad5645c4a8befb085b4617db5542117bf593f1475cc5a65ccbf29b207e4c5ea9fd938bb503d2fa35e66b652ecc01fae269d68c5c60f2e895055cd8c3b0190b3
data/RELEASE.md CHANGED
@@ -5,6 +5,19 @@ Release-note scope rule:
5
5
  - `RELEASE.md` records only version deltas, breaking changes, and migration actions.
6
6
  - Operational usage guides live in `MANUAL.md` and `API.md`.
7
7
 
8
+ ## 3.23.2
9
+
10
+ ### What changed
11
+
12
+ - **Fix: onboard audit exception silently swallowed** — `onboard_run_audit!` referenced an undefined variable `e` instead of `exception` in its rescue clause. When `audit!` raised during `carson onboard`, the NameError was caught by the ensure block's return, giving the user no diagnostic. Now correctly captures the exception and reports "Audit skipped."
13
+ - **Fix: `sync_after_merge!` always reported success** — `Open3.capture3` returns a `Process::Status` object which is always truthy. The sync-failure branch was unreachable. Now correctly calls `.success?` on the status object.
14
+ - **Test coverage: Ledger revision recording** — unit tests for `record_revision` (numbering, `finished_at`, counter bump), `revisions_for_delivery` ordering, and behavioural verification that `active_deliveries` returns exactly the states `Delivery` considers active.
15
+ - **Test coverage: govern reconciliation** — tests for PR MERGED (integrated), PR CLOSED (failed), head-advanced (superseded), and no-agent-provider (escalated) state transitions that were previously stubbed out.
16
+ - **Test coverage: deliver error paths** — push failure and PR creation failure tests exercising actual error handling at the adapter boundary.
17
+ - **Housekeeping** — `Ledger::ACTIVE_DELIVERY_STATES` now references `Delivery::ACTIVE_STATES` instead of maintaining a duplicate. Fixed indentation in `upsert_delivery` and `supersede_branch!`. Corrected "deliver/delivers" to "delivery/deliveries" in govern output.
18
+
19
+ ### No migration required
20
+
8
21
  ## 3.23.1
9
22
 
10
23
  ### What changed
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.23.1
1
+ 3.23.2
data/lib/carson/ledger.rb CHANGED
@@ -6,7 +6,7 @@ require "time"
6
6
  module Carson
7
7
  class Ledger
8
8
  UNSET = Object.new
9
- ACTIVE_DELIVERY_STATES = %w[preparing gated queued integrating escalated].freeze
9
+ ACTIVE_DELIVERY_STATES = Delivery::ACTIVE_STATES
10
10
 
11
11
  def initialize( path: )
12
12
  @path = File.expand_path( path )
@@ -75,16 +75,16 @@ module Carson
75
75
  [ repository.path, branch_name, head ]
76
76
  )
77
77
 
78
- if row
79
- database.execute(
80
- <<~SQL,
81
- UPDATE deliveries
82
- SET worktree_path = ?, authority = ?, status = ?, pr_number = ?, pr_url = ?,
83
- cause = ?, summary = ?, updated_at = ?
84
- WHERE id = ?
85
- SQL
86
- [ worktree_path, authority, status, pr_number, pr_url, cause, summary, timestamp, row.fetch( "id" ) ]
87
- )
78
+ if row
79
+ database.execute(
80
+ <<~SQL,
81
+ UPDATE deliveries
82
+ SET worktree_path = ?, authority = ?, status = ?, pr_number = ?, pr_url = ?,
83
+ cause = ?, summary = ?, updated_at = ?
84
+ WHERE id = ?
85
+ SQL
86
+ [ worktree_path, authority, status, pr_number, pr_url, cause, summary, timestamp, row.fetch( "id" ) ]
87
+ )
88
88
  return fetch_delivery( database: database, id: row.fetch( "id" ), repository: repository )
89
89
  end
90
90
 
@@ -283,15 +283,15 @@ module Carson
283
283
  )
284
284
  end
285
285
 
286
- def supersede_branch!( database:, repository:, branch_name:, timestamp: )
287
- database.execute(
288
- <<~SQL,
289
- UPDATE deliveries
290
- SET status = ?, superseded_at = ?, updated_at = ?
291
- WHERE repo_path = ? AND branch_name = ? AND status IN ( #{active_state_placeholders} )
292
- SQL
293
- [ "superseded", timestamp, timestamp, repository.path, branch_name, *ACTIVE_DELIVERY_STATES ]
294
- )
286
+ def supersede_branch!( database:, repository:, branch_name:, timestamp: )
287
+ database.execute(
288
+ <<~SQL,
289
+ UPDATE deliveries
290
+ SET status = ?, superseded_at = ?, updated_at = ?
291
+ WHERE repo_path = ? AND branch_name = ? AND status IN ( #{active_state_placeholders} )
292
+ SQL
293
+ [ "superseded", timestamp, timestamp, repository.path, branch_name, *ACTIVE_DELIVERY_STATES ]
294
+ )
295
295
  end
296
296
 
297
297
  def active_state_placeholders
@@ -311,10 +311,10 @@ module Carson
311
311
  # Syncs main after a successful merge.
312
312
  def sync_after_merge!( remote:, main:, result: )
313
313
  main_root = main_worktree_root
314
- _, pull_stderr, pull_success, = Open3.capture3(
314
+ _, pull_stderr, pull_status, = Open3.capture3(
315
315
  "git", "-C", main_root, "pull", "--ff-only", remote, main
316
316
  )
317
- if pull_success
317
+ if pull_status.success?
318
318
  result[ :synced ] = true
319
319
  puts_verbose "synced #{main} in #{main_root} from #{remote}"
320
320
  else
@@ -81,7 +81,7 @@ module Carson
81
81
  return repo_report
82
82
  end
83
83
 
84
- puts_line "#{repository.name}: #{deliveries.length} active deliver#{plural_suffix( count: deliveries.length )}"
84
+ puts_line "#{repository.name}: #{deliveries.length} active deliver#{deliveries.length == 1 ? 'y' : 'ies'}"
85
85
 
86
86
  reconciled = deliveries.map { |item| scoped_runtime.send( :reconcile_delivery!, delivery: item ) }
87
87
  next_integration_id = reconciled.find( &:ready? )&.id
@@ -295,7 +295,7 @@ module Carson
295
295
  audit_error = nil
296
296
  audit_status = with_captured_output { audit! }
297
297
  rescue StandardError => exception
298
- audit_error = e
298
+ audit_error = exception
299
299
  audit_status = EXIT_OK
300
300
  ensure
301
301
  return onboard_print_audit_result( status: audit_status, error: audit_error )
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carson
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.23.1
4
+ version: 3.23.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hailei Wang