kettle-family 1.3.41 → 1.3.43

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: c447f402b39dce0119480390f5387a010ce81d6f3a317181bfa60b23a2558a8b
4
- data.tar.gz: 1fe9cbe8c6bafefeb2056be1327b15f9911d3ba44abd70d71802fd985be1e3cb
3
+ metadata.gz: ee70dc05d6421e96d35aa6af3c337c438689937f84ab20e5ed0b77a164b1fd67
4
+ data.tar.gz: 2039cc587b2671f469eeefa05a3d5c9d161fe06574470c1637b3fb9cd0de603b
5
5
  SHA512:
6
- metadata.gz: d7934dce11df54417a7e8d3aeda4c1a76125b27af6f3d2f8d23b1b386c2229f50e3740404f7fd208be8392f7f443cf4e0a47286d9d2345fac25b1fba4b1cf0ca
7
- data.tar.gz: 7893ecc55408679881af1dc077669aedda8e2b021261fc7babc24cf62520708ee044c9965da834054e9b2bafc03432814f0aa56d54da7102c5d798a5be7c377d
6
+ metadata.gz: 725abb6986692d631be4fed49436b2891d7a9a1864b96a66e87d8739ad499b84bdae82f042f8dc6f6f681f08f8980a5fff53d5a70cf89241119cb5d50a69847e
7
+ data.tar.gz: e0c2eee2607bc797fbf5d3508b8b1f4e930dceaeecb3dbf5c0f9846d3388df63112bd19c244b41a1d8b6207a12cbb763b494b227b3a987bb01245403bf0bc33c
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -30,6 +30,49 @@ Please file a bug if you notice a violation of semantic versioning.
30
30
 
31
31
  ### Security
32
32
 
