kettle-family 0.2.1 → 0.2.3

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: df75b3cbe214e80033a6e9fec8047061693170cb9b2f1d9876c725651bff13ef
4
- data.tar.gz: 42827c84dc46376a3b2eeaf94ff078137fcedce139f2b4ead0a2f2794abaa311
3
+ metadata.gz: 1321ed38de6cb72dbb54f07eb9d64ad603d534ee0bde3986c69a12aea3209bd7
4
+ data.tar.gz: fb828bcc85d5a373bfbaa19b9f409e4ccc061840943bb7605337106c346d1531
5
5
  SHA512:
6
- metadata.gz: d9477dedc39d42723f0c15610838ad4557ebdfcfecd6b1e6a1f9ae79a7bae5bc36114fdb85122134670a9652cc151b5cddaa66436466e36ba272427b09d1f84a
7
- data.tar.gz: 1a1b276d934b09a2d65adcba585b7d37f7d8d1bb346c4e2dac2e5fd47b1146722edc980ee06272014037dfb948faed83c2e51216e1098e9e21a5cd414d25889d
6
+ metadata.gz: 93890dd533ed38d98f53ddf6c6c3a54e2be63e62d115e90e1c87caa3613eaeb0fe73c4fc76baf6de3f92c68591cbb73ac8dc6e869a817ff5ad7a8db200021ddb
7
+ data.tar.gz: 36fe85d72cc06f7bae910e45161ebc65d4d1f847f9627c18625b402a401be8f2698bffb13562fbbd881b3c63b90cdcc03c412f6e9ea2ce4d35be307dfa25a8d1
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -30,6 +30,31 @@ Please file a bug if you notice a violation of semantic versioning.
30
30
 
31
31
  ### Security
32
32
 
33
+ ## [0.2.3] - 2026-07-03
34
+
35
+ - TAG: [v0.2.3][0.2.3t]
36
+ - COVERAGE: 95.51% -- 2210/2314 lines in 21 files
37
+ - BRANCH COVERAGE: 76.41% -- 716/937 branches in 21 files
38
+ - 29.82% documented
39
+
40
+ ### Fixed
41
+
42
+ - Root-configured member branch target commands now rediscover the checked-out
43
+ member repository before version bumping, preventing old release lines from
44
+ being bumped to the current branch's version.
45
+
46
+ ## [0.2.2] - 2026-07-02
47
+
48
+ - TAG: [v0.2.2][0.2.2t]
49
+ - COVERAGE: 95.54% -- 2205/2308 lines in 21 files
50
+ - BRANCH COVERAGE: 76.53% -- 714/933 branches in 21 files
51
+ - 29.82% documented
52
+
53
+ ### Fixed
54
+
55
+ - Branch-target workflows now fail before doing member work when a dirty
56
+ worktree would block `git checkout` for configured release target branches.
57
+
33
58
  ## [0.2.1] - 2026-07-02
34
59
 
35
60
  - TAG: [v0.2.1][0.2.1t]
@@ -605,7 +630,11 @@ Please file a bug if you notice a violation of semantic versioning.
605
630
  - Fixed CI load failures on engines without compatible `pty` support by falling back to Open3 for interactive release commands.
606
631
  - Fixed Ruby 3.2 version-bump support by loading Prism lazily and wiring the Prism gem only for MRI versions that need it.
607
632
 
608
- [Unreleased]: https://github.com/kettle-dev/kettle-family/compare/v0.2.1...HEAD
633
+ [Unreleased]: https://github.com/kettle-dev/kettle-family/compare/v0.2.3...HEAD
634
+ [0.2.3]: https://github.com/kettle-dev/kettle-family/compare/v0.2.2...v0.2.3
635
+ [0.2.3t]: https://github.com/kettle-dev/kettle-family/releases/tag/v0.2.3
636
+ [0.2.2]: https://github.com/kettle-dev/kettle-family/compare/v0.2.1...v0.2.2
637
+ [0.2.2t]: https://github.com/kettle-dev/kettle-family/releases/tag/v0.2.2
609
638
  [0.2.1]: https://github.com/kettle-dev/kettle-family/compare/v0.2.0...v0.2.1
610
639
  [0.2.1t]: https://github.com/kettle-dev/kettle-family/releases/tag/v0.2.1
611
640
  [0.2.0]: https://github.com/kettle-dev/kettle-family/compare/v0.1.32...v0.2.0
data/README.md CHANGED
@@ -592,7 +592,7 @@ Thanks for RTFM. ☺️
592
592
  [📌gitmoji]: https://gitmoji.dev
