kettle-family 0.1.6 → 0.1.7

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: baca0a14eeb69f6e1922a2b6cd9cf274606744a9b1188001cfa7c2f54a5b67d1
4
- data.tar.gz: 4d8e0618681191d9b7c04c6318f1ecbba2e12a2932f582bb4a2eff6f4588c5b3
3
+ metadata.gz: b23125293c3b6a98def2ef620d3924a1d0d31e6a65b40bc8a7a165de56a12497
4
+ data.tar.gz: 603e94d7a4a2d1f4fd4e0615b4aaa08ddcf6de777fbdce66bc3785d4693f7bfa
5
5
  SHA512:
6
- metadata.gz: 2f95b4376c2d62097e3775d56d9b1e2e1ab3ecf84ab25a9d204de8e021cdee6182e102dfb4e62c895867a432907a72919748b745b4e6b317a14c9103ce4d1d94
7
- data.tar.gz: e16a973e624bc4e242c37b46cc12dc8c06fc1196c506de320ad56d8f5b384fcaa7adb40f5a19d107a78671f2e21358b72c855c03ff00cd1656d327f11349e442
6
+ metadata.gz: e50fbe780c58517e32afe874564b73026d676a80a23e7fa5591542e534acd4e4a82a0d70ec3034a9cc9f92144a79ce330c3d37cab85ba2fe65b30db17194fd17
7
+ data.tar.gz: fe6d559efa68a64bbec37974ba44d8526d857b630d883cec4d22926750f777bd8a4454bcf30d43da1e037afbe6bf7ba66af2ddf716cda51c44ab1f28131f0f1a
checksums.yaml.gz.sig CHANGED
@@ -1,4 +1 @@
1
- ��|]�ӤštO�܀�A<�_܎X̦]B>�`�OY�#�mZ1H���5��d
2
- �_�+��u�J�_�N\��O�����ec-������6�~���{�-Dk��1���/<���
3
- �CL���ȷ{���H�J�e=�Jp�MfK�v�&Z����oF�OX��d�i��,���6>��5U�o�w u����Q�;��R�cD�<��#�I}��D�XDڦ���/�{��4fZ_k5� �X޺�)��m�G�")����j��b�5�Uk�#<�x���B�so�0w�@^�����[k^�4\��V�3��^>+?� vq��Ef,�d�Ҏֿ\T9�#V6� ��_�c��dR��
4
- ��ZH'F��t�1���Ãn��
1
+ Gpwx}����G�1�^�̎��J�p��[r�Sl?���'�����e��Lކ�\����V�1$$p�o *[ ��4_Q�L(�f��]�7�aOo��?��m5T8��4a��Х�����6��f6��IRk_r4Հr[�Ź�hR���3�_�r}�F\�UcMON�S�J���qvH��Oh��[��"#��Pp��l��P��$��`$]b��@��YD �" xޠOg�� u��;`��R���6ّ��M^��]Tyt^x����ɦ*7��dw+e wf-\ee�̭�!Α�ٞ�EäN8Srbj��o�J��� t�Ft�s���vrd��%`i~�����{u��,�� '��K,Ƶ.! �9�|w�y����W�8E�R�A<
data/CHANGELOG.md CHANGED
@@ -30,6 +30,41 @@ Please file a bug if you notice a violation of semantic versioning.
30
30
 
31
31
  ### Security
32
32
 
