kettle-changelog 1.0.3 → 1.0.5

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: 3053fe44758bbd5eb1217aaabd7631a6b7822b83daab32973e594984cb2a2433
4
- data.tar.gz: 8012ad13a243eb193dd1a887e97beaf88c3c48e734aeea36ffea06d8df5a8a34
3
+ metadata.gz: 987f0528fbdee3c91c47d9675fe79fe3e4993f69c4b759ee7413a07c0b6eece9
4
+ data.tar.gz: d20d9e1fff2153b932cb3961d8bb56fd8bd02b0e9257b4b2844eaaa70ac7cb11
5
5
  SHA512:
6
- metadata.gz: 56ae1f5f0398fb33416d10a20c4c09e8179a92cfee4c318ef3964dde113ca9c3f591d476b840c1571ad98b4304e7e43787b78460ec9735de25b9707f6888d4ac
7
- data.tar.gz: 9ef331e0733f7775bb4b2d789b495b842d660ae14278d2f8c38d1ce7225378d09bc057f233e4fba66fa050e3d2088f0c50d8cc1b181b314d784e0ad448d85783
6
+ metadata.gz: d379f0164efc1c4d7214607eb2e745895dce3cb5e0702da2d27d63f62f376ec077b842061e74d98a93ca4ad9015cc3200e4daf8ca73a3d9ba338e8bbb339fc61
7
+ data.tar.gz: 21ecb7793e5b0ebc36d2e0987419a3b9f900267ce04e1edabdfa18c5c3f3e72bc112d6456a95bdc2b8f79df77dc7cf58cd7b2057049aa90238ebd501d1796a8d
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -30,6 +30,36 @@ Please file a bug if you notice a violation of semantic versioning.
30
30
 
31
31
  ### Security
32
32
 
33
+ ## [1.0.5] - 2026-08-28
34
+
35
+ - TAG: [v1.0.5][1.0.5t]
36
+ - COVERAGE: 94.05% -- 1075/1143 lines in 6 files
37
+ - BRANCH COVERAGE: 76.95% -- 374/486 branches in 6 files
38
+ - 39.39% documented
39
+
40
+ ### Fixed
41
+
42
+ - Backfill missing release-tag Markdown references only when the matching local Git tag exists.
43
+
44
+ ## [1.0.4] - 2026-08-28
45
+
46
+ - TAG: [v1.0.4][1.0.4t]
47
+ - COVERAGE: 93.96% -- 1058/1126 lines in 6 files
48
+ - BRANCH COVERAGE: 76.68% -- 365/476 branches in 6 files
49
+ - 37.50% documented
50
+
51
+ ### Changed
52
+
53
+ - [kc] kettle-jem/prepare: updated 9 project files:
54
+ - configuration (1)
55
+ - dependencies (8)
56
+
57
+ - [kc] kettle-jem/template: updated 5 project files:
58
+ - configuration (1)
59
+ - dependencies (1)
60
+ - documentation (2)
61
+ - other (1)
62
+
33
63
  ## [1.0.3] - 2026-08-25
34
64
 
35
65
  - TAG: [v1.0.3][1.0.3t]
@@ -149,7 +179,11 @@ Please file a bug if you notice a violation of semantic versioning.
149
179
 
150
180
  - Initial release
151
181
 
152
- [Unreleased]: https://github.com/kettle-dev/kettle-changelog/compare/v1.0.3...HEAD
182
+ [Unreleased]: https://github.com/kettle-dev/kettle-changelog/compare/v1.0.5...HEAD
183
+ [1.0.5]: https://github.com/kettle-dev/kettle-changelog/compare/v1.0.4...v1.0.5
184
+ [1.0.5t]: https://github.com/kettle-dev/kettle-changelog/releases/tag/v1.0.5
185
+ [1.0.4]: https://github.com/kettle-dev/kettle-changelog/compare/v1.0.3...v1.0.4
186
+ [1.0.4t]: https://github.com/kettle-dev/kettle-changelog/releases/tag/v1.0.4
153
187
  [1.0.3]: https://github.com/kettle-dev/kettle-changelog/compare/v1.0.2...v1.0.3
154
188
  [1.0.3t]: https://github.com/kettle-dev/kettle-changelog/releases/tag/v1.0.3
155
189
  [1.0.2]: https://github.com/kettle-dev/kettle-changelog/compare/v1.0.1...v1.0.2