33
+ ## [1.3.43] - 2026-11-15
34
+
35
+ - TAG: [v1.3.43][1.3.43t]
36
+ - COVERAGE: 94.05% -- 8279/8803 lines in 46 files
37
+ - BRANCH COVERAGE: 78.71% -- 3439/4369 branches in 46 files
38
+ - 40.81% documented
39
+
40
+ ### Changed
41
+
42
+ - `pull` and `up` temporarily stash member worktree changes before syncing and restore them afterward. `up` pushes the rebased commits before restoring the stash. If restoring a stash containing only `Gemfile.lock` fails, the pulled lockfile is left clean, the stash is retained for recovery, and the family run continues with a warning. (#67)
43
+
44
+ ### Fixed
45
+
46
+ - A release tooling bundle check repaired by `bundle install` no longer causes a false failure summary or an unnecessary release resume command. (#65, #66)
47
+ - Correct the README command reference, release-state selectors, release profiles, and template dirty-file rules; document `pull` and `up` stash recovery.
48
+
49
+ ## [1.3.42] - 2026-11-15
50
+
51
+ - TAG: [v1.3.42][1.3.42t]
52
+ - COVERAGE: 94.22% -- 8235/8740 lines in 46 files
53
+ - BRANCH COVERAGE: 79.06% -- 3416/4321 branches in 46 files
54
+ - 40.81% documented
55
+
56
+ ### Added
57
+
58
+ - Parallel release waves update the Ruby advisory database once, serially, before fan-out (`bundle audit update`; failure is a warning) and pass `KETTLE_DEV_SKIP_AUDIT_UPDATE=true` to member releases, avoiding "cannot lock ref" races in the shared `ruby-advisory-db`. Disable with `release.advisory_db_update: false` or `KETTLE_FAMILY_SKIP_AUDIT_UPDATE=true`. (#38)
59
+
60
+ ### Changed
61
+
62
+ - [kc] kettle-jem/prepare: updated 9 project files:
63
+ - dependencies (9)
64
+
65
+ - [kc] kettle-jem/template: updated 6 project files:
66
+ - code and tests (1)
67
+ - dependencies (2)
68
+ - documentation (1)
69
+ - other (1)
70
+ - workflows (1)
71
+
72
+ ### Fixed
73
+
74
+ - Parallel release waves no longer start unless every Bundler version a member may use is installed and complete (`exe/bundle`, `lib/bundler.rb`, `lib/bundler/setup.rb` present). The prewarm now scans nested lockfiles (e.g. `gemfiles/**`), surfaces `gem install` failures instead of swallowing them, pre-installs the registry-latest stable Bundler that a member's release would otherwise install mid-wave, and aborts before fan-out, preventing `LoadError` under `bundler-X/lib/bundler` when members install Bundler into the shared gem dir concurrently. (#38)
75
+
33
76
  ## [1.3.41] - 2026-11-10
34
77
 
35
78
  - TAG: [v1.3.41][1.3.41t]
@@ -3418,7 +3461,11 @@ Please file a bug if you notice a violation of semantic versioning.
3418
3461
  - Fixed CI load failures on engines without compatible `pty` support by falling back to Open3 for interactive release commands.
3419
3462
  - Fixed Ruby 3.2 version-bump support by loading Prism lazily and wiring the Prism gem only for MRI versions that need it.
3420
3463
 
3421
- [Unreleased]: https://github.com/kettle-dev/kettle-family/compare/v1.3.41...HEAD
3464
+ [Unreleased]: https://github.com/kettle-dev/kettle-family/compare/v1.3.43...HEAD
3465
+ [1.3.43]: https://github.com/kettle-dev/kettle-family/compare/v1.3.42...v1.3.43
3466
+ [1.3.43t]: https://github.com/kettle-dev/kettle-family/releases/tag/v1.3.43
3467
+ [1.3.42]: https://github.com/kettle-dev/kettle-family/compare/v1.3.41...v1.3.42
3468
+ [1.3.42t]: https://github.com/kettle-dev/kettle-family/releases/tag/v1.3.42
3422
3469
  [1.3.41]: https://github.com/kettle-dev/kettle-family/compare/v1.3.40...v1.3.41
3423
3470
  [1.3.41t]: https://github.com/kettle-dev/kettle-family/releases/tag/v1.3.41
3424
3471
  [1.3.40]: https://github.com/kettle-dev/kettle-family/compare/v1.3.39...v1.3.40
data/README.md CHANGED
@@ -330,6 +330,11 @@ refresh. These temporary lockfiles are not committed; this is an optional
330
330
  early registry-resolution gate for coordinated releases where waiting for CI
331
331
  would be too late to discover an incompatible dependency floor.
332
332
 
333
+ Parallel waves (`release.jobs` > 1) update the Ruby advisory database once,
334
+ serially, before fan-out (`bundle audit update`; failure is only a warning) and
335
+ pass `KETTLE_DEV_SKIP_AUDIT_UPDATE=true` to member releases so they do not each
336
+ `git pull` the shared `ruby-advisory-db`. Disable with
337
+ `release.advisory_db_update: false` or `KETTLE_FAMILY_SKIP_AUDIT_UPDATE=true`.
333
338
  This propagation runs for `kettle-family release --execute --publish` when
334
339
  `release.auto_dependency_floors` is enabled (the default). It is distinct from
335
340
  `release.normalize_lockfiles`, which removes local-path and checksum problems
@@ -476,6 +481,7 @@ The command names below are available from `kettle-family --help`:
476
481
  | `version` | Print the kettle-family version. |
477
482
  | `help` | Print top-level or command-specific help. |
478
483
  | `mise-trust` | Trust mise configuration for the family. |
484
+ | `mise-tasks` | Refresh managed family mise tasks and migrate standard root task definitions. |
479
485
  | `discover` | Discover members and print their execution order. |
480
486
  | `plan` | Alias for `discover`. |
481
487
  | `report` | Print family discovery and configuration details. |
@@ -484,7 +490,7 @@ The command names below are available from `kettle-family --help`:
484
490
  | `clean-unreleased` | Uninstall locally installed family versions newer than released versions. |
485
491
  | `clean-blockers` | Uninstall unreleased gems, from any family, pinned by members' lockfiles — removes cross-family blockers such as an unreleased StructuredMerge gem pinned by a kettle-dev member. |
486
492
  | `clean-installed` | The deterministic inverse of `install`: uninstall each selected member's current source version (plus configured install local dependencies) when that version is unreleased, including cached `.gem` files. Sees installed-but-unpinned pollution the other two cleanups miss. |
487
- | `reconcile-releases` | Create verified missing GitHub Releases for published tags. |
493
+ | `reconcile-releases` | Check for missing GitHub Releases; `--execute` creates verified backfills. |
488
494
  | `reset` | Reset a managed family artifact, such as release lockfiles. |
489
495
  | `test` | Run the configured test workflow for each selected member. |
490
496
  | `lint` | Run the configured lint workflow for each selected member. |
@@ -511,6 +517,14 @@ The command names below are available from `kettle-family --help`:
511
517
  Use `kettle-family help COMMAND` for command-specific options. Most workflow
512
518
  commands also accept `--only`, `--exclude`, `--start-at`, `--jobs`,
513
519
  `--execute`, `--dry-run`, `--commit`, and `--no-commit` as applicable.
520
+ `test` and ordinary `template` runs do not accept a positional `--start-at`:
521
+ use `--only` or the report's retry hint because their parallel dispatch is not
522
+ positional. `template` also accepts `MEMBER@BRANCH` for a branch-stack resume.
523
+
524
+ `mise-tasks` writes its managed task file and updates `mise.toml` directly; it
525
+ does not require `--execute`. It warns about duplicate task definitions by
526
+ default. Use `--clean` to remove those duplicates from the root configuration,
527
+ or `--task-file PATH` to choose a different managed task file.
514
528
 
515
529
  Inspect discovery and release plans before executing them:
516
530
 
@@ -562,8 +576,8 @@ The supported release-state tokens are:
562
576
 
563
577
  | Token | Meaning |
564
578
  |-------|---------|
565
- | `unreleased` | The current `version.rb` is not the latest published gem version. |
566
- | `prepared` | The changelog already has a versioned section for the current `version.rb`. |
579
+ | `unreleased` | The `Unreleased` changelog section contains entries. |
580
+ | `prepared` | The latest versioned changelog section matches the current `version.rb`. |
567
581
  | `pending` | The member has unreleased changelog work or an unpublished prepared release. |
568
582
  | `bump` | The member has unreleased changelog work and still needs a version bump. |
569
583
 
@@ -584,6 +598,14 @@ Most commands accept `--json` to print a machine-readable report instead of the
584
598
  text report, and `--report PATH` to write that JSON report while still printing
585
599
  the normal text report.
586
600
 
601
+ `pull --execute` and `up --execute` temporarily stash tracked and untracked
602
+ member changes before pulling with rebase. `up` pushes the rebased commits
603
+ before restoring the stash. If restoration fails for a stash containing only
604
+ the root `Gemfile.lock`, the pulled lockfile is left clean and the stash is
605
+ retained; the report identifies it and provides recovery commands. The member
606
+ is reported with a warning and the run continues. Other restore failures stop
607
+ the run, as do pull or push failures. `push` alone does not stash changes.
608
+
587
609
  Refresh member dependencies before templating when the generated project should
588
610
  be validated against the latest compatible releases:
589
611
 
@@ -657,14 +679,14 @@ and leaves RubyGems MFA prompts interactive by default:
657
679
  kettle-family release --publish --execute
658
680
  ```
659
681
 
660
- Release uses two explicitly separate execution contexts. `release_bootstrap`
682
+ Release uses explicitly separate execution contexts. `release_bootstrap`
661
683
  starts `kettle-release` from the family-root tool bundle, so a family can retain
662
684
  its configured local sibling graph while it prepares a release wave. It never
663
- uses a member's development Gemfile to boot the release tool. `release_registry`
664
- then resets each tracked release lockfile against registry dependencies and is
665
- also used by every project release child command. Local sibling paths therefore
666
- remain available only before that transition; they cannot enter the canonical
667
- lockfile, the release-preparation commit, or CI-facing project commands.
685
+ uses a member's development Gemfile to boot the release tool. The
686
+ `release_registry` profile uses registry dependencies for the canonical release
687
+ lockfile. Explicit monorepo CI-local paths and configured wave transitions use
688
+ separate profiles with their own permitted-path rules; see
689
+ [Execution Profiles](EXECUTION_PROFILES.md) for those exceptions.
668
690
 
669
691
  Use named recovery modes when a publish wave has already prepared a member:
670
692
 
@@ -688,14 +710,16 @@ family changelog commands and child `kettle-release` commands. Use
688
710
  `--no-accept` when you want each child command to ask its own confirmation
689
711
  prompts.
690
712
 
691
- Executed publish runs can opt in to the local 1Password CLI for unattended
692
- release credentials. The gem signing passphrase is loaded once and cached only
693
- in memory for the current `kettle-family` process. When the publish command is
694
- `kettle-release`, `kettle-family` watches the child release process and answers
695
- signing and RubyGems MFA prompts itself, so long releases do not reuse a stale
696
- TOTP from release startup. If a publish command explicitly includes
697
- `--secrets-provider`, that child `kettle-release` owns its own provider
698
- interaction instead.
713
+ Executed publish runs can use 1Password, Bitwarden (`bitwarden`, `bw`, or
714
+ `vaultwarden`), `rbw`, or a configured `command` adapter for release
715
+ credentials. Adapters can also be registered through `Secrets::Registry`.
716
+ The signing passphrase is cached in memory for the family run; RubyGems OTPs
717
+ are requested fresh. Where the installed `kettle-release` supports direct
718
+ secrets and 1Password is selected, the child requests secrets through the
719
+ family broker. Otherwise the family runner handles supported prompts. An
720
+ explicit child `--secrets-provider` controls that child's provider interaction.
721
+
722
+ For example, configure the local 1Password CLI:
699
723
 
700
724
  ```yaml
701
725
  release:
@@ -776,10 +800,11 @@ registry dependency chain. Members with their own `CHANGELOG.md` retain the
776
800
  normal dependency.
777
801
 
778
802
  Resume a failed family publish after fixing the failure. Already published
779
- versions are skipped automatically. A release report gives a member-scoped
780
- resume command for each failed child, including the recorded `--start-step`
781
- when the child emitted a failed release-step event. Run those commands one at a
782
- time. If any members were never started, the report also gives a separate
803
+ versions are skipped automatically. A release report gives member-scoped
804
+ resume commands for failed children, including the recorded `--start-step`
805
+ when a child emitted a failed release-step event. Members with the same recovery
806
+ step may be grouped into one command. Run the commands one at a time. If any
807
+ members were never started, the report also gives a separate
783
808
  normal-flow command for exactly those members. Use `--start-step` only after
784
809
  the pre-release gate already passed or the failure was intentionally handled:
785
810
 
@@ -846,8 +871,10 @@ successful or unreached members are restored normally. A successful run always
846
871
  restores its autostashes regardless of this option.
847
872
 
848
873
  Before creating any autostash, the workflow checks every selected member
849
- checkout. Automatic stashing is allowed only when all dirty paths are under
850
- `lib/`, `spec/`, or `test/`; changes elsewhere, including changelogs, lockfiles,
874
+ checkout. Changes under `lib/`, `spec/`, and `test/` are eligible for stashing.
875
+ Managed `Gemfile.lock`, `Appraisal.root.gemfile.lock`,
876
+ `.structuredmerge/kettle-jem.lock`, and modular `*_local.gemfile` paths are
877
+ also allowed and are left in place. Other dirty paths, including changelogs,
851
878
  configuration, and generated workflow files, fail the run before templating
852
879
  starts and are listed in the error. This preflight is separate from
853
880
  `--no-cleanup`: the latter preserves a failed template for debugging, while
@@ -1110,7 +1137,7 @@ If none of the available licenses suit your use case, please [contact us](mailto
1110
1137
  [📌gitmoji]: https://gitmoji.dev
1111
1138
  [📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
1112
1139
  [🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
1113
- [🧮kloc-img]: https://img.shields.io/badge/KLOC-8.530-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
1140
+ [🧮kloc-img]: https://img.shields.io/badge/KLOC-8.803-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
1114
1141
  [🔐security]: https://github.com/kettle-dev/kettle-family/blob/main/SECURITY.md
1115
1142
  [🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
1116
1143
  [📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
@@ -12,6 +12,8 @@ module Kettle
12
12
  include CommandKit::Commands
13
13
 
14
14
  COMMANDS = %w[version mise-trust mise-tasks discover plan report metadata check clean-blockers clean-installed clean-unreleased reconcile-releases reset test lint docs template gha-sha-pins bup bupb update-bundler bex install bump bump-version add-changelog release push pull sync up branch-lanes release-state state].freeze
15
+ EVENT_COMMANDS = %w[bup bupb update-bundler up push pull sync test install lint docs bex check reset clean-unreleased clean-blockers clean-installed bump bump-version add-changelog mise-trust reconcile-releases].freeze
16
+ PROGRESS_COMMANDS = (%w[release template gha-sha-pins] + EVENT_COMMANDS).freeze
15
17
  WORKFLOW_COMMANDS = %w[check reset test lint docs template gha-sha-pins bup bupb update-bundler bex release push pull sync up].freeze
16
18
 
17
19
  command_name "kettle-family"
@@ -1047,16 +1049,16 @@ module Kettle
1047
1049
  end
1048
1050
 
1049
1051
  def command_results_for_current_branch(command:, config:, members:, options:, family_members: members, start_at: StartAt.new(nil, nil), state_event_handler: nil, state_event_tape: nil, release_state_results: nil)
1050
- return mise_trust_results(config: config, members: members) if command == "mise-trust"
1051
- return bump_version_results(config: config, members: members, options: options, phase: command, release_state_results: release_state_results) if %w[bump bump-version].include?(command)
1052
- return add_changelog_results(config: config, members: members, options: options) if command == "add-changelog"
1053
- return clean_unreleased_results(config: config, members: members, options: options) if command == "clean-unreleased"
1054
- return clean_blockers_results(members: members, options: options) if command == "clean-blockers"
1055
- return clean_installed_results(config: config, members: members, options: options) if command == "clean-installed"
1056
- return reconcile_release_results(config: config, members: members, options: options) if command == "reconcile-releases"
1052
+ return mise_trust_results(config: config, members: members, options: options, event_tape: state_event_tape) if command == "mise-trust"
1053
+ return bump_version_results(config: config, members: members, options: options, phase: command, release_state_results: release_state_results, event_tape: state_event_tape) if %w[bump bump-version].include?(command)
1054
+ return add_changelog_results(config: config, members: members, options: options, event_tape: state_event_tape) if command == "add-changelog"
1055
+ return clean_unreleased_results(config: config, members: members, options: options, event_tape: state_event_tape) if command == "clean-unreleased"
1056
+ return clean_blockers_results(members: members, options: options, event_tape: state_event_tape) if command == "clean-blockers"
1057
+ return clean_installed_results(config: config, members: members, options: options, event_tape: state_event_tape) if command == "clean-installed"
1058
+ return reconcile_release_results(config: config, members: members, options: options, event_tape: state_event_tape) if command == "reconcile-releases"
1057
1059
  return branch_lane_results(config: config, members: members) if command == "branch-lanes"
1058
1060
  return release_state_results(config: config, members: members, jobs: options[:jobs], event_handler: state_event_handler) if command == "release-state"
1059
- return install_results(config: config, members: members, options: options) if command == "install"
1061
+ return install_results(config: config, members: members, options: options, event_tape: state_event_tape) if command == "install"
1060
1062
  return [] unless WORKFLOW_COMMANDS.include?(command)
1061
1063
 
1062
1064
  Workflow.new(
@@ -1108,15 +1110,21 @@ module Kettle
1108
1110
  ).results
1109
1111
  end
1110
1112
 
1111
- def mise_trust_results(config:, members:)
1113
+ def mise_trust_results(config:, members:, options: {}, event_tape: nil)
1112
1114
  adapter = Kettle::Family.mise_adapter
1113
1115
  roots = [config.root, *members.map(&:root)].uniq
1114
1116
  runner = CommandRunner.new(execute: true, accept: true)
1115
- roots.map.with_index do |root, index|
1116
- member = members.find { |candidate| candidate.root == root } || Member.new("family", root, nil, nil, nil, [], [], nil, [], [])
1117
+ trust_members = roots.map { |root| members.find { |candidate| candidate.root == root } || Member.new("family", root, nil, nil, nil, [], [], nil, [], []) }
1118
+ reporter = MemberReporter.build(command: "mise-trust", members: trust_members, io: progress_io("mise-trust", options), tape: event_tape, execute: options[:execute])
1119
+ trust_members.map do |member|
1120
+ root = member.root
1121
+ reporter&.start_member(member, steps: 1)
1122
+ reporter&.step_started(member, "mise_trust")
1117
1123
  trust_argv = adapter.trust_argv(root)
1118
- unless trust_argv
1119
- next CommandResult.new(
1124
+ result = if trust_argv
1125
+ runner.call(member: member, phase: "mise_trust", command: trust_argv, env: {}, raw: true)
1126
+ else
1127
+ CommandResult.new(
1120
1128
  member_name: member.name,
1121
1129
  phase: "mise_trust",
1122
1130
  command: [],
@@ -1130,14 +1138,18 @@ module Kettle
1130
1138
  reason: "mise executable not available"
1131
1139
  )
1132
1140
  end
1133
- runner.call(member: member, phase: "mise_trust", command: trust_argv, env: {}, raw: true)
1141
+ reporter&.step_finished(member, "mise_trust", ok: result.ok?, elapsed_seconds: result.elapsed_seconds)
1142
+ reporter&.finish_member(member, success: result.ok?)
1143
+ result
1134
1144
  end
1145
+ ensure
1146
+ reporter&.finish
1135
1147
  end
1136
1148
 
1137
1149
  def progress_io(command, options)
1138
- return nil unless %w[release template gha-sha-pins bup bupb update-bundler].include?(command)
1150
+ return nil unless PROGRESS_COMMANDS.include?(command)
1139
1151
  return nil unless options[:execute]
1140
- return nil if options[:json] || (options[:events] && %w[bup bupb update-bundler].include?(command))
1152
+ return nil if options[:json] || (options[:events] && EVENT_COMMANDS.include?(command))
1141
1153
 
1142
1154
  stdout
1143
1155
  end
@@ -1436,7 +1448,16 @@ module Kettle
1436
1448
  StartAt.new(member, branch)
1437
1449
  end
1438
1450
 
1439
- def bump_version_results(config:, members:, options:, phase:, release_state_results: nil)
1451
+ def bump_version_results(config:, members:, options:, phase:, release_state_results: nil, event_tape: nil)
1452
+ reporter = MemberReporter.build(command: phase, members: members, io: progress_io(phase, options), tape: event_tape, execute: options[:execute])
1453
+ return guarded_bump_version_results(config: config, members: members, options: options, phase: phase, release_state_results: release_state_results) unless reporter
1454
+
1455
+ reporter.around_batch(phase) do
1456
+ guarded_bump_version_results(config: config, members: members, options: options, phase: phase, release_state_results: release_state_results)
1457
+ end
1458
+ end
1459
+
1460
+ def guarded_bump_version_results(config:, members:, options:, phase:, release_state_results:)
1440
1461
  require_relative "version_bump"
1441
1462
  require_relative "release_waves"
1442
1463
 
@@ -1642,22 +1663,29 @@ module Kettle
1642
1663
  Kettle::Dev::VersionBump.resolve_target_version(options[:target_version].to_s, current.to_s)
1643
1664
  end
1644
1665
 
1645
- def add_changelog_results(config:, members:, options:)
1666
+ def add_changelog_results(config:, members:, options:, event_tape: nil)
1646
1667
  section = options[:changelog_section].to_s
1647
1668
  entry = options[:changelog_entry].to_s
1648
1669
  raise Error, "add-changelog requires --section" if section.empty?
1649
1670
  raise Error, "add-changelog requires --entry" if entry.empty?
1650
1671
 
1651
1672
  runner = CommandRunner.new(execute: options[:execute])
1673
+ reporter = MemberReporter.build(command: "add-changelog", members: members, io: progress_io("add-changelog", options), tape: event_tape, execute: options[:execute])
1652
1674
  members.each_with_object([]) do |member, memo|
1675
+ reporter&.start_member(member, steps: 1)
1676
+ reporter&.step_started(member, "add-changelog")
1653
1677
  memo << runner.call(
1654
1678
  member: member,
1655
1679
  phase: "add-changelog",
1656
1680
  command: [installed_executable("kettle-changelog"), "--add-unreleased-entry", "--section", section, "--entry", entry],
1657
1681
  env: changelog_target_env(config: config, member: member)
1658
1682
  )
1683
+ reporter&.step_finished(member, "add-changelog", ok: memo.last.ok?, elapsed_seconds: memo.last.elapsed_seconds)
1684
+ reporter&.finish_member(member, success: memo.last.ok?)
1659
1685
  break memo unless memo.last.ok?
1660
1686
  end
1687
+ ensure
1688
+ reporter&.finish
1661
1689
  end
1662
1690
 
1663
1691
  # Changelogs go where the family config says they go: a shared-changelog
@@ -1704,24 +1732,36 @@ module Kettle
1704
1732
  BranchLaneAudit.new(config: config, members: members).results
1705
1733
  end
1706
1734
 
1707
- def clean_unreleased_results(config:, members:, options:)
1708
- UnreleasedGemCleanup.new(config: config, members: members, execute: options[:execute]).results
1735
+ def clean_unreleased_results(config:, members:, options:, event_tape: nil)
1736
+ batched_member_results("clean-unreleased", members, options, event_tape) do
1737
+ UnreleasedGemCleanup.new(config: config, members: members, execute: options[:execute]).results
1738
+ end
1709
1739
  end
1710
1740
 
1711
- def clean_blockers_results(members:, options:)
1712
- BlockerCleanup.new(members: members, execute: options[:execute]).results
1741
+ def clean_blockers_results(members:, options:, event_tape: nil)
1742
+ batched_member_results("clean-blockers", members, options, event_tape) do
1743
+ BlockerCleanup.new(members: members, execute: options[:execute]).results
1744
+ end
1745
+ end
1746
+
1747
+ def clean_installed_results(config:, members:, options:, event_tape: nil)
1748
+ batched_member_results("clean-installed", members, options, event_tape) do
1749
+ Kettle::Family::CleanInstalled.new(config: config, members: members, execute: options[:execute]).results
1750
+ end
1713
1751
  end
1714
1752
 
1715
- def clean_installed_results(config:, members:, options:)
1716
- CleanInstalled.new(config: config, members: members, execute: options[:execute]).results
1753
+ def batched_member_results(command, members, options, event_tape, &block)
1754
+ reporter = MemberReporter.build(command: command, members: members, io: progress_io(command, options), tape: event_tape, execute: options[:execute])
1755
+ reporter ? reporter.around_batch(command, &block) : block.call
1717
1756
  end
1718
1757
 
1719
- def reconcile_release_results(config:, members:, options:)
1720
- ReleaseReconciler.new(config: config, members: members, execute: options[:execute]).results
1758
+ def reconcile_release_results(config:, members:, options:, event_tape: nil)
1759
+ reporter = MemberReporter.build(command: "reconcile-releases", members: members, io: progress_io("reconcile-releases", options), tape: event_tape, execute: options[:execute])
1760
+ ReleaseReconciler.new(config: config, members: members, execute: options[:execute], reporter: reporter).results
1721
1761
  end
1722
1762
 
1723
- def install_results(config:, members:, options:)
1724
- LocalInstall.new(config: config, members: members, execute: options[:execute], jobs: options[:jobs]).results
1763
+ def install_results(config:, members:, options:, event_tape: nil)
1764
+ LocalInstall.new(config: config, members: members, execute: options[:execute], jobs: options[:jobs], progress_io: progress_io("install", options), event_tape: event_tape).results
1725
1765
  end
1726
1766
 
1727
1767
  def release_state_results(config:, members:, jobs: nil, event_handler: nil)
@@ -402,6 +402,12 @@ module Kettle
402
402
  fetch_path("release", "jobs")
403
403
  end
404
404
 
405
+ # Update the advisory database once, serially, before a parallel wave.
406
+ # Disabled with `release.advisory_db_update: false`.
407
+ def release_advisory_db_update?
408
+ fetch_path("release", "advisory_db_update") != false
409
+ end
410
+
405
411
  def release_waves
406
412
  Array(fetch_path("release", "waves")).map do |wave|
407
413
  Array(wave).map(&:to_s).map(&:strip).reject(&:empty?)
@@ -7,6 +7,7 @@ require "open3"
7
7
  require "time"
8
8
 
9
9
  require_relative "concurrency"
10
+ require_relative "member_reporter"
10
11
  require_relative "paths"
11
12
 
12
13
  module Kettle
@@ -14,7 +15,9 @@ module Kettle
14
15
  class LocalInstall
15
16
  include MemberLoader
16
17
 
17
- def initialize(config:, members:, execute: false, jobs: nil)
18
+ def initialize(config:, members:, execute: false, jobs: nil, progress_io: nil, event_tape: nil)
19
+ @progress_io = progress_io
20
+ @event_tape = event_tape
18
21
  @config = config
19
22
  @members = members
20
23
  @execute = execute
@@ -22,6 +25,7 @@ module Kettle
22
25
  end
23
26
 
24
27
  def results
28
+ @reporter = MemberReporter.build(command: "install", members: install_members, io: @progress_io, tape: @event_tape, execute: execute, jobs: install_jobs(install_members))
25
29
  results = if execute && install_jobs(install_members) > 1
26
30
  parallel_install_results
27
31
  else
@@ -29,6 +33,8 @@ module Kettle
29
33
  end
30
34
  write_local_install_marker if execute && results.all?(&:ok?)
31
35
  results
36
+ ensure
37
+ @reporter&.finish
32
38
  end
33
39
 
34
40
  private
@@ -122,16 +128,31 @@ module Kettle
122
128
  end
123
129
 
124
130
  def install_member(member)
131
+ @reporter&.start_member(member, steps: 2)
132
+ result = install_member_steps(member)
133
+ @reporter&.finish_member(member, success: result.ok?)
134
+ result
135
+ end
136
+
137
+ def install_member_steps(member)
125
138
  gem_path = local_gem_path(member)
126
139
  argv = install_argv(gem_path)
127
140
  return skipped_result(member: member, argv: argv) unless execute
128
141
 
129
142
  FileUtils.mkdir_p(File.dirname(gem_path))
130
143
  FileUtils.rm_f(gem_path)
144
+ @reporter&.step_started(member, "build")
131
145
  build_stdout, build_stderr, build_status = run(build_argv(member, gem_path), chdir: member.root)
132
- return failed_result(member: member, argv: build_argv(member, gem_path), stdout: build_stdout, stderr: build_stderr, status: build_status) unless build_status.success?
146
+ unless build_status.success?
147
+ failed = failed_result(member: member, argv: build_argv(member, gem_path), stdout: build_stdout, stderr: build_stderr, status: build_status)
148
+ @reporter&.step_finished(member, "build", ok: false)
149
+ return failed
150
+ end
151
+ @reporter&.step_finished(member, "build", ok: true)
133
152
 
153
+ @reporter&.step_started(member, "install")
134
154
  stdout, stderr, status = run(argv)
155
+ @reporter&.step_finished(member, "install", ok: status.success?)
135
156
  CommandResult.new(
136
157
  member_name: member.name,
137
158
  phase: "install",
@@ -0,0 +1,111 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "workflow_progress"
4
+
5
+ module Kettle
6
+ module Family
7
+ # Per-member progress for a workflow command: a live WorkflowProgress pane
8
+ # (when an IO is supplied) plus NDJSON events on the family event tape
9
+ # (member_start, command_step, member_complete). Thread-safe, so parallel
10
+ # workers can share one instance. Both outputs are optional.
11
+ class MemberReporter
12
+ def self.build(command:, members:, io:, tape:, execute:, jobs: 1)
13
+ return nil if !execute || (io.nil? && tape.nil?)
14
+
15
+ new(command: command, members: members, io: io, tape: tape, jobs: jobs)
16
+ end
17
+
18
+ def initialize(command:, members:, io: nil, tape: nil, jobs: 1)
19
+ @command = command
20
+ @members = members
21
+ @tape = tape
22
+ @completed = []
23
+ @failed = []
24
+ @mutex = Mutex.new
25
+ @progress = io && WorkflowProgress.new(io: io, label: command, total: members.size, jobs: jobs, members: members)
26
+ @progress&.start
27
+ end
28
+
29
+ def start_member(member, steps:)
30
+ @progress&.start_member(member, total: steps, status: "starting")
31
+ emit("member_start", member, status: "started", total: steps)
32
+ end
33
+
34
+ def step_started(member, phase)
35
+ @progress&.update(member, status: "#{phase} started")
36
+ emit("command_step", member, phase: phase, status: "started")
37
+ end
38
+
39
+ def step_finished(member, phase, ok:, elapsed_seconds: nil)
40
+ @progress&.advance(member, status: "#{phase} #{ok ? "ok" : "failed"}", success: ok)
41
+ emit("command_step", member, phase: phase, status: ok ? "ok" : "failed", elapsed_seconds: elapsed_seconds)
42
+ end
43
+
44
+ # Live counts relayed from a child suite's `test_progress` events. Ticks
45
+ # only repaint the TTY pane (a non-TTY log would get a line per second);
46
+ # failures and the final event always update it. Every event is taped.
47
+ def test_progress(member, event)
48
+ kind = event["kind"].to_s
49
+ if @progress && (@progress.tty? || kind != "tick")
50
+ status = "#{event["examples"]} examples, #{event["failures"]} failed"
51
+ status += " #{event["location"]}" if kind == "failure" && event["location"]
52
+ @progress.update(member, status: status, mark: (kind == "failure") ? "F" : nil)
53
+ end
54
+ @tape&.call(event.merge("command" => @command, "member" => member.name))
55
+ end
56
+
57
+ def finish_member(member, success:)
58
+ @mutex.synchronize { (success ? @completed : @failed) << member.name }
59
+ @progress&.finish_member(member, success: success, status: success ? "complete" : "failed")
60
+ emit("member_complete", member, status: success ? "ok" : "failed")
61
+ end
62
+
63
+ # Report a batched run (one command covering every member) as a single
64
+ # step per member: all members start, then each finishes with the outcome
65
+ # of its own results once the batch returns. When the batch failed, members
66
+ # with no results were never reached and are reported as skipped.
67
+ def around_batch(phase)
68
+ @members.each do |member|
69
+ start_member(member, steps: 1)
70
+ step_started(member, phase)
71
+ end
72
+ results = yield
73
+ batch_failed = results.any? { |result| !result.ok? }
74
+ @members.each do |member|
75
+ own = results.select { |result| result.member_name == member.name }
76
+ next skip_member(member, phase) if own.empty? && batch_failed
77
+
78
+ ok = own.all?(&:ok?)
79
+ step_finished(member, phase, ok: ok, elapsed_seconds: own.sum { |result| result.elapsed_seconds.to_f })
80
+ finish_member(member, success: ok)
81
+ end
82
+ results
83
+ ensure
84
+ finish
85
+ end
86
+
87
+ # A member a failed run never reached: closed out as skipped, neither
88
+ # completed nor failed, so it is not mistaken for a success.
89
+ def skip_member(member, phase)
90
+ @progress&.finish_member(member, success: true, status: "skipped")
91
+ emit("command_step", member, phase: phase, status: "skipped")
92
+ emit("member_complete", member, status: "skipped")
93
+ end
94
+
95
+ def finish
96
+ return unless @progress
97
+
98
+ @progress.finish
99
+ done, failed = @mutex.synchronize { [@completed.dup, @failed.dup] }
100
+ unstarted = @members.map(&:name) - done - failed
101
+ @progress.summary("#{@command} summary: completed: #{done.join(", ")}; failed: #{failed.join(", ").then { |s| s.empty? ? "-" : s }}; unstarted: #{unstarted.join(", ")}")
102
+ end
103
+
104
+ private
105
+
106
+ def emit(type, member, **attributes)
107
+ @tape&.call({"type" => type, "command" => @command, "member" => member.name}.merge(attributes.transform_keys(&:to_s)))
108
+ end
109
+ end
110
+ end
111
+ end
@@ -12,7 +12,8 @@ module Kettle
12
12
  CHECK_PHASE = "reconcile_github_release_check"
13
13
  CREATE_PHASE = "reconcile_github_release"
14
14
 
15
- def initialize(config:, members:, execute: false, runner: nil)
15
+ def initialize(config:, members:, execute: false, runner: nil, reporter: nil)
16
+ @reporter = reporter
16
17
  @config = config
17
18
  @members = members
18
19
  @execute = execute
@@ -22,13 +23,21 @@ module Kettle
22
23
  def results
23
24
  release_states = release_state_by_member
24
25
  members.flat_map do |member|
25
- reconcile_member(member: member, release_state: release_states[member.name])
26
+ reporter&.start_member(member, steps: 1)
27
+ reporter&.step_started(member, "reconcile-releases")
28
+ member_results = reconcile_member(member: member, release_state: release_states[member.name])
29
+ ok = member_results.all?(&:ok?)
30
+ reporter&.step_finished(member, "reconcile-releases", ok: ok, elapsed_seconds: member_results.sum { |result| result.elapsed_seconds.to_f })
31
+ reporter&.finish_member(member, success: ok)
32
+ member_results
26
33
  end
34
+ ensure
35
+ reporter&.finish
27
36
  end
28
37
 
29
38
  private
30
39
 
31
- attr_reader :config, :members, :execute, :runner
40
+ attr_reader :config, :members, :execute, :runner, :reporter
32
41
 
33
42
  def release_state_by_member
34
43
  ReleaseStateCheck.new(config: config, members: members).results.each_with_object({}) do |result, memo|