33
+ ## [0.1.7] - 2026-06-22
34
+
35
+ - TAG: [v0.1.7][0.1.7t]
36
+ - COVERAGE: 94.50% -- 1236/1308 lines in 20 files
37
+ - BRANCH COVERAGE: 76.49% -- 397/519 branches in 20 files
38
+ - 39.73% documented
39
+
40
+ ### Added
41
+
42
+ - Added `kettle-family add-changelog` to pass one unreleased changelog entry to
43
+ each selected member via the absolute installed `kettle-changelog`, including
44
+ configured branch-lane traversal, so member binstubs cannot shadow it. Branch
45
+ lane runs commit each member changelog update before checking out the next
46
+ branch.
47
+
48
+ - Added support for JRuby 10.1 and TruffleRuby 34.0.
49
+
50
+ ### Changed
51
+
52
+ - Retemplated project metadata and CI/development automation with `kettle-jem` v7.0.0.
53
+
54
+ ### Fixed
55
+
56
+ - Corrected OpenCollective funding metadata to use the `kettle-dev` collective.
57
+ - Commands now traverse configured release target branches, matching release
58
+ branch-lane behavior for gems with per-series branches, and `kettle-family
59
+ template` commits post-template lockfile normalization changes before moving
60
+ to the next branch.
61
+ - Family dependency ordering now ignores development dependencies, preventing
62
+ false cycles between gems that only reference each other in test or release
63
+ tooling.
64
+ - `kettle-family template` can bootstrap legacy members that do not yet have
65
+ generated templating bundle wiring, and member command execution now respects
66
+ `.tool-versions` mise configuration files.
67
+
33
68
  ## [0.1.6] - 2026-06-18
34
69
 
35
70
  - TAG: [v0.1.6][0.1.6t]
@@ -176,7 +211,9 @@ Please file a bug if you notice a violation of semantic versioning.
176
211
  - Fixed CI load failures on engines without compatible `pty` support by falling back to Open3 for interactive release commands.
177
212
  - Fixed Ruby 3.2 version-bump support by loading Prism lazily and wiring the Prism gem only for MRI versions that need it.
178
213
 
179
- [Unreleased]: https://github.com/kettle-dev/kettle-family/compare/v0.1.6...HEAD
214
+ [Unreleased]: https://github.com/kettle-dev/kettle-family/compare/v0.1.7...HEAD
215
+ [0.1.7]: https://github.com/kettle-dev/kettle-family/compare/v0.1.6...v0.1.7
216
+ [0.1.7t]: https://github.com/kettle-dev/kettle-family/releases/tag/v0.1.7
180
217
  [0.1.6]: https://github.com/kettle-dev/kettle-family/compare/v0.1.5...v0.1.6
181
218
  [0.1.6t]: https://github.com/kettle-dev/kettle-family/releases/tag/v0.1.6
182
219
  [0.1.5]: https://github.com/kettle-dev/kettle-family/compare/v0.1.4...v0.1.5
data/FUNDING.md CHANGED
@@ -6,7 +6,7 @@ Many paths lead to being a sponsor or a backer of this project. Are you on such
6
6
 
7
7
  [![OpenCollective Backers][🖇osc-backers-i]][🖇osc-backers] [![OpenCollective Sponsors][🖇osc-sponsors-i]][🖇osc-sponsors] [![Sponsor Me on Github][🖇sponsor-img]][🖇sponsor] [![Liberapay Goal Progress][⛳liberapay-img]][⛳liberapay] [![Donate on PayPal][🖇paypal-img]][🖇paypal]
8
8
 
9
- [![Buy me a coffee][🖇buyme-small-img]][🖇buyme] [![Donate on Polar][🖇polar-img]][🖇polar] [![Donate to my FLOSS efforts at ko-fi.com][🖇kofi-img]][🖇kofi] [![Donate to my FLOSS efforts using Patreon][🖇patreon-img]][🖇patreon]
9
+ [![Buy me a coffee][🖇buyme-small-img]][🖇buyme] [![Donate to my FLOSS efforts at ko-fi.com][🖇kofi-img]][🖇kofi]
10
10
 
11
11
  [⛳liberapay-img]: https://img.shields.io/liberapay/goal/pboling.svg?logo=liberapay&color=a51611&style=flat
12
12
  [⛳liberapay]: https://liberapay.com/pboling/donate
@@ -16,12 +16,8 @@ Many paths lead to being a sponsor or a backer of this project. Are you on such
16
16
  [🖇osc-sponsors-i]: https://opencollective.com/kettle-dev/sponsors/badge.svg?style=flat
17
17
  [🖇sponsor-img]: https://img.shields.io/badge/Sponsor_Me!-pboling.svg?style=social&logo=github