593
593
  [📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
594
594
  [🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
595
- [🧮kloc-img]: https://img.shields.io/badge/KLOC-2.284-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
595
+ [🧮kloc-img]: https://img.shields.io/badge/KLOC-2.314-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
596
596
  [🔐security]: https://github.com/kettle-dev/kettle-family/blob/main/SECURITY.md
597
597
  [🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
598
598
  [📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
@@ -28,6 +28,7 @@ module Kettle
28
28
  return if branches.nil? || branches.empty?
29
29
 
30
30
  data = config.data.merge(
31
+ "members" => config.data.fetch("members", {}).merge("roots" => ["."]),
31
32
  "release" => config.data.fetch("release", {}).merge("target_branches" => branches)
32
33
  )
33
34
  Config.new(root: member.root, path: config.path, data: data)
@@ -96,8 +96,10 @@ module Kettle
96
96
  def load_gemspec(path)
97
97
  # Some legacy gemspecs use root-relative Kernel.load calls, and RubyGems
98
98
  # evaluates gemspecs relative to the current process directory.
99
+ # Gem::Specification.load caches by path, which is wrong for branch-stack
100
+ # workflows that checkout different contents at the same path.
99
101
  # rubocop:disable ThreadSafety/DirChdir
100
- spec = Dir.chdir(File.dirname(path)) { Gem::Specification.load(path) }
102
+ spec = Dir.chdir(File.dirname(path)) { eval_gemspec(path) }
101
103
  # rubocop:enable ThreadSafety/DirChdir
102
104
  raise Error, "could not load gemspec #{path}" unless spec
103
105
 
@@ -106,6 +108,16 @@ module Kettle
106
108
  raise Error, "could not load gemspec #{path}: #{error.message}"
107
109
  end
108
110
 
111
+ def eval_gemspec(path)
112
+ return unless File.file?(path)
113
+
114
+ code = Gem.open_file(path, "r:UTF-8:-", &:read)
115
+ spec = eval(code, binding, path) # rubocop:disable Security/Eval -- Mirrors RubyGems gemspec loading without its path cache.
116
+ return spec if spec.is_a?(Gem::Specification)
117
+
118
+ raise Error, "#{path} is not a Gem::Specification"
119
+ end
120
+
109
121
  def excluded_gemspec?(path)
110
122
  ignored_by_git?(path) || excluded_by_pattern?(path)
111
123
  end
@@ -9,6 +9,13 @@ module Kettle
9
9
  stdout, _stderr, status = Open3.capture3("git", "status", "--short", chdir: root)
10
10
  status.success? && !stdout.empty?
11
11
  end
12
+
13
+ def self.dirty_paths(root)
14
+ stdout, _stderr, status = Open3.capture3("git", "status", "--short", chdir: root)
15
+ return [] unless status.success?
16
+
17
+ stdout.lines.map(&:chomp).reject(&:empty?)
18
+ end
12
19
  end
13
20
  end
14
21
  end
@@ -3,7 +3,7 @@
3
3
  module Kettle
4
4
  module Family
5
5
  module Version
6
- VERSION = "0.2.1"
6
+ VERSION = "0.2.3"
7
7
  end
8
8
  VERSION = Version::VERSION # Traditional Constant Location
9
9
  end
@@ -73,6 +73,9 @@ module Kettle
73
73
  end
74
74
 
75
75
  def results
76
+ preflight = branch_checkout_dirty_preflight_results
77
+ return preflight unless preflight.empty?
78
+
76
79
  prompt_for_gem_signing_password if command == "release" && execute && release_signing_prompt_required?
77
80
  return branch_target_results unless config.release_target_branches.empty?
78
81
  return member_local_branch_target_results if member_local_branch_targets?
@@ -204,6 +207,52 @@ module Kettle
204
207
  end
205
208
  end
206
209
 
210
+ def branch_checkout_dirty_preflight_results
211
+ return [] unless execute
212
+ return [] if allow_dirty
213
+ return [] unless branch_checkout_preflight_required?
214
+
215
+ branch_checkout_preflight_members.filter_map do |member|
216
+ dirty_paths = GitStatus.dirty_paths(member.root)
217
+ next if dirty_paths.empty?
218
+
219
+ branch_checkout_dirty_result(member, dirty_paths)
220
+ end
221
+ end
222
+
223
+ def branch_checkout_preflight_required?
224
+ !config.release_target_branches.empty? || member_local_branch_targets?
225
+ end
226
+
227
+ def branch_checkout_preflight_members
228
+ members_with_targets = members.select { |member| member_local_release_config(member) }
229
+ members_with_targets = [family_member] if !config.release_target_branches.empty?
230
+ members_with_targets
231
+ end
232
+
233
+ def branch_checkout_dirty_result(member, dirty_paths)
234
+ CommandResult.new(
235
+ member_name: member.name,
236
+ phase: "release_checkout_preflight",
237
+ command: ["git", "status", "--short"],
238
+ workdir: member.root,
239
+ status: 1,
240
+ success: false,
241
+ stdout: "",
242
+ stderr: branch_checkout_dirty_message(dirty_paths),
243
+ elapsed_seconds: 0.0,
244
+ skipped: false,
245
+ reason: "dirty worktree blocks release target branch checkout"
246
+ )
247
+ end
248
+
249
+ def branch_checkout_dirty_message(dirty_paths)
250
+ [
251
+ "local changes would block release target branch checkout; commit or stash them before running kettle-family",
252
+ *dirty_paths
253
+ ].join("\n")
254
+ end
255
+
207
256
  def release_member_local_branch_target_results
208
257
  runner = command_runner
209
258
  results = []
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.2.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter H. Boling
@@ -339,10 +339,10 @@ licenses:
339
339
  - AGPL-3.0-only
340
340
  metadata:
341
341
  homepage_uri: https://kettle-family.galtzo.com
342
- source_code_uri: https://github.com/kettle-dev/kettle-family/tree/v0.2.1
343
- changelog_uri: https://github.com/kettle-dev/kettle-family/blob/v0.2.1/CHANGELOG.md
342
+ source_code_uri: https://github.com/kettle-dev/kettle-family/tree/v0.2.3
343
+ changelog_uri: https://github.com/kettle-dev/kettle-family/blob/v0.2.3/CHANGELOG.md
344
344
  bug_tracker_uri: https://github.com/kettle-dev/kettle-family/issues
345
- documentation_uri: https://www.rubydoc.info/gems/kettle-family/0.2.1
345
+ documentation_uri: https://www.rubydoc.info/gems/kettle-family/0.2.3
346
346
  funding_uri: https://github.com/sponsors/pboling
347
347
  wiki_uri: https://github.com/kettle-dev/kettle-family/wiki
348
348
  news_uri: https://www.railsbling.com/tags/kettle-family
metadata.gz.sig CHANGED
Binary file