data/README.md CHANGED
@@ -77,7 +77,9 @@ The _amazing_ test matrix is powered by the kettle-dev stack.
77
77
 
78
78
  </details>
79
79
 
80
- ### Enterprise Support [![Tidelift](https://tidelift.com/badges/package/rubygems/kettle-changelog)](https://tidelift.com/subscription/pkg/rubygems-kettle-changelog?utm_source=rubygems-kettle-changelog&utm_medium=referral&utm_campaign=readme)
80
+ ### Enterprise Support
81
+
82
+ [![Tidelift](https://tidelift.com/badges/package/rubygems/kettle-changelog)](https://tidelift.com/subscription/pkg/rubygems-kettle-changelog?utm_source=rubygems-kettle-changelog&utm_medium=referral&utm_campaign=readme)
81
83
 
82
84
  Available as part of the Tidelift Subscription.
83
85
 
@@ -395,7 +397,7 @@ Thanks for RTFM. ☺️
395
397
  [📌gitmoji]: https://gitmoji.dev
396
398
  [📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
397
399
  [🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
398
- [🧮kloc-img]: https://img.shields.io/badge/KLOC-1.126-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
400
+ [🧮kloc-img]: https://img.shields.io/badge/KLOC-1.143-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
399
401
  [🔐security]: https://github.com/kettle-dev/kettle-changelog/blob/main/SECURITY.md
400
402
  [🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
401
403
  [📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
@@ -23,6 +23,8 @@ module Kettle
23
23
  LINK_REF_DEF_RE = /^\s*\[[^\]]+\]:\s+\S+/
24
24
  # Matches an ATX heading at H4 or deeper (####, #####, ...)
25
25
  DEEP_HEADING_RE = /^\#{4,}\s/
26
+ # Matches the canonical release-tag row emitted for each release section.
27
+ TAG_REFERENCE_USAGE_RE = /^ {0,3}- TAG: \[v(#{CHANGELOG_VERSION_PATTERN_SOURCE})\]\[\1t\]\s*$/o
26
28
 
27
29
  # Initialize the changelog CLI
28
30
  # Sets up paths for CHANGELOG.md and coverage.json
@@ -146,7 +148,7 @@ module Kettle
146
148
  # Keep all content prior to the link-ref (older releases and interspersed refs)
147
149
  preserved_body = after_lines[0...unreleased_ref_idx].join
148
150
  # Then append the tail starting from the Unreleased link-ref line to preserve the footer refs
149
- preserved_footer = after_lines[unreleased_ref_idx..-1].join
151
+ preserved_footer = after_lines[unreleased_ref_idx..].join
150
152
  updated << preserved_body << preserved_footer
151
153
  else
152
154
  # No Unreleased ref found; just append the remainder as-is
@@ -594,7 +596,7 @@ module Kettle
594
596
  # Now next_i points to the next section heading or EOF
595
597
  before = lines[0..(start_i - 1)].join
596
598
  unreleased_body = lines[(start_i + 1)..(next_i - 1)] || []
597
- after_lines = lines[next_i..-1] || []
599
+ after_lines = lines[next_i..] || []
598
600
 
599
601
  # When this is the very first release there is no `## [X.Y.Z]` heading to act
600
602
  # as a boundary, so the footer link-ref block ([Unreleased]: ...) sits at the
@@ -603,7 +605,7 @@ module Kettle
603
605
  if next_i == lines.length
604
606
  footer_i = unreleased_body.index { |l| l.start_with?(UNRELEASED_SECTION_HEADING) }
605
607
  if footer_i
606
- after_lines = unreleased_body[footer_i..-1] + after_lines
608
+ after_lines = unreleased_body[footer_i..] + after_lines
607
609
  unreleased_body = unreleased_body[0...footer_i]
608
610
  end
609
611
  end
@@ -630,12 +632,12 @@ module Kettle
630
632
 
631
633
  prepared_version = release_heading[1]
632
634
  release_and_tail = after.lines
633
- next_release_index = release_and_tail[1..-1].to_a.index { |line| line.start_with?("## [") }
635
+ next_release_index = release_and_tail[1..].to_a.index { |line| line.start_with?("## [") }
634
636
  release_line_count = next_release_index ? next_release_index + 1 : release_and_tail.length
635
637
  release_lines = release_and_tail[0...release_line_count]
636
- tail = release_and_tail[release_line_count..-1].to_a.join
638
+ tail = release_and_tail[release_line_count..].to_a.join
637
639
 
638
- release_body = release_lines[1..-1].to_a.join
640
+ release_body = release_lines[1..].to_a.join
639
641
  merged_body = merge_release_body_with_unreleased(release_body, unreleased_block)
640
642
 
641
643
  release_section = +""
@@ -1103,7 +1105,7 @@ module Kettle
1103
1105
  scan_start = lines.index { |l| l.start_with?(UNRELEASED_SECTION_HEADING) } || lines.length
1104
1106
  t_versions = {}
1105
1107
  non_t_tag_refs = {}
1106
- lines[scan_start..-1].to_a.each do |l|
1108
+ lines[scan_start..].to_a.each do |l|
1107
1109
  # Case A: explicit tag ref key like [1.2.3t]: ...
1108
1110
  if (m = l.match(/^\[(#{CHANGELOG_VERSION_PATTERN_SOURCE})t\]:\s+(\S+)/o))
1109
1111
  t_versions[m[1]] = true
@@ -1237,6 +1239,8 @@ module Kettle
1237
1239
  end
1238
1240
 
1239
1241
  if owner && repo
1242
+ add_missing_tag_link_refs!(lines, owner, repo, except: new_version)
1243
+
1240
1244
  # Add compare link for the new version
1241
1245
  from = prev_version ? "v#{prev_version}" : detect_initial_compare_base(lines)
1242
1246
  new_compare = "[#{new_version}]: https://github.com/#{owner}/#{repo}/compare/#{from}...v#{new_version}\n"
@@ -1251,7 +1255,7 @@ module Kettle
1251
1255
  end
1252
1256
 
1253
1257
  # Rebuild and sort the reference block so Unreleased is first, then newest to oldest versions, preserving everything above first_ref
1254
- ref_lines = lines[first_ref..-1].select { |l| /^\[[^\]]+\]:\s+http/.match?(l) }
1258
+ ref_lines = lines[first_ref..].select { |l| /^\[[^\]]+\]:\s+http/.match?(l) }
1255
1259
  # Deduplicate by key (text inside the square brackets)
1256
1260
  by_key = {}
1257
1261
  ref_lines.each do |l|
@@ -1291,6 +1295,35 @@ module Kettle
1291
1295
  rebuilt.join
1292
1296
  end
1293
1297
 
1298
+ # Historical sections can contain the canonical TAG row while lacking the
1299
+ # matching Markdown reference definition. Reconcile those records rather
1300
+ # than limiting reference generation to the release currently being
1301
+ # prepared.
1302
+ def add_missing_tag_link_refs!(lines, owner, repo, except: nil)
1303
+ tag_versions = lines.filter_map do |line|
1304
+ line.match(TAG_REFERENCE_USAGE_RE)&.[](1)
1305
+ end.uniq
1306
+
1307
+ tag_versions.each do |version|
1308
+ next if version == except
1309
+ next if lines.any? { |line| line.start_with?("[#{version}t]:") }
1310
+ unless local_release_tag?(version)
1311
+ warn("kettle-changelog: local git tag v#{version} is absent; leaving its TAG reference unresolved")
1312
+ next
1313
+ end
1314
+
1315
+ lines << "[#{version}t]: https://github.com/#{owner}/#{repo}/releases/tag/v#{version}\n"
1316
+ end
1317
+ end
1318
+
1319
+ def local_release_tag?(version)
1320
+ @local_release_tags ||= begin
1321
+ output, status = Open3.capture2e("git", "tag", "--list", "v*", chdir: @root)
1322
+ status.success? ? output.lines.map(&:strip) : []
1323
+ end
1324
+ @local_release_tags.include?("v#{version}")
1325
+ end
1326
+
1294
1327
  # Ensure every Markdown atx-style heading line (e.g., "# ", "## ") has exactly one blank line
1295
1328
  # before and after it, skipping content inside fenced code blocks.
1296
1329
  def normalize_heading_spacing(text)
@@ -1335,7 +1368,7 @@ module Kettle
1335
1368
  idx = lines.index { |l| l.start_with?(UNRELEASED_SECTION_HEADING) }
1336
1369
  return text unless idx
1337
1370
  head = lines[0...idx]
1338
- tail = lines[idx..-1]
1371
+ tail = lines[idx..]
1339
1372
  # Ensure exactly one blank line between body and refs
1340
1373
  if head.any? && head.last.to_s.strip != ""
1341
1374
  head << ""
@@ -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.0.3"
8
+ VERSION = "1.0.5"
9
9
  end
10
10
  # Current gem version exposed at the traditional constant location.
11
11
  VERSION = Version::VERSION # Traditional Constant Location
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kettle-changelog
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter H. Boling
@@ -63,7 +63,7 @@ dependencies:
63
63
  requirements:
64
64
  - - ">="
65
65
  - !ruby/object:Gem::Version
66
- version: 3.0.11
66
+ version: 3.0.15
67
67
  - - "<"
68
68
  - !ruby/object:Gem::Version
69
69
  version: 4.0.0
@@ -73,7 +73,7 @@ dependencies:
73
73
  requirements:
74
74
  - - ">="
75
75
  - !ruby/object:Gem::Version
76
- version: 3.0.11
76
+ version: 3.0.15
77
77
  - - "<"
78
78
  - !ruby/object:Gem::Version
79
79
  version: 4.0.0
@@ -194,7 +194,7 @@ dependencies:
194
194
  version: '2.0'
195
195
  - - ">="
196
196
  - !ruby/object:Gem::Version
197
- version: 2.0.20
197
+ version: 2.0.21
198
198
  type: :development
199
199
  prerelease: false
200
200
  version_requirements: !ruby/object:Gem::Requirement
@@ -204,7 +204,7 @@ dependencies:
204
204
  version: '2.0'
205
205
  - - ">="
206
206
  - !ruby/object:Gem::Version
207
- version: 2.0.20
207
+ version: 2.0.21
208
208
  - !ruby/object:Gem::Dependency
209
209
  name: turbo_tests2
210
210
  requirement: !ruby/object:Gem::Requirement
@@ -214,7 +214,7 @@ dependencies:
214
214
  version: '3.2'
215
215
  - - ">="
216
216
  - !ruby/object:Gem::Version
217
- version: 3.2.5
217
+ version: 3.2.6
218
218
  type: :development
219
219
  prerelease: false
220
220
  version_requirements: !ruby/object:Gem::Requirement
@@ -224,7 +224,7 @@ dependencies:
224
224
  version: '3.2'
225
225
  - - ">="
226
226
  - !ruby/object:Gem::Version
227
- version: 3.2.5
227
+ version: 3.2.6
228
228
  - !ruby/object:Gem::Dependency
229
229
  name: ruby-progressbar
230
230
  requirement: !ruby/object:Gem::Requirement
@@ -268,7 +268,7 @@ dependencies:
268
268
  version: '2.0'
269
269
  - - ">="
270
270
  - !ruby/object:Gem::Version
271
- version: 2.0.11
271
+ version: 2.0.12
272
272
  type: :development
273
273
  prerelease: false
274
274
  version_requirements: !ruby/object:Gem::Requirement
@@ -278,7 +278,7 @@ dependencies:
278
278
  version: '2.0'
279
279
  - - ">="
280
280
  - !ruby/object:Gem::Version
281
- version: 2.0.11
281
+ version: 2.0.12
282
282
  description: "\U0001F4DD kettle-changelog formats release sections, manages Unreleased
283
283
  entries, and emits machine-readable release events for Ruby gems."
284
284
  email:
@@ -304,10 +304,10 @@ licenses:
304
304
  - AGPL-3.0-only
305
305
  metadata:
306
306
  homepage_uri: https://kettle-changelog.galtzo.com
307
- source_code_uri: https://github.com/kettle-dev/kettle-changelog/tree/v1.0.3
308
- changelog_uri: https://github.com/kettle-dev/kettle-changelog/blob/v1.0.3/CHANGELOG.md
307
+ source_code_uri: https://github.com/kettle-dev/kettle-changelog/tree/v1.0.5
308
+ changelog_uri: https://github.com/kettle-dev/kettle-changelog/blob/v1.0.5/CHANGELOG.md
309
309
  bug_tracker_uri: https://github.com/kettle-dev/kettle-changelog/issues
310
- documentation_uri: https://www.rubydoc.info/gems/kettle-changelog/1.0.3
310
+ documentation_uri: https://www.rubydoc.info/gems/kettle-changelog/1.0.5
311
311
  funding_uri: https://github.com/sponsors/pboling
312
312
  wiki_uri: https://github.com/kettle-dev/kettle-changelog/wiki
313
313
  news_uri: https://www.railsbling.com/tags/kettle-changelog
metadata.gz.sig CHANGED
Binary file