18
18
  [🖇sponsor]: https://github.com/sponsors/pboling
19
- [🖇polar-img]: https://img.shields.io/badge/polar-donate-a51611.svg?style=flat
20
- [🖇polar]: https://polar.sh/pboling
21
19
  [🖇kofi-img]: https://img.shields.io/badge/ko--fi-%E2%9C%93-a51611.svg?style=flat
22
20
  [🖇kofi]: https://ko-fi.com/pboling
23
- [🖇patreon-img]: https://img.shields.io/badge/patreon-donate-a51611.svg?style=flat
24
- [🖇patreon]: https://patreon.com/galtzo
25
21
  [🖇buyme-small-img]: https://img.shields.io/badge/buy_me_a_coffee-%E2%9C%93-a51611.svg?style=flat
26
22
  [🖇buyme]: https://www.buymeacoffee.com/pboling
27
23
  [🖇paypal-img]: https://img.shields.io/badge/donate-paypal-a51611.svg?style=flat&logo=paypal
data/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
  `if ci_badges.map(&:color).all? { it == "green"}` 👇️ send money so I can do more of this. FLOSS maintenance is now my full-time job.
12
12
 
13
- [![OpenCollective Backers][🖇osc-backers-i]][🖇osc-backers] [![OpenCollective Sponsors][🖇osc-sponsors-i]][🖇osc-sponsors] [![Sponsor Me on Github][🖇sponsor-img]][🖇sponsor] [![Liberapay Goal Progress][⛳liberapay-img]][⛳liberapay] [![Donate on PayPal][🖇paypal-img]][🖇paypal] [![Buy me a coffee][🖇buyme-small-img]][🖇buyme] [![Donate on Polar][🖇polar-img]][🖇polar] [![Donate at ko-fi.com][🖇kofi-img]][🖇kofi]
13
+ [![OpenCollective Backers][🖇osc-backers-i]][🖇osc-backers] [![OpenCollective Sponsors][🖇osc-sponsors-i]][🖇osc-sponsors] [![Sponsor Me on Github][🖇sponsor-img]][🖇sponsor] [![Liberapay Goal Progress][⛳liberapay-img]][⛳liberapay] [![Donate on PayPal][🖇paypal-img]][🖇paypal] [![Buy me a coffee][🖇buyme-small-img]][🖇buyme] [![Donate at ko-fi.com][🖇kofi-img]][🖇kofi]
14
14
 
15
15
  <details markdown="1">
16
16
  <summary>👣 How will this project approach the September 2025 hostile takeover of RubyGems? 🚑️</summary>
@@ -419,12 +419,8 @@ Thanks for RTFM. ☺️
419
419
  [🖇sponsor-img]: https://img.shields.io/badge/Sponsor_Me!-pboling.svg?style=social&logo=github
420
420
  [🖇sponsor-bottom-img]: https://img.shields.io/badge/Sponsor_Me!-pboling-blue?style=for-the-badge&logo=github
421
421
  [🖇sponsor]: https://github.com/sponsors/pboling
422
- [🖇polar-img]: https://img.shields.io/badge/polar-donate-a51611.svg?style=flat
423
- [🖇polar]: https://polar.sh/pboling
424
422
  [🖇kofi-img]: https://img.shields.io/badge/ko--fi-%E2%9C%93-a51611.svg?style=flat
425
423
  [🖇kofi]: https://ko-fi.com/pboling
426
- [🖇patreon-img]: https://img.shields.io/badge/patreon-donate-a51611.svg?style=flat
427
- [🖇patreon]: https://patreon.com/galtzo
428
424
  [🖇buyme-small-img]: https://img.shields.io/badge/buy_me_a_coffee-%E2%9C%93-a51611.svg?style=flat
429
425
  [🖇buyme-img]: https://img.buymeacoffee.com/button-api/?text=Buy%20me%20a%20latte&emoji=&slug=pboling&button_colour=FFDD00&font_colour=000000&font_family=Cookie&outline_colour=000000&coffee_colour=ffffff
430
426
  [🖇buyme]: https://www.buymeacoffee.com/pboling
