kettle-family 1.3.51 → 1.3.52
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +19 -1
- data/README.md +1 -1
- data/lib/kettle/family/command_runner.rb +112 -48
- data/lib/kettle/family/release_state_check.rb +172 -1
- data/lib/kettle/family/report.rb +55 -12
- data/lib/kettle/family/secrets.rb +83 -19
- data/lib/kettle/family/version.rb +1 -1
- data/lib/kettle/family/workflow.rb +34 -16
- data.tar.gz.sig +0 -0
- metadata +6 -6
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 47f6ea5335d380ff60f964c64be42bdc260fc0777a3203dbe69f4d67640e5c19
|
|
4
|
+
data.tar.gz: a019c64ba9f59ffc6375b43ad5742ec9b4c6429d02c7b4a81c723b809f30e9e3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 66ddaf271c6910818fba12a2e7437b6ad08c025d60ca85f2d41a74a3ba4edb7a9b01105aa483b55f4ae3a1c16628e2011333494f0df7e02d1ec329d902e1d198
|
|
7
|
+
data.tar.gz: 673c61eaf9fc3f0d6d3b5f83b9c8b7d7d121cb05e580b01bd04d71ae3c662bf4f4eef48fdf8915dfb0ed2227b77f2301ed4729fce87bcd3b7eb5e1a28b6bf786
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/CHANGELOG.md
CHANGED
|
@@ -30,6 +30,22 @@ Please file a bug if you notice a violation of semantic versioning.
|
|
|
30
30
|
|
|
31
31
|
### Security
|
|
32
32
|
|
|
33
|
+
## [1.3.52] - 2026-11-27
|
|
34
|
+
|
|
35
|
+
- TAG: [v1.3.52][1.3.52t]
|
|
36
|
+
- COVERAGE: 94.38% -- 8960/9494 lines in 49 files
|
|
37
|
+
- BRANCH COVERAGE: 79.76% -- 3791/4753 branches in 49 files
|
|
38
|
+
- 41.52% documented
|
|
39
|
+
|
|
40
|
+
### Added
|
|
41
|
+
|
|
42
|
+
- `state` (`release-state`): report single-char git working-tree dirty state (`-` clean, `+` staged, `?` untracked, `*` unstaged, `!` conflict) in the `^ / v / ~` column, a conditional `wt` column (`-`, `N`, `@`, `@+N`) when linked git worktrees are present, and structured `git_dirty`/`git_state`/`git_*_count`/`git_worktree`/`git_linked_worktrees` fields in `--json` output (fixes #86)
|
|
43
|
+
|
|
44
|
+
### Fixed
|
|
45
|
+
|
|
46
|
+
- progress pane secondary ticker: move remaining `N/M` counters (`attempt/attempts` for `release_lockfile`, `release_probe`, and `github_release`; `queued/total` for `secret_provider`) out of TTY status row text and into the dedicated `secondary:` ticker column while keeping counts in plain log lines (fixes #83)
|
|
47
|
+
- release secrets broker: stop `CommandRunner` from concurrently selecting on `$stdin` while `Secrets::TerminalPrompter` reads a fallback RubyGems MFA code (which left the main loop blocked in `$stdin.readpartial` after the prompter consumed the line, freezing terminal output until a second Enter). Disable child stdin forwarding under `kettle-release --yes` with an active broker, coordinate exclusive terminal stdin handoff for `--no-accept` runs, exit Open3 interactive loops once child stdout/stderr close, and require a prompt delimiter (`:`/`?`) in `otp_response_prompt?` so intro sentences and invalid-OTP errors never double-fire
|
|
48
|
+
|
|
33
49
|
## [1.3.51] - 2026-11-26
|
|
34
50
|
|
|
35
51
|
- TAG: [v1.3.51][1.3.51t]
|
|
@@ -3578,7 +3594,9 @@ Please file a bug if you notice a violation of semantic versioning.
|
|
|
3578
3594
|
- Fixed CI load failures on engines without compatible `pty` support by falling back to Open3 for interactive release commands.
|
|
3579
3595
|
- Fixed Ruby 3.2 version-bump support by loading Prism lazily and wiring the Prism gem only for MRI versions that need it.
|
|
3580
3596
|
|
|
3581
|
-
[Unreleased]: https://github.com/kettle-dev/kettle-family/compare/v1.3.
|
|
3597
|
+
[Unreleased]: https://github.com/kettle-dev/kettle-family/compare/v1.3.52...HEAD
|
|
3598
|
+
[1.3.52]: https://github.com/kettle-dev/kettle-family/compare/v1.3.51...v1.3.52
|
|
3599
|
+
[1.3.52t]: https://github.com/kettle-dev/kettle-family/releases/tag/v1.3.52
|
|
3582
3600
|
[1.3.51]: https://github.com/kettle-dev/kettle-family/compare/v1.3.50...v1.3.51
|
|
3583
3601
|
[1.3.51t]: https://github.com/kettle-dev/kettle-family/releases/tag/v1.3.51
|
|
3584
3602
|
[1.3.50]: https://github.com/kettle-dev/kettle-family/compare/v1.3.49...v1.3.50
|
data/README.md
CHANGED
|
@@ -1143,7 +1143,7 @@ If none of the available licenses suit your use case, please [contact us](mailto
|
|
|
1143
1143
|
[📌gitmoji]: https://gitmoji.dev
|
|
1144
1144
|
[📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
|
|
1145
1145
|
[🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
|
|
1146
|
-
[🧮kloc-img]: https://img.shields.io/badge/KLOC-9.
|
|
1146
|
+
[🧮kloc-img]: https://img.shields.io/badge/KLOC-9.494-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
|
|
1147
1147
|
[🔐security]: https://github.com/kettle-dev/kettle-family/blob/main/SECURITY.md
|
|
1148
1148
|
[🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
|
|
1149
1149
|
[📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
|
|
@@ -224,12 +224,15 @@ module Kettle
|
|
|
224
224
|
end
|
|
225
225
|
private_constant :FailureStatus
|
|
226
226
|
|
|
227
|
-
def initialize(execute: false, accept: true, gem_signing_password: nil, otp_coordinator: nil, mise_adapter: nil)
|
|
227
|
+
def initialize(execute: false, accept: true, gem_signing_password: nil, otp_coordinator: nil, mise_adapter: nil, forward_stdin: true, stdin_input: nil, stdin_gate: nil)
|
|
228
228
|
@execute = execute
|
|
229
229
|
@accept = accept
|
|
230
230
|
@gem_signing_password = gem_signing_password
|
|
231
231
|
@otp_coordinator = otp_coordinator
|
|
232
232
|
@mise_adapter = mise_adapter || Kettle::Family.mise_adapter
|
|
233
|
+
@forward_stdin = forward_stdin
|
|
234
|
+
@stdin_input = stdin_input
|
|
235
|
+
@stdin_gate = stdin_gate
|
|
233
236
|
end
|
|
234
237
|
|
|
235
238
|
def call(member:, phase:, command:, env: {}, interactive: false, raw: false, stdout_line_handler: nil, log_path: nil, passthrough_output: true, chdir: member.root, **options)
|
|
@@ -282,7 +285,7 @@ module Kettle
|
|
|
282
285
|
|
|
283
286
|
private
|
|
284
287
|
|
|
285
|
-
attr_reader :execute, :accept, :gem_signing_password, :otp_coordinator
|
|
288
|
+
attr_reader :execute, :accept, :gem_signing_password, :otp_coordinator, :stdin_gate
|
|
286
289
|
|
|
287
290
|
def run_streaming(env:, argv:, chdir:, process_options:, stdout_line_handler:, log_io: nil)
|
|
288
291
|
captured_stdout = +""
|
|
@@ -354,22 +357,16 @@ module Kettle
|
|
|
354
357
|
prompt_buffer = +""
|
|
355
358
|
status = nil
|
|
356
359
|
PTY.spawn(env, *argv, chdir: chdir, **process_options) do |output, input, pid|
|
|
357
|
-
|
|
360
|
+
with_stdin_gate do |wakeup|
|
|
361
|
+
stdin_eof = false
|
|
358
362
|
loop do
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
transcript_write(log_io, chunk)
|
|
367
|
-
stdout_line_buffer = print_interactive_stdout(stdout_line_buffer, chunk, stdout_line_handler, passthrough_output: passthrough_output)
|
|
368
|
-
prompt_buffer = handle_interactive_prompt(input, chunk, member_name: member_name, prompt_buffer: prompt_buffer)
|
|
369
|
-
else
|
|
370
|
-
chunk = $stdin.readpartial(1024)
|
|
371
|
-
input.write(chunk)
|
|
372
|
-
end
|
|
363
|
+
ready_outputs, stdin_eof = select_interactive_readers([output], input: input, wakeup: wakeup, stdin_eof: stdin_eof)
|
|
364
|
+
ready_outputs.each do |reader|
|
|
365
|
+
chunk = reader.readpartial(1024)
|
|
366
|
+
stdout << chunk
|
|
367
|
+
transcript_write(log_io, chunk)
|
|
368
|
+
stdout_line_buffer = print_interactive_stdout(stdout_line_buffer, chunk, stdout_line_handler, passthrough_output: passthrough_output)
|
|
369
|
+
prompt_buffer = handle_interactive_prompt(input, chunk, member_name: member_name, prompt_buffer: prompt_buffer)
|
|
373
370
|
end
|
|
374
371
|
end
|
|
375
372
|
rescue Errno::EIO, EOFError
|
|
@@ -407,29 +404,25 @@ module Kettle
|
|
|
407
404
|
status = nil
|
|
408
405
|
Open3.popen3(env, *argv, chdir: chdir, **process_options) do |input, output, error, wait_thread|
|
|
409
406
|
readers = [output, error]
|
|
410
|
-
|
|
411
|
-
|
|
407
|
+
with_stdin_gate do |wakeup|
|
|
408
|
+
stdin_eof = false
|
|
412
409
|
until readers.empty?
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
passthrough_output: passthrough_output,
|
|
430
|
-
prompt_buffer: prompt_buffer
|
|
431
|
-
)
|
|
432
|
-
end
|
|
410
|
+
ready_outputs, stdin_eof = select_interactive_readers(readers, input: input, wakeup: wakeup, stdin_eof: stdin_eof)
|
|
411
|
+
ready_outputs.each do |reader|
|
|
412
|
+
stdout_line_buffer, prompt_buffer = read_interactive_stream(
|
|
413
|
+
reader,
|
|
414
|
+
output,
|
|
415
|
+
input,
|
|
416
|
+
captured_stdout,
|
|
417
|
+
captured_stderr,
|
|
418
|
+
readers,
|
|
419
|
+
member_name: member_name,
|
|
420
|
+
stdout_line_buffer: stdout_line_buffer,
|
|
421
|
+
stdout_line_handler: stdout_line_handler,
|
|
422
|
+
log_io: log_io,
|
|
423
|
+
passthrough_output: passthrough_output,
|
|
424
|
+
prompt_buffer: prompt_buffer
|
|
425
|
+
)
|
|
433
426
|
end
|
|
434
427
|
end
|
|
435
428
|
rescue Error => error
|
|
@@ -452,8 +445,9 @@ module Kettle
|
|
|
452
445
|
prompt_buffer = +""
|
|
453
446
|
status = nil
|
|
454
447
|
Open3.popen3(env, *argv, chdir: chdir, **process_options) do |input, output, stderr_stream, wait_thread|
|
|
455
|
-
|
|
456
|
-
streams
|
|
448
|
+
output_streams = [output, stderr_stream]
|
|
449
|
+
streams = output_streams.dup
|
|
450
|
+
streams << stdin_stream if forward_stdin?
|
|
457
451
|
queue = Queue.new
|
|
458
452
|
readers = streams.map do |stream|
|
|
459
453
|
Thread.new do # rubocop:disable ThreadSafety/NewThread -- Windows pipes are not selectable with IO.select.
|
|
@@ -462,17 +456,16 @@ module Kettle
|
|
|
462
456
|
queue << [stream, nil]
|
|
463
457
|
end
|
|
464
458
|
end
|
|
465
|
-
input_reader = readers[streams.index(
|
|
466
|
-
active_streams = streams.dup
|
|
459
|
+
input_reader = readers[streams.index(stdin_stream)] if streams.include?(stdin_stream)
|
|
467
460
|
begin
|
|
468
|
-
until
|
|
461
|
+
until output_streams.empty?
|
|
469
462
|
stream, chunk = queue.pop
|
|
470
463
|
unless chunk
|
|
471
|
-
|
|
464
|
+
output_streams.delete(stream)
|
|
472
465
|
next
|
|
473
466
|
end
|
|
474
|
-
if stream.equal?(
|
|
475
|
-
input
|
|
467
|
+
if stream.equal?(stdin_stream)
|
|
468
|
+
write_forwarded_stdin(input, chunk)
|
|
476
469
|
next
|
|
477
470
|
end
|
|
478
471
|
if stream.equal?(output)
|
|
@@ -501,6 +494,77 @@ module Kettle
|
|
|
501
494
|
[captured_stdout, captured_stderr, status]
|
|
502
495
|
end
|
|
503
496
|
|
|
497
|
+
def forward_stdin?
|
|
498
|
+
@forward_stdin && !otp_coordinator && stdin_stream.respond_to?(:tty?) && stdin_stream.tty?
|
|
499
|
+
end
|
|
500
|
+
|
|
501
|
+
def stdin_stream
|
|
502
|
+
@stdin_input || $stdin
|
|
503
|
+
end
|
|
504
|
+
|
|
505
|
+
def with_stdin_gate(&block)
|
|
506
|
+
if forward_stdin? && stdin_gate
|
|
507
|
+
stdin_gate.with_stdin_forwarder(&block)
|
|
508
|
+
else
|
|
509
|
+
yield nil
|
|
510
|
+
end
|
|
511
|
+
end
|
|
512
|
+
|
|
513
|
+
def select_interactive_readers(output_readers, input:, wakeup:, stdin_eof:)
|
|
514
|
+
readers = output_readers.dup
|
|
515
|
+
watching_stdin = false
|
|
516
|
+
stdin_chunk = nil
|
|
517
|
+
begin
|
|
518
|
+
if !stdin_eof && forward_stdin?
|
|
519
|
+
watching_stdin = stdin_gate ? stdin_gate.enter_stdin_select : true
|
|
520
|
+
readers << stdin_stream if watching_stdin
|
|
521
|
+
readers << wakeup if wakeup
|
|
522
|
+
end
|
|
523
|
+
ready_readers = IO.select(readers).first
|
|
524
|
+
drain_wakeup(wakeup) if wakeup && ready_readers.include?(wakeup)
|
|
525
|
+
if watching_stdin
|
|
526
|
+
stdin_chunk, stdin_eof = read_forwarded_stdin(ready_readers.include?(stdin_stream))
|
|
527
|
+
watching_stdin = false
|
|
528
|
+
end
|
|
529
|
+
ensure
|
|
530
|
+
stdin_gate.leave_stdin_select if watching_stdin && stdin_gate
|
|
531
|
+
end
|
|
532
|
+
write_forwarded_stdin(input, stdin_chunk) if stdin_chunk
|
|
533
|
+
[ready_readers.select { |reader| output_readers.include?(reader) }, stdin_eof]
|
|
534
|
+
end
|
|
535
|
+
|
|
536
|
+
def read_forwarded_stdin(stdin_ready)
|
|
537
|
+
return read_stdin_chunk(stdin_ready) unless stdin_gate
|
|
538
|
+
|
|
539
|
+
result = [nil, false]
|
|
540
|
+
stdin_gate.leave_stdin_select do
|
|
541
|
+
result = read_stdin_chunk(stdin_ready)
|
|
542
|
+
end
|
|
543
|
+
result
|
|
544
|
+
end
|
|
545
|
+
|
|
546
|
+
def read_stdin_chunk(stdin_ready)
|
|
547
|
+
return [nil, false] unless stdin_ready
|
|
548
|
+
|
|
549
|
+
[stdin_stream.readpartial(1024), false]
|
|
550
|
+
rescue IOError
|
|
551
|
+
[nil, true]
|
|
552
|
+
end
|
|
553
|
+
|
|
554
|
+
def write_forwarded_stdin(input, chunk)
|
|
555
|
+
input.write(chunk)
|
|
556
|
+
rescue Errno::EPIPE, IOError
|
|
557
|
+
nil
|
|
558
|
+
end
|
|
559
|
+
|
|
560
|
+
def drain_wakeup(wakeup)
|
|
561
|
+
loop do
|
|
562
|
+
break unless wakeup.read_nonblock(1024, exception: false).is_a?(String)
|
|
563
|
+
end
|
|
564
|
+
rescue IOError
|
|
565
|
+
nil
|
|
566
|
+
end
|
|
567
|
+
|
|
504
568
|
def read_interactive_stream(
|
|
505
569
|
reader,
|
|
506
570
|
output,
|
|
@@ -650,7 +714,7 @@ module Kettle
|
|
|
650
714
|
end
|
|
651
715
|
|
|
652
716
|
def otp_response_prompt?(chunk)
|
|
653
|
-
chunk.match?(/(?:OTP code|one-time password|\bCode
|
|
717
|
+
chunk.match?(/(?:OTP code|one-time password|\bCode)\s*[:?]\s*\z/i)
|
|
654
718
|
end
|
|
655
719
|
|
|
656
720
|
def signing_password_prompt?(chunk)
|
|
@@ -24,6 +24,7 @@ module Kettle
|
|
|
24
24
|
TRANSFER_CHANGELOG_TOTAL_UNSET = Object.new.freeze
|
|
25
25
|
CACHE_MISS = Object.new.freeze
|
|
26
26
|
WORKTREE_ADMIN_MUTEX = Mutex.new
|
|
27
|
+
UNMERGED_STATUS_CODES = %w[DD AU UD UA DU AA UU].freeze
|
|
27
28
|
|
|
28
29
|
# +branches+ scopes the check to specific release target branches. A
|
|
29
30
|
# branch-stack member produces one result per branch; a per-branch
|
|
@@ -39,6 +40,9 @@ module Kettle
|
|
|
39
40
|
@transfer_changelog_status_by_root = {}
|
|
40
41
|
@transfer_changelog_lag_by_key = {}
|
|
41
42
|
@transfer_changelog_total_count = TRANSFER_CHANGELOG_TOTAL_UNSET
|
|
43
|
+
@git_status_by_worktree = {}
|
|
44
|
+
@git_worktrees_by_common_dir = {}
|
|
45
|
+
@branch_worktree_snapshot = nil
|
|
42
46
|
@cache_mutex = Mutex.new
|
|
43
47
|
@transfer_changelog_total_mutex = Mutex.new
|
|
44
48
|
end
|
|
@@ -336,6 +340,7 @@ module Kettle
|
|
|
336
340
|
enriched = state.dup
|
|
337
341
|
current_branch = branch || git_output(root, "branch", "--show-current")
|
|
338
342
|
enriched["current_branch"] = current_branch unless current_branch.to_s.empty?
|
|
343
|
+
enrich_working_tree_state!(root, enriched, branch: branch)
|
|
339
344
|
|
|
340
345
|
version = state["latest_released"].to_s.empty? ? state["latest_changelog_version"] : state["latest_released"]
|
|
341
346
|
return enriched if version.to_s.empty?
|
|
@@ -361,6 +366,166 @@ module Kettle
|
|
|
361
366
|
enriched
|
|
362
367
|
end
|
|
363
368
|
|
|
369
|
+
def enrich_working_tree_state!(root, enriched, branch: nil)
|
|
370
|
+
if @branch_worktree_snapshot && branch
|
|
371
|
+
snapshot = @branch_worktree_snapshot
|
|
372
|
+
checked_out_path = snapshot[:by_branch][branch]
|
|
373
|
+
enriched["git_worktree"] = !checked_out_path.nil? && checked_out_path != snapshot[:primary_path]
|
|
374
|
+
enriched["git_linked_worktrees"] = snapshot[:linked_count]
|
|
375
|
+
if checked_out_path && (status = git_status_summary(checked_out_path))
|
|
376
|
+
enriched.merge!(status)
|
|
377
|
+
end
|
|
378
|
+
return
|
|
379
|
+
end
|
|
380
|
+
|
|
381
|
+
worktree_info = git_worktree_info(root)
|
|
382
|
+
if worktree_info
|
|
383
|
+
enriched["git_worktree"] = worktree_info[:linked]
|
|
384
|
+
enriched["git_linked_worktrees"] = worktree_info[:linked_count]
|
|
385
|
+
end
|
|
386
|
+
if (status = git_status_summary(root))
|
|
387
|
+
enriched.merge!(status)
|
|
388
|
+
end
|
|
389
|
+
end
|
|
390
|
+
|
|
391
|
+
def git_worktree_info(root)
|
|
392
|
+
git_dir, common_dir = git_dir_paths(root)
|
|
393
|
+
return nil unless git_dir && common_dir
|
|
394
|
+
|
|
395
|
+
snapshot = @cache_mutex.synchronize { @git_worktrees_by_common_dir[common_dir] }
|
|
396
|
+
unless snapshot
|
|
397
|
+
snapshot = snapshot_git_worktrees(root, common_dir: common_dir)
|
|
398
|
+
@cache_mutex.synchronize { @git_worktrees_by_common_dir[common_dir] = snapshot } if snapshot
|
|
399
|
+
end
|
|
400
|
+
return nil unless snapshot
|
|
401
|
+
|
|
402
|
+
{
|
|
403
|
+
linked: git_dir != common_dir,
|
|
404
|
+
linked_count: snapshot[:linked_count]
|
|
405
|
+
}
|
|
406
|
+
end
|
|
407
|
+
|
|
408
|
+
def snapshot_git_worktrees(root, common_dir: nil)
|
|
409
|
+
return nil unless git_work_tree?(root)
|
|
410
|
+
|
|
411
|
+
common_dir ||= git_dir_paths(root).last
|
|
412
|
+
stdout, _stderr, status = Open3.capture3("git", "worktree", "list", "--porcelain", chdir: root)
|
|
413
|
+
return nil unless status.success?
|
|
414
|
+
|
|
415
|
+
entries = parse_git_worktree_list(stdout)
|
|
416
|
+
primary_path = entries.first&.fetch(:path)
|
|
417
|
+
by_branch = {}
|
|
418
|
+
entries.each do |entry|
|
|
419
|
+
by_branch[entry[:branch]] = entry[:path] if entry[:branch]
|
|
420
|
+
end
|
|
421
|
+
{
|
|
422
|
+
common_dir: common_dir,
|
|
423
|
+
primary_path: primary_path,
|
|
424
|
+
linked_count: [entries.length - 1, 0].max,
|
|
425
|
+
by_branch: by_branch
|
|
426
|
+
}
|
|
427
|
+
end
|
|
428
|
+
|
|
429
|
+
def parse_git_worktree_list(stdout)
|
|
430
|
+
entries = []
|
|
431
|
+
current = nil
|
|
432
|
+
stdout.each_line do |raw_line|
|
|
433
|
+
line = raw_line.strip
|
|
434
|
+
if line.empty?
|
|
435
|
+
entries << current if current && !current[:prunable]
|
|
436
|
+
current = nil
|
|
437
|
+
elsif line.start_with?("worktree ")
|
|
438
|
+
current = {path: canonical_git_path(line.delete_prefix("worktree ")), branch: nil, prunable: false}
|
|
439
|
+
elsif current && line.start_with?("branch ")
|
|
440
|
+
ref = line.delete_prefix("branch ")
|
|
441
|
+
current[:branch] = ref.delete_prefix("refs/heads/")
|
|
442
|
+
elsif current && line.start_with?("prunable")
|
|
443
|
+
current[:prunable] = true
|
|
444
|
+
end
|
|
445
|
+
end
|
|
446
|
+
entries << current if current && !current[:prunable]
|
|
447
|
+
entries
|
|
448
|
+
end
|
|
449
|
+
|
|
450
|
+
def git_dir_paths(root)
|
|
451
|
+
stdout, _stderr, status = Open3.capture3("git", "rev-parse", "--git-dir", "--git-common-dir", chdir: root)
|
|
452
|
+
return [nil, nil] unless status.success?
|
|
453
|
+
|
|
454
|
+
lines = stdout.lines.map(&:strip).reject(&:empty?)
|
|
455
|
+
return [nil, nil] unless lines.length == 2
|
|
456
|
+
|
|
457
|
+
lines.map { |path| canonical_git_path(File.expand_path(path, root)) }
|
|
458
|
+
end
|
|
459
|
+
|
|
460
|
+
def git_status_summary(worktree_root)
|
|
461
|
+
toplevel = git_output(worktree_root, "rev-parse", "--show-toplevel")
|
|
462
|
+
return nil if toplevel.to_s.empty?
|
|
463
|
+
|
|
464
|
+
cache_key = canonical_git_path(toplevel)
|
|
465
|
+
cached = @cache_mutex.synchronize { @git_status_by_worktree.fetch(cache_key, CACHE_MISS) }
|
|
466
|
+
return cached unless cached.equal?(CACHE_MISS)
|
|
467
|
+
|
|
468
|
+
stdout, _stderr, status = Open3.capture3("git", "status", "--porcelain=v1", "-z", "--untracked-files=normal", chdir: toplevel)
|
|
469
|
+
summary = status.success? ? parse_git_status_porcelain(stdout) : nil
|
|
470
|
+
@cache_mutex.synchronize { @git_status_by_worktree[cache_key] = summary }
|
|
471
|
+
summary
|
|
472
|
+
end
|
|
473
|
+
|
|
474
|
+
def parse_git_status_porcelain(stdout)
|
|
475
|
+
entries = stdout.split("\0")
|
|
476
|
+
staged = 0
|
|
477
|
+
unstaged = 0
|
|
478
|
+
untracked = 0
|
|
479
|
+
conflict = 0
|
|
480
|
+
index = 0
|
|
481
|
+
while index < entries.length
|
|
482
|
+
entry = entries[index]
|
|
483
|
+
index += 1
|
|
484
|
+
next if entry.empty?
|
|
485
|
+
|
|
486
|
+
code = entry[0, 2]
|
|
487
|
+
x = code[0]
|
|
488
|
+
y = code[1]
|
|
489
|
+
index += 1 if %w[R C].include?(x) || %w[R C].include?(y)
|
|
490
|
+
|
|
491
|
+
if code == "??"
|
|
492
|
+
untracked += 1
|
|
493
|
+
elsif UNMERGED_STATUS_CODES.include?(code)
|
|
494
|
+
conflict += 1
|
|
495
|
+
else
|
|
496
|
+
staged += 1 if x && x != " "
|
|
497
|
+
unstaged += 1 if y && y != " "
|
|
498
|
+
end
|
|
499
|
+
end
|
|
500
|
+
|
|
501
|
+
git_state = if conflict.positive?
|
|
502
|
+
"conflict"
|
|
503
|
+
elsif unstaged.positive?
|
|
504
|
+
"unstaged"
|
|
505
|
+
elsif untracked.positive?
|
|
506
|
+
"untracked"
|
|
507
|
+
elsif staged.positive?
|
|
508
|
+
"staged"
|
|
509
|
+
else
|
|
510
|
+
"clean"
|
|
511
|
+
end
|
|
512
|
+
|
|
513
|
+
{
|
|
514
|
+
"git_dirty" => git_state != "clean",
|
|
515
|
+
"git_state" => git_state,
|
|
516
|
+
"git_staged_count" => staged,
|
|
517
|
+
"git_unstaged_count" => unstaged,
|
|
518
|
+
"git_untracked_count" => untracked,
|
|
519
|
+
"git_conflict_count" => conflict
|
|
520
|
+
}
|
|
521
|
+
end
|
|
522
|
+
|
|
523
|
+
def canonical_git_path(path)
|
|
524
|
+
File.realpath(path)
|
|
525
|
+
rescue Errno::ENOENT, Errno::ENOTDIR
|
|
526
|
+
File.expand_path(path)
|
|
527
|
+
end
|
|
528
|
+
|
|
364
529
|
def git_work_tree?(root)
|
|
365
530
|
_stdout, _stderr, status = Open3.capture3("git", "rev-parse", "--is-inside-work-tree", chdir: root)
|
|
366
531
|
status.success?
|
|
@@ -954,8 +1119,13 @@ module Kettle
|
|
|
954
1119
|
def with_branch_worktrees(root:, branches:)
|
|
955
1120
|
with_worktree_registry_lock(root: root) do
|
|
956
1121
|
base = File.join(root, "tmp", "kettle-family-release-state")
|
|
957
|
-
FileUtils.mkdir_p(base)
|
|
958
1122
|
prune_stale_worktrees(root: root)
|
|
1123
|
+
# Snapshot worktrees and working-tree status before creating
|
|
1124
|
+
# tmp/kettle-family-release-state/ so repos without tmp/ in
|
|
1125
|
+
# .gitignore do not report our own inspection worktrees as dirty.
|
|
1126
|
+
@branch_worktree_snapshot = snapshot_git_worktrees(root)
|
|
1127
|
+
@branch_worktree_snapshot&.fetch(:by_branch)&.each_value { |path| git_status_summary(path) }
|
|
1128
|
+
FileUtils.mkdir_p(base)
|
|
959
1129
|
entries = branches.map do |branch|
|
|
960
1130
|
{branch: branch, worktree_root: File.join(base, "worktree-#{Process.pid}-#{SecureRandom.hex(8)}")}
|
|
961
1131
|
end
|
|
@@ -966,6 +1136,7 @@ module Kettle
|
|
|
966
1136
|
end
|
|
967
1137
|
yield entries
|
|
968
1138
|
ensure
|
|
1139
|
+
@branch_worktree_snapshot = nil
|
|
969
1140
|
entries&.reverse_each do |entry|
|
|
970
1141
|
remove_branch_worktree(root: root, worktree_root: entry[:worktree_root])
|
|
971
1142
|
end
|
data/lib/kettle/family/report.rb
CHANGED
|
@@ -34,6 +34,14 @@ module Kettle
|
|
|
34
34
|
update-bundler
|
|
35
35
|
].freeze
|
|
36
36
|
|
|
37
|
+
GIT_STATE_SYMBOLS = {
|
|
38
|
+
"clean" => "-",
|
|
39
|
+
"staged" => "+",
|
|
40
|
+
"untracked" => "?",
|
|
41
|
+
"unstaged" => "*",
|
|
42
|
+
"conflict" => "!"
|
|
43
|
+
}.freeze
|
|
44
|
+
|
|
37
45
|
attr_reader :family_name, :family_mode, :order_mode, :members, :selected_members, :config_path, :command, :results, :branch_lanes, :release_target_branches, :member_release_target_branches, :release_mode, :release_resume_arguments, :warnings, :event_log_dirs
|
|
38
46
|
|
|
39
47
|
def initialize(family_name:, order_mode:, members:, selected_members:, config_path:, family_mode: nil, branch_lanes: {}, release_target_branches: [], member_release_target_branches: {}, release_mode: nil, release_resume_arguments: [], command: nil, results: [], warnings: [], event_log_dirs: [], elapsed_seconds: nil)
|
|
@@ -682,6 +690,7 @@ module Kettle
|
|
|
682
690
|
end
|
|
683
691
|
|
|
684
692
|
def append_release_state_results(lines)
|
|
693
|
+
has_worktrees = release_state_has_worktrees?
|
|
685
694
|
lines << "release state:"
|
|
686
695
|
lines << " boolean columns:"
|
|
687
696
|
lines << " unrel: unreleased changelog entries are present (including replayed transfer entries)"
|
|
@@ -690,10 +699,12 @@ module Kettle
|
|
|
690
699
|
lines << " bump: unrel is yes and V.rb matches V.rel"
|
|
691
700
|
lines << " count columns:"
|
|
692
701
|
lines << " T(n): filter-aware kettle-jem transfer changelog lag; n is the total source entry count and row values are missing / applicable (x excluded-present)"
|
|
693
|
-
|
|
702
|
+
lines << " ^ / v / ~: commits ahead / behind latest release tag (remote in parentheses if different) / git state (- clean, + staged, ? untracked, * unstaged, ! conflict)"
|
|
703
|
+
lines << " wt: linked git worktrees (- none, N count, @ inside linked worktree, @+N inside one with N others)" if has_worktrees
|
|
704
|
+
rows = release_state_header(has_worktrees: has_worktrees)
|
|
694
705
|
shared_rows = {}
|
|
695
706
|
results.each do |result|
|
|
696
|
-
row = release_state_row(result)
|
|
707
|
+
row = release_state_row(result, has_worktrees: has_worktrees)
|
|
697
708
|
state = result.state || {}
|
|
698
709
|
shared_root = state["shared_changelog_root"]
|
|
699
710
|
if shared_root
|
|
@@ -701,7 +712,7 @@ module Kettle
|
|
|
701
712
|
# member versions, registry state, transfer filters and flags intact.
|
|
702
713
|
key = [shared_root, result.branch, state["latest_released"]]
|
|
703
714
|
offset = release_state_has_branches? ? 1 : 0
|
|
704
|
-
shared_columns = [1, 3, 5, 7]
|
|
715
|
+
shared_columns = has_worktrees ? [1, 3, 5, 7, 8] : [1, 3, 5, 7]
|
|
705
716
|
if shared_rows.key?(key)
|
|
706
717
|
shared_columns.each do |column|
|
|
707
718
|
row[column + offset] = "-" if row[column + offset] == shared_rows[key][column + offset]
|
|
@@ -724,7 +735,7 @@ module Kettle
|
|
|
724
735
|
end
|
|
725
736
|
end
|
|
726
737
|
|
|
727
|
-
def release_state_row(result)
|
|
738
|
+
def release_state_row(result, has_worktrees: release_state_has_worktrees?)
|
|
728
739
|
state = result.state || {}
|
|
729
740
|
row = [
|
|
730
741
|
state.fetch("gem_name", result.member_name).to_s,
|
|
@@ -734,22 +745,27 @@ module Kettle
|
|
|
734
745
|
state.fetch("latest_released", nil).to_s.empty? ? "unknown" : state.fetch("latest_released").to_s,
|
|
735
746
|
release_state_github_release(state),
|
|
736
747
|
release_state_transfer_changelog_value(state),
|
|
737
|
-
release_state_ahead_behind(state)
|
|
748
|
+
release_state_ahead_behind(state)
|
|
749
|
+
]
|
|
750
|
+
row << release_state_worktree(state) if has_worktrees
|
|
751
|
+
row.concat([
|
|
738
752
|
yes_no(state.fetch("unreleased_entries", nil)),
|
|
739
753
|
yes_no(state.fetch("prepared_release_pending", nil)),
|
|
740
754
|
yes_no(state.fetch("pending_release", nil)),
|
|
741
755
|
yes_no(state.fetch("bump_release_pending", nil))
|
|
742
|
-
]
|
|
756
|
+
])
|
|
743
757
|
return row unless release_state_has_branches?
|
|
744
758
|
|
|
745
759
|
[result.branch.to_s.empty? ? "current" : result.branch.to_s, *row]
|
|
746
760
|
end
|
|
747
761
|
|
|
748
|
-
def release_state_header
|
|
749
|
-
|
|
750
|
-
|
|
762
|
+
def release_state_header(has_worktrees: release_state_has_worktrees?)
|
|
763
|
+
columns = ["gem", "checkout", "V.rb", "V.ch.md", "V.rel", "GH.rel", release_state_transfer_changelog_header, "^ / v / ~"]
|
|
764
|
+
columns << "wt" if has_worktrees
|
|
765
|
+
columns.concat(["unrel", "prep", "pend", "bump"])
|
|
766
|
+
return [columns] unless release_state_has_branches?
|
|
751
767
|
|
|
752
|
-
[["branch", *
|
|
768
|
+
[["branch", *columns]]
|
|
753
769
|
end
|
|
754
770
|
|
|
755
771
|
def release_state_transfer_changelog_header
|
|
@@ -795,9 +811,36 @@ module Kettle
|
|
|
795
811
|
def release_state_ahead_behind(state)
|
|
796
812
|
local_ahead = state.fetch("ahead", nil)
|
|
797
813
|
local_behind = state.fetch("behind", nil)
|
|
798
|
-
|
|
814
|
+
dirty = release_state_git_dirty_indicator(state)
|
|
815
|
+
if local_ahead.nil? && local_behind.nil?
|
|
816
|
+
return dirty ? "unknown / #{dirty}" : "unknown"
|
|
817
|
+
end
|
|
818
|
+
|
|
819
|
+
counts = "#{release_state_count(local_ahead, state.fetch("remote_ahead", nil))} / #{release_state_count(local_behind, state.fetch("remote_behind", nil))}"
|
|
820
|
+
dirty ? "#{counts} / #{dirty}" : counts
|
|
821
|
+
end
|
|
822
|
+
|
|
823
|
+
def release_state_git_dirty_indicator(state)
|
|
824
|
+
GIT_STATE_SYMBOLS[state.fetch("git_state", nil).to_s]
|
|
825
|
+
end
|
|
799
826
|
|
|
800
|
-
|
|
827
|
+
def release_state_has_worktrees?
|
|
828
|
+
results.any? do |result|
|
|
829
|
+
state = result.state || {}
|
|
830
|
+
state["git_worktree"] == true || state["git_linked_worktrees"].to_i.positive?
|
|
831
|
+
end
|
|
832
|
+
end
|
|
833
|
+
|
|
834
|
+
def release_state_worktree(state)
|
|
835
|
+
linked = state["git_linked_worktrees"].to_i
|
|
836
|
+
if state["git_worktree"] == true
|
|
837
|
+
others = [linked - 1, 0].max
|
|
838
|
+
others.positive? ? "@+#{others}" : "@"
|
|
839
|
+
elsif linked.positive?
|
|
840
|
+
linked.to_s
|
|
841
|
+
else
|
|
842
|
+
"-"
|
|
843
|
+
end
|
|
801
844
|
end
|
|
802
845
|
|
|
803
846
|
def release_state_count(local_value, remote_value)
|
|
@@ -76,44 +76,108 @@ module Kettle
|
|
|
76
76
|
@input = input
|
|
77
77
|
@output = output
|
|
78
78
|
@remind_every = remind_every
|
|
79
|
+
@gate_mutex = Mutex.new
|
|
80
|
+
@gate_condition = ConditionVariable.new
|
|
81
|
+
@active = false
|
|
82
|
+
@select_listeners = []
|
|
83
|
+
@active_selects = 0
|
|
79
84
|
end
|
|
80
85
|
|
|
81
86
|
def self.for_terminal(input: $stdin, output: $stderr)
|
|
82
87
|
new(input: input, output: output) if input.respond_to?(:tty?) && input.tty?
|
|
83
88
|
end
|
|
84
89
|
|
|
90
|
+
# Coordinates terminal stdin with any interactive CommandRunner that
|
|
91
|
+
# forwards stdin to a child process. Before prompting, TerminalPrompter
|
|
92
|
+
# wakes active IO.select loops and waits for them to drop stdin so two
|
|
93
|
+
# threads never compete on the same terminal fd.
|
|
94
|
+
def with_stdin_forwarder
|
|
95
|
+
reader, writer = IO.pipe
|
|
96
|
+
@gate_mutex.synchronize { @select_listeners << writer }
|
|
97
|
+
yield reader
|
|
98
|
+
ensure
|
|
99
|
+
@gate_mutex.synchronize { @select_listeners.delete(writer) } if writer
|
|
100
|
+
writer&.close unless writer&.closed?
|
|
101
|
+
reader&.close unless reader&.closed?
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
def enter_stdin_select
|
|
105
|
+
@gate_mutex.synchronize do
|
|
106
|
+
return false if @active
|
|
107
|
+
|
|
108
|
+
@active_selects += 1
|
|
109
|
+
true
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
def leave_stdin_select
|
|
114
|
+
@gate_mutex.synchronize do
|
|
115
|
+
yield if block_given? && !@active
|
|
116
|
+
ensure
|
|
117
|
+
@active_selects -= 1
|
|
118
|
+
@gate_condition.broadcast if @active_selects.zero?
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
|
|
85
122
|
# Blocks until the user presses Enter. An empty answer means "ask the
|
|
86
123
|
# vault again" (the broker retries the adapter), so the instructions
|
|
87
124
|
# say so, and a reminder repeats once a minute so a long-running release
|
|
88
125
|
# never looks like a silent hang.
|
|
89
126
|
def ask(operation:, reason: nil)
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
"
|
|
93
|
-
|
|
94
|
-
@output.puts("🔑 #{label} needed#{": #{reason}" if reason}")
|
|
95
|
-
@output.puts(" Action required: #{instructions}.")
|
|
96
|
-
@output.print("\a#{label}: ")
|
|
97
|
-
@output.flush
|
|
98
|
-
reminder = start_reminder(label, instructions)
|
|
99
|
-
loop do
|
|
100
|
-
value = read_line
|
|
127
|
+
with_exclusive_stdin do
|
|
128
|
+
label = LABELS.fetch(operation, operation)
|
|
129
|
+
instructions = "paste the #{label} and press Enter (nothing is shown while you type or paste), " \
|
|
130
|
+
"or press Enter on an empty line to ask the vault again"
|
|
101
131
|
@output.puts
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
code, problem = sanitize_otp(value.to_s)
|
|
105
|
-
return code if problem.nil?
|
|
106
|
-
|
|
107
|
-
@output.puts("#{problem} Paste the #{label} again (or press Enter on an empty line to ask the vault again).")
|
|
132
|
+
@output.puts("🔑 #{label} needed#{": #{reason}" if reason}")
|
|
133
|
+
@output.puts(" Action required: #{instructions}.")
|
|
108
134
|
@output.print("\a#{label}: ")
|
|
109
135
|
@output.flush
|
|
136
|
+
reminder = start_reminder(label, instructions)
|
|
137
|
+
begin
|
|
138
|
+
loop do
|
|
139
|
+
value = read_line
|
|
140
|
+
@output.puts
|
|
141
|
+
return value.to_s.chomp unless operation == "rubygems_otp"
|
|
142
|
+
|
|
143
|
+
code, problem = sanitize_otp(value.to_s)
|
|
144
|
+
return code if problem.nil?
|
|
145
|
+
|
|
146
|
+
@output.puts("#{problem} Paste the #{label} again (or press Enter on an empty line to ask the vault again).")
|
|
147
|
+
@output.print("\a#{label}: ")
|
|
148
|
+
@output.flush
|
|
149
|
+
end
|
|
150
|
+
ensure
|
|
151
|
+
reminder&.kill
|
|
152
|
+
reminder&.join(1)
|
|
153
|
+
end
|
|
110
154
|
end
|
|
111
|
-
ensure
|
|
112
|
-
reminder&.kill
|
|
113
155
|
end
|
|
114
156
|
|
|
115
157
|
private
|
|
116
158
|
|
|
159
|
+
def with_exclusive_stdin
|
|
160
|
+
@gate_mutex.synchronize do
|
|
161
|
+
@active = true
|
|
162
|
+
wake_select_listeners_locked
|
|
163
|
+
@gate_condition.wait(@gate_mutex) while @active_selects.positive?
|
|
164
|
+
end
|
|
165
|
+
yield
|
|
166
|
+
ensure
|
|
167
|
+
@gate_mutex.synchronize do
|
|
168
|
+
@active = false
|
|
169
|
+
wake_select_listeners_locked
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
def wake_select_listeners_locked
|
|
174
|
+
@select_listeners.each do |writer|
|
|
175
|
+
writer.write_nonblock(".")
|
|
176
|
+
rescue IO::WaitWritable, IOError, Errno::EPIPE
|
|
177
|
+
nil
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
|
|
117
181
|
def read_line
|
|
118
182
|
@input.respond_to?(:noecho) ? @input.noecho(&:gets) : @input.gets
|
|
119
183
|
end
|
|
@@ -5,7 +5,7 @@ module Kettle
|
|
|
5
5
|
# Version namespace for this gem.
|
|
6
6
|
module Version
|
|
7
7
|
# Current gem version.
|
|
8
|
-
VERSION = "1.3.
|
|
8
|
+
VERSION = "1.3.52"
|
|
9
9
|
end
|
|
10
10
|
# Current gem version exposed at the traditional constant location.
|
|
11
11
|
VERSION = Version::VERSION # Traditional Constant Location
|
|
@@ -240,11 +240,13 @@ module Kettle
|
|
|
240
240
|
def with_release_secrets_broker
|
|
241
241
|
return yield unless release_secrets_broker_required?
|
|
242
242
|
|
|
243
|
-
@
|
|
243
|
+
@release_secrets_prompter = Secrets::TerminalPrompter.for_terminal
|
|
244
|
+
@release_secrets_broker = Secrets::Broker.new(provider: @secrets_provider, root: config.root, prompter: @release_secrets_prompter).start
|
|
244
245
|
yield
|
|
245
246
|
ensure
|
|
246
247
|
@release_secrets_broker&.close
|
|
247
248
|
@release_secrets_broker = nil
|
|
249
|
+
@release_secrets_prompter = nil
|
|
248
250
|
end
|
|
249
251
|
|
|
250
252
|
def release_secrets_broker_required?
|
|
@@ -3302,10 +3304,18 @@ module Kettle
|
|
|
3302
3304
|
# coordinator here can make a family-level gem retry look successful
|
|
3303
3305
|
# while skipping the child's checksums and GitHub release steps.
|
|
3304
3306
|
otp_coordinator: nil,
|
|
3307
|
+
forward_stdin: release_command_forward_stdin?,
|
|
3308
|
+
stdin_gate: @release_secrets_prompter,
|
|
3305
3309
|
mise_adapter: @mise_adapter
|
|
3306
3310
|
)
|
|
3307
3311
|
end
|
|
3308
3312
|
|
|
3313
|
+
def release_command_forward_stdin?
|
|
3314
|
+
return false if @release_secrets_broker && release_command_uses_kettle_release_yes?
|
|
3315
|
+
|
|
3316
|
+
true
|
|
3317
|
+
end
|
|
3318
|
+
|
|
3309
3319
|
def parallel_release_members?(release_members)
|
|
3310
3320
|
execute &&
|
|
3311
3321
|
release_jobs(release_members) > 1 &&
|
|
@@ -4799,8 +4809,9 @@ module Kettle
|
|
|
4799
4809
|
# release event handler.
|
|
4800
4810
|
@release_progress.update(
|
|
4801
4811
|
member,
|
|
4802
|
-
status: github_release_event_label(event),
|
|
4812
|
+
status: github_release_event_label(event, include_count: false),
|
|
4803
4813
|
mark: github_release_event_mark(event),
|
|
4814
|
+
secondary: release_event_secondary_progress(event),
|
|
4804
4815
|
key: member.name,
|
|
4805
4816
|
label: member.name
|
|
4806
4817
|
)
|
|
@@ -5956,7 +5967,7 @@ module Kettle
|
|
|
5956
5967
|
when "command_step"
|
|
5957
5968
|
command_step_event_label(event)
|
|
5958
5969
|
when "secret_provider"
|
|
5959
|
-
secret_provider_event_label(event)
|
|
5970
|
+
secret_provider_event_label(event, include_count: false)
|
|
5960
5971
|
when "remote_parity"
|
|
5961
5972
|
remote_parity_event_label(event)
|
|
5962
5973
|
when "ci_monitor"
|
|
@@ -5966,9 +5977,9 @@ module Kettle
|
|
|
5966
5977
|
when "changelog"
|
|
5967
5978
|
changelog_event_label(event)
|
|
5968
5979
|
when "release_lockfile"
|
|
5969
|
-
release_lockfile_event_label(event)
|
|
5980
|
+
release_lockfile_event_label(event, include_count: false)
|
|
5970
5981
|
when "release_probe"
|
|
5971
|
-
release_probe_event_label(event)
|
|
5982
|
+
release_probe_event_label(event, include_count: false)
|
|
5972
5983
|
when "diagnostic"
|
|
5973
5984
|
diagnostic_event_label(event)
|
|
5974
5985
|
when "summary"
|
|
@@ -5979,10 +5990,17 @@ module Kettle
|
|
|
5979
5990
|
end
|
|
5980
5991
|
|
|
5981
5992
|
def release_event_secondary_progress(event)
|
|
5982
|
-
|
|
5983
|
-
|
|
5993
|
+
[
|
|
5994
|
+
[event["completed"], event["total"]],
|
|
5995
|
+
[event["attempt"], event["attempts"]],
|
|
5996
|
+
[event["queued"], event["total"]]
|
|
5997
|
+
].each do |current, total|
|
|
5998
|
+
next unless current.is_a?(Integer) && total.is_a?(Integer)
|
|
5999
|
+
next if current.negative? || total <= 0
|
|
5984
6000
|
|
|
5985
|
-
|
|
6001
|
+
return "(#{current}/#{total})"
|
|
6002
|
+
end
|
|
6003
|
+
nil
|
|
5986
6004
|
end
|
|
5987
6005
|
|
|
5988
6006
|
def release_event_status_mark(event)
|
|
@@ -6027,7 +6045,7 @@ module Kettle
|
|
|
6027
6045
|
end
|
|
6028
6046
|
end
|
|
6029
6047
|
|
|
6030
|
-
def secret_provider_event_label(event)
|
|
6048
|
+
def secret_provider_event_label(event, include_count: true)
|
|
6031
6049
|
action = event["action"].to_s
|
|
6032
6050
|
purpose = event["purpose"].to_s
|
|
6033
6051
|
label = event["label"].to_s
|
|
@@ -6037,7 +6055,7 @@ module Kettle
|
|
|
6037
6055
|
parts << purpose unless purpose.empty?
|
|
6038
6056
|
parts << label unless label.empty?
|
|
6039
6057
|
parts << source if purpose.empty? && label.empty? && !source.empty?
|
|
6040
|
-
parts << "#{event["queued"]}/#{event["total"]}" if event["queued"] && event["total"]
|
|
6058
|
+
parts << "#{event["queued"]}/#{event["total"]}" if include_count && event["queued"] && event["total"]
|
|
6041
6059
|
parts.join(":")
|
|
6042
6060
|
end
|
|
6043
6061
|
|
|
@@ -6101,33 +6119,33 @@ module Kettle
|
|
|
6101
6119
|
parts.join(":")
|
|
6102
6120
|
end
|
|
6103
6121
|
|
|
6104
|
-
def release_lockfile_event_label(event)
|
|
6122
|
+
def release_lockfile_event_label(event, include_count: true)
|
|
6105
6123
|
action = event["action"].to_s
|
|
6106
6124
|
stage = event["stage"].to_s
|
|
6107
6125
|
stage = stage.tr(" ", "_")
|
|
6108
6126
|
parts = ["lockfile"]
|
|
6109
6127
|
parts << action unless action.empty?
|
|
6110
6128
|
parts << stage unless stage.empty?
|
|
6111
|
-
parts << "#{event["attempt"]}/#{event["attempts"]}" if event["attempt"] && event["attempts"]
|
|
6129
|
+
parts << "#{event["attempt"]}/#{event["attempts"]}" if include_count && event["attempt"] && event["attempts"]
|
|
6112
6130
|
parts.join(":")
|
|
6113
6131
|
end
|
|
6114
6132
|
|
|
6115
|
-
def release_probe_event_label(event)
|
|
6133
|
+
def release_probe_event_label(event, include_count: true)
|
|
6116
6134
|
action = event["action"].to_s
|
|
6117
6135
|
gem_name = event["gem"].to_s
|
|
6118
6136
|
version = event["version"].to_s
|
|
6119
6137
|
parts = ["probe"]
|
|
6120
6138
|
parts << action unless action.empty?
|
|
6121
6139
|
parts << [gem_name, version].reject(&:empty?).join("-")
|
|
6122
|
-
parts << "#{event["attempt"]}/#{event["attempts"]}" if event["attempt"] && event["attempts"]
|
|
6140
|
+
parts << "#{event["attempt"]}/#{event["attempts"]}" if include_count && event["attempt"] && event["attempts"]
|
|
6123
6141
|
parts.reject(&:empty?).join(":")
|
|
6124
6142
|
end
|
|
6125
6143
|
|
|
6126
|
-
def github_release_event_label(event)
|
|
6144
|
+
def github_release_event_label(event, include_count: true)
|
|
6127
6145
|
parts = ["github_release", event["action"].to_s]
|
|
6128
6146
|
asset = event["asset"].to_s
|
|
6129
6147
|
parts << asset unless asset.empty?
|
|
6130
|
-
parts << "#{event["attempt"]}/#{event["attempts"]}" if event["attempt"] && event["attempts"]
|
|
6148
|
+
parts << "#{event["attempt"]}/#{event["attempts"]}" if include_count && event["attempt"] && event["attempts"]
|
|
6131
6149
|
parts.reject(&:empty?).join(":")
|
|
6132
6150
|
end
|
|
6133
6151
|
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kettle-family
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.3.
|
|
4
|
+
version: 1.3.52
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Peter H. Boling
|
|
@@ -200,7 +200,7 @@ dependencies:
|
|
|
200
200
|
-
|
|
201
201
|
- ">="
|
|
202
202
|
- !ruby/object:Gem::Version
|
|
203
|
-
version: 3.1.
|
|
203
|
+
version: 3.1.33
|
|
204
204
|
type: :runtime
|
|
205
205
|
prerelease: false
|
|
206
206
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -212,7 +212,7 @@ dependencies:
|
|
|
212
212
|
-
|
|
213
213
|
- ">="
|
|
214
214
|
- !ruby/object:Gem::Version
|
|
215
|
-
version: 3.1.
|
|
215
|
+
version: 3.1.33
|
|
216
216
|
- !ruby/object:Gem::Dependency
|
|
217
217
|
name: kettle-gha-pins
|
|
218
218
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -729,10 +729,10 @@ licenses:
|
|
|
729
729
|
- AGPL-3.0-only
|
|
730
730
|
metadata:
|
|
731
731
|
homepage_uri: "https://structuredmerge.org"
|
|
732
|
-
source_code_uri: "https://github.com/kettle-dev/kettle-family/tree/v1.3.
|
|
733
|
-
changelog_uri: "https://github.com/kettle-dev/kettle-family/blob/v1.3.
|
|
732
|
+
source_code_uri: "https://github.com/kettle-dev/kettle-family/tree/v1.3.52"
|
|
733
|
+
changelog_uri: "https://github.com/kettle-dev/kettle-family/blob/v1.3.52/CHANGELOG.md"
|
|
734
734
|
bug_tracker_uri: "https://github.com/kettle-dev/kettle-family/issues"
|
|
735
|
-
documentation_uri: "https://www.rubydoc.info/gems/kettle-family/1.3.
|
|
735
|
+
documentation_uri: "https://www.rubydoc.info/gems/kettle-family/1.3.52"
|
|
736
736
|
funding_uri: "https://github.com/sponsors/pboling"
|
|
737
737
|
wiki_uri: "https://github.com/kettle-dev/kettle-family/wiki"
|
|
738
738
|
news_uri: "https://www.railsbling.com/tags/kettle-family"
|
metadata.gz.sig
CHANGED
|
Binary file
|