@@ -566,7 +562,7 @@ Thanks for RTFM. ☺️
566
562
  [📌gitmoji]: https://gitmoji.dev
567
563
  [📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
568
564
  [🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
569
- [🧮kloc-img]: https://img.shields.io/badge/KLOC-1.242-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
565
+ [🧮kloc-img]: https://img.shields.io/badge/KLOC-1.308-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
570
566
  [🔐security]: https://github.com/kettle-dev/kettle-family/blob/main/SECURITY.md
571
567
  [🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
572
568
  [📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
@@ -596,5 +592,5 @@ Thanks for RTFM. ☺️
596
592
  | Homepage | https://github.com/kettle-dev/kettle-family |
597
593
  | Source | https://github.com/kettle-dev/kettle-family |
598
594
  | License | `AGPL-3.0-only` |
599
- | Funding | https://github.com/sponsors/pboling, https://issuehunt.io/u/pboling, https://ko-fi.com/pboling, https://liberapay.com/pboling/donate, https://opencollective.com/kettle-dev, https://opencollective.com/kettle-rb, https://patreon.com/galtzo, https://polar.sh/pboling, https://thanks.dev/u/gh/pboling, https://tidelift.com/funding/github/rubygems/kettle-family, https://www.buymeacoffee.com/pboling |
595
+ | Funding | https://github.com/sponsors/pboling, https://ko-fi.com/pboling, https://liberapay.com/pboling/donate, https://opencollective.com/kettle-dev, https://thanks.dev/u/gh/pboling, https://tidelift.com/funding/github/rubygems/kettle-family, https://www.buymeacoffee.com/pboling |
600
596
  <!-- kettle-jem:metadata:end -->
@@ -6,7 +6,7 @@ require "optparse"
6
6
  module Kettle
7
7
  module Family
8
8
  class CLI
9
- COMMANDS = %w[discover plan report metadata check test lint docs template install bump-version release branch-lanes release-state].freeze
9
+ COMMANDS = %w[discover plan report metadata check test lint docs template install bump-version add-changelog release branch-lanes release-state].freeze
10
10
  WORKFLOW_COMMANDS = %w[check test lint docs template release].freeze
11
11
 
12
12
  def self.call(argv, out: $stdout, err: $stderr)
@@ -61,6 +61,7 @@ module Kettle
61
61
  template Plan or execute kettle-jem templating per member
62
62
  install Build and install selected local family gems
63
63
  bump-version Check, plan, or execute family version alignment
64
+ add-changelog Add an entry to an existing Unreleased changelog section
64
65
  release Plan or execute release build/publish phases
65
66
  branch-lanes Audit configured branch lane release mappings
66
67
  release-state Report changelog release state for family members
@@ -75,6 +76,8 @@ module Kettle
75
76
  --execute Execute external workflow commands
76
77
  --dry-run Plan external workflow commands without running them (default)
77
78
  --env KEY=VALUE Override an environment variable for each member workflow command
79
+ --section NAME Changelog section for add-changelog
80
+ --entry TEXT Changelog entry for add-changelog
78
81
  --check Check whether bump-version would need edits
79
82
  --from VERSION Require selected members to currently match VERSION
80
83
  --publish Use publish release command instead of build command
@@ -103,6 +106,8 @@ module Kettle
103
106
  report: nil,
104
107
  execute: false,
105
108
  workflow_env: {},
109
+ changelog_section: nil,
110
+ changelog_entry: nil,
106
111
  check: false,
107
112
  from_version: nil,
108
113
  publish: false,
@@ -124,6 +129,8 @@ module Kettle
124
129
  parser.on("--execute") { options[:execute] = true }
125
130
  parser.on("--dry-run") { options[:execute] = false }
126
131
  parser.on("--env KEY=VALUE") { |value| parse_env_override(value, options[:workflow_env]) }
132
+ parser.on("--section NAME") { |value| options[:changelog_section] = value }
133
+ parser.on("--entry TEXT") { |value| options[:changelog_entry] = value }
127
134
  parser.on("--check") { options[:check] = true }
128
135
  parser.on("--from VERSION") { |value| options[:from_version] = value }
129
136
  parser.on("--publish") { options[:publish] = true }
@@ -173,7 +180,14 @@ module Kettle
173
180
  end
174
181
 
175
182
  def command_results(command:, config:, members:, options:)
183
+ return branch_target_command_results(command: command, config: config, members: members, options: options) if branch_target_command?(command, config)
184
+
185
+ command_results_for_current_branch(command: command, config: config, members: members, options: options)
186
+ end
187
+
188
+ def command_results_for_current_branch(command:, config:, members:, options:)
176
189
  return bump_version_results(members: members, options: options) if command == "bump-version"
190
+ return add_changelog_results(members: members, options: options) if command == "add-changelog"
177
191
  return branch_lane_results(config: config, members: members) if command == "branch-lanes"
178
192
  return release_state_results(config: config, members: members) if command == "release-state"
179
193
  return install_results(config: config, members: members, options: options) if command == "install"
@@ -196,6 +210,53 @@ module Kettle
196
210
  ).results
197
211
  end
198
212
 
213
+ def branch_target_command?(command, config)
214
+ return false if config.release_target_branches.empty?
215
+ return false if command == "release-state"
216
+ return false if command == "branch-lanes"
217
+ return false unless WORKFLOW_COMMANDS.include?(command) || %w[bump-version install add-changelog].include?(command)
218
+
219
+ !WORKFLOW_COMMANDS.include?(command)
220
+ end
221
+
222
+ def branch_target_command_results(command:, config:, members:, options:)
223
+ runner = CommandRunner.new(execute: options[:execute])
224
+ selected_names = members.map(&:name)
225
+ config.release_target_branches.each_with_object([]) do |branch, memo|
226
+ memo << runner.call(
227
+ member: family_member(config),
228
+ phase: "release_checkout",
229
+ command: ["git", "checkout", branch]
230
+ )
231
+ break memo unless memo.last.ok?
232
+
233
+ branch_members = rediscovered_selected_members(config: config, selected_names: selected_names, command: command)
234
+ branch_members = members if branch_members.empty?
235
+ memo.concat(command_results_for_current_branch(command: command, config: config, members: branch_members, options: options))
236
+ break memo unless memo.last&.ok?
237
+
238
+ commit_changelog_entries(branch_members: branch_members, runner: runner, memo: memo) if command == "add-changelog"
239
+ break memo unless memo.last&.ok?
240
+ end
241
+ end
242
+
243
+ def rediscovered_selected_members(config:, selected_names:, command:)
244
+ discovered = Discovery.new(config: config).members
245
+ ordered = (command == "install") ? install_order(discovered, config) : Orderer.new(members: discovered, mode: config.order_mode, hints: config.order_hints).ordered
246
+ ordered.select { |member| selected_names.include?(member.name) }
247
+ end
248
+
249
+ def family_member(config)
250
+ Member.new(
251
+ name: config.family_name,
252
+ root: config.root,
253
+ gemspec_path: nil,
254
+ version_file: nil,
255
+ version: nil,
256
+ dependencies: []
257
+ )
258
+ end
259
+
199
260
  def parse_env_override(value, env)
200
261
  key, env_value = value.split("=", 2)
201
262
  raise OptionParser::InvalidArgument, "--env requires KEY=VALUE" if key.to_s.empty? || env_value.nil?
@@ -213,6 +274,42 @@ module Kettle
213
274
  ).results
214
275
  end
215
276
 
277
+ def add_changelog_results(members:, options:)
278
+ section = options[:changelog_section].to_s
279
+ entry = options[:changelog_entry].to_s
280
+ raise Error, "add-changelog requires --section" if section.empty?
281
+ raise Error, "add-changelog requires --entry" if entry.empty?
282
+
283
+ runner = CommandRunner.new(execute: options[:execute])
284
+ members.each_with_object([]) do |member, memo|
285
+ memo << runner.call(
286
+ member: member,
287
+ phase: "add-changelog",
288
+ command: [installed_executable("kettle-changelog"), "--add-unreleased-entry", "--section", section, "--entry", entry]
289
+ )
290
+ break memo unless memo.last.ok?
291
+ end
292
+ end
293
+
294
+ def installed_executable(name)
295
+ File.join(Gem.bindir, name)
296
+ end
297
+
298
+ def commit_changelog_entries(branch_members:, runner:, memo:)
299
+ branch_members.each do |member|
300
+ memo << runner.call(
301
+ member: member,
302
+ phase: "commit_changelog",
303
+ command: [
304
+ "sh",
305
+ "-lc",
306
+ "if ! git diff --quiet -- CHANGELOG.md; then git add CHANGELOG.md && git commit -m '📝 Add runtime compatibility changelog entry'; fi"
307
+ ]
308
+ )
309
+ break unless memo.last.ok?
310
+ end
311
+ end
312
+
216
313
  def bump_version_mode(options)
217
314
  return :check if options[:check]
218
315
  return :execute if options[:execute]
@@ -133,7 +133,7 @@ module Kettle
133
133
 
134
134
  def command_argv(member:, command:, env: {})
135
135
  argv = normalize_command(command)
136
- return argv unless File.file?(File.join(member.root, "mise.toml"))
136
+ return argv unless mise_configured?(member)
137
137
 
138
138
  injected_env = env.map { |key, value| "#{key}=#{value}" }
139
139
  mise_argv = ["mise", "exec", "-C", member.root, "--"]
@@ -143,11 +143,17 @@ module Kettle
143
143
  end
144
144
 
145
145
  def process_env(member:, env:)
146
- return env unless File.file?(File.join(member.root, "mise.toml"))
146
+ return env unless mise_configured?(member)
147
147
 
148
148
  {}
149
149
  end
150
150
 
151
+ def mise_configured?(member)
152
+ %w[mise.toml .mise.toml .tool-versions].any? do |path|
153
+ File.file?(File.join(member.root, path))
154
+ end
155
+ end
156
+
151
157
  def normalize_command(command)
152
158
  case command
153
159
  when Array
@@ -63,7 +63,7 @@ module Kettle
63
63
  gemspec_path: path,
64
64
  version_file: version_file(File.dirname(path)),
65
65
  version: spec.version.to_s,
66
- dependencies: spec.dependencies.map(&:name).sort,
66
+ dependencies: spec.runtime_dependencies.map(&:name).sort,
67
67
  required_ruby_version: required_ruby_version(spec),
68
68
  licenses: licenses(spec),
69
69
  authors: authors(spec)
@@ -50,7 +50,7 @@ module Kettle
50
50
  gemspec_path: gemspec,
51
51
  version_file: version_file(File.dirname(gemspec)),
52
52
  version: spec.version.to_s,
53
- dependencies: spec.dependencies.map(&:name).sort,
53
+ dependencies: spec.runtime_dependencies.map(&:name).sort,
54
54
  required_ruby_version: required_ruby_version(spec),
55
55
  licenses: Array(spec.licenses),
56
56
  authors: Array(spec.authors)
@@ -3,7 +3,7 @@
3
3
  module Kettle
4
4
  module Family
5
5
  module Version
6
- VERSION = "0.1.6"
6
+ VERSION = "0.1.7"
7
7
  end
8
8
  VERSION = Version::VERSION # Traditional Constant Location
9
9
  end
@@ -33,16 +33,32 @@ module Kettle
33
33
  end
34
34
 
35
35
  def results
36
- return check_results if command == "check"
37
- return release_results if command == "release"
36
+ prompt_for_gem_signing_password if command == "release" && execute && publish && gem_signing_required?
37
+ return branch_target_results unless config.release_target_branches.empty?
38
+
39
+ current_branch_results(members)
40
+ end
41
+
42
+ private
43
+
44
+ attr_reader :command, :config, :members, :execute, :commit, :allow_dirty, :publish, :push, :tag, :start_step, :local_ci, :continue_ci_failures, :env_overrides
45
+
46
+ def current_branch_results(workflow_members)
47
+ return check_results(workflow_members) if command == "check"
48
+ return release_member_results(workflow_members, include_family_changelog: true) if command == "release"
49
+
50
+ member_workflow_results(workflow_members)
51
+ end
52
+
53
+ def member_workflow_results(workflow_members)
38
54
  runner = CommandRunner.new(execute: execute)
39
- command_text = workflow_command
40
- members.each_with_object([]) do |member, memo|
55
+ workflow_members.each_with_object([]) do |member, memo|
41
56
  if command == "template" && config.normalize_lockfiles?
42
57
  normalize_lockfiles(member: member, runner: runner, memo: memo, phase: "prepare_lockfiles")
43
58
  break memo unless memo.last.ok?
44
59
  end
45
60
 
61
+ command_text = workflow_command(member)
46
62
  result = runner.call(member: member, phase: command, command: command_text, env: workflow_env)
47
63
  memo << result
48
64
  break memo unless result.ok?
@@ -51,22 +67,11 @@ module Kettle
51
67
  end
52
68
  end
53
69
 
54
- private
55
-
56
- attr_reader :command, :config, :members, :execute, :commit, :allow_dirty, :publish, :push, :tag, :start_step, :local_ci, :continue_ci_failures, :env_overrides
57
-
58
- def check_results
59
- members.map { |member| ReadinessCheck.call(member: member, config: config) }
60
- end
61
-
62
- def release_results
63
- prompt_for_gem_signing_password if execute && publish && gem_signing_required?
64
- return branch_target_release_results unless config.release_target_branches.empty?
65
-
66
- release_member_results(members, include_family_changelog: true)
70
+ def check_results(workflow_members)
71
+ workflow_members.map { |member| ReadinessCheck.call(member: member, config: config) }
67
72
  end
68
73
 
69
- def branch_target_release_results
74
+ def branch_target_results
70
75
  runner = command_runner
71
76
  selected_names = members.map(&:name)
72
77
  config.release_target_branches.each_with_object([]) do |branch, memo|
@@ -74,7 +79,11 @@ module Kettle
74
79
  break memo unless memo.last.ok?
75
80
 
76
81
  branch_members = rediscovered_selected_members(selected_names)
77
- memo.concat(release_member_results(branch_members, include_family_changelog: true))
82
+ branch_members = members if branch_members.empty?
83
+ memo.concat(current_branch_results(branch_members))
84
+ break memo unless memo.last&.ok?
85
+
86
+ commit_normalized_lockfiles(branch_members: branch_members, runner: runner, memo: memo)
78
87
  break memo unless memo.last&.ok?
79
88
  end
80
89
  end
@@ -231,8 +240,8 @@ module Kettle
231
240
  raise Error, "gem signing password is required" if @gem_signing_password.to_s.empty?
232
241
  end
233
242
 
234
- def workflow_command
235
- return template_command if command == "template"
243
+ def workflow_command(member = nil)
244
+ return template_command(member) if command == "template"
236
245
 
237
246
  command_for(command)
238
247
  end
@@ -242,8 +251,8 @@ module Kettle
242
251
  configured || DEFAULT_COMMANDS.fetch(name)
243
252
  end
244
253
 
245
- def template_command
246
- command_text = config.template_command || DEFAULT_COMMANDS.fetch("template")
254
+ def template_command(member)
255
+ command_text = config.template_command || default_template_command(member)
247
256
  return command_text if commit
248
257
  return command_text if command_text.is_a?(Array) && command_text.include?("--skip-commit")
249
258
  return [*command_text, "--skip-commit"] if command_text.is_a?(Array)
@@ -252,6 +261,20 @@ module Kettle
252
261
  "#{command_text} --skip-commit"
253
262
  end
254
263
 
264
+ def default_template_command(member)
265
+ return DEFAULT_COMMANDS.fetch("template") if templating_bundle_wired?(member)
266
+
267
+ "kettle-jem install"
268
+ end
269
+
270
+ def templating_bundle_wired?(member)
271
+ gemfile = File.join(member.root, "Gemfile")
272
+ return false unless File.file?(gemfile)
273
+
274
+ content = File.read(gemfile)
275
+ content.include?("K_JEM_TEMPLATING") || content.include?("gemfiles/modular/templating")
276
+ end
277
+
255
278
  def workflow_env
256
279
  {}.tap do |env|
257
280
  if command == "template"
@@ -273,6 +296,25 @@ module Kettle
273
296
  memo << result
274
297
  end
275
298
 
299
+ def commit_normalized_lockfiles(branch_members:, runner:, memo:)
300
+ return unless command == "template" && config.normalize_lockfiles? && commit
301
+
302
+ branch_members.each do |member|
303
+ result = runner.call(
304
+ member: member,
305
+ phase: "commit_normalized_lockfiles",
306
+ command: [
307
+ "sh",
308
+ "-lc",
309
+ "files=$(git ls-files --modified --others --exclude-standard -- Gemfile.lock '*.lock' '**/*.lock'); " \
310
+ "if [ -n \"$files\" ]; then printf '%s\\n' \"$files\" | xargs git add -- && git commit -m '🔒 Normalize lockfiles after templating'; fi"
311
+ ]
312
+ )
313
+ memo << result
314
+ break unless result.ok?
315
+ end
316
+ end
317
+
276
318
  def family_member
277
319
  Member.new(
278
320
  name: config.family_name,
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: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter H. Boling
@@ -80,7 +80,7 @@ dependencies:
80
80
  version: '2.2'
81
81
  - - ">="
82
82
  - !ruby/object:Gem::Version
83
- version: 2.2.13
83
+ version: 2.2.15
84
84
  type: :development
85
85
  prerelease: false
86
86
  version_requirements: !ruby/object:Gem::Requirement
@@ -90,7 +90,7 @@ dependencies:
90
90
  version: '2.2'
91
91
  - - ">="
92
92
  - !ruby/object:Gem::Version
93
- version: 2.2.13
93
+ version: 2.2.15
94
94
  - !ruby/object:Gem::Dependency
95
95
  name: bundler-audit
96
96
  requirement: !ruby/object:Gem::Requirement
@@ -168,7 +168,7 @@ dependencies:
168
168
  version: '2.0'
169
169
  - - ">="
170
170
  - !ruby/object:Gem::Version
171
- version: 2.0.5
171
+ version: 2.0.6
172
172
  type: :development
173
173
  prerelease: false
174
174
  version_requirements: !ruby/object:Gem::Requirement
@@ -178,7 +178,7 @@ dependencies:
178
178
  version: '2.0'
179
179
  - - ">="
180
180
  - !ruby/object:Gem::Version
181
- version: 2.0.5
181
+ version: 2.0.6
182
182
  - !ruby/object:Gem::Dependency
183
183
  name: turbo_tests2
184
184
  requirement: !ruby/object:Gem::Requirement
@@ -309,10 +309,10 @@ licenses:
309
309
  - AGPL-3.0-only
310
310
  metadata:
311
311
  homepage_uri: https://kettle-family.galtzo.com
312
- source_code_uri: https://github.com/kettle-dev/kettle-family/tree/v0.1.6
313
- changelog_uri: https://github.com/kettle-dev/kettle-family/blob/v0.1.6/CHANGELOG.md
312
+ source_code_uri: https://github.com/kettle-dev/kettle-family/tree/v0.1.7
313
+ changelog_uri: https://github.com/kettle-dev/kettle-family/blob/v0.1.7/CHANGELOG.md
314
314
  bug_tracker_uri: https://github.com/kettle-dev/kettle-family/issues
315
- documentation_uri: https://www.rubydoc.info/gems/kettle-family/0.1.6
315
+ documentation_uri: https://www.rubydoc.info/gems/kettle-family/0.1.7
316
316
  funding_uri: https://github.com/sponsors/pboling
317
317
  wiki_uri: https://github.com/kettle-dev/kettle-family/wiki
318
318
  news_uri: https://www.railsbling.com/tags/kettle-family
metadata.gz.sig CHANGED
Binary file