kettle-gha-pins 0.3.2 → 0.3.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: 0a8ee3ba1a8f40ec496c5f63b4448f30fbcd488259eb6cb1dc6d3f8d81dbf455
4
- data.tar.gz: c87718cf11dd6dfb85cb5991cab292420fecfe1fd01ef5e4717d927382ea3fad
3
+ metadata.gz: ace9741a6103bddad79df3803ccc35153af81161b7c21c1615f08a10604e6c92
4
+ data.tar.gz: 8f212c66b4cbb24a32491dfb8c9ede3477492daa20449e9eaa2d3278a2859818
5
5
  SHA512:
6
- metadata.gz: 42fdfdda525a87c5bc54de0fbe1fa99572a8dbdc72b02d7ac33452aa19c5330284c2e71ddbc4b67ae184d0de486ba14de0adee021f7a2b682f164dda48d15eb8
7
- data.tar.gz: 3c6cb2f458a769a48cfb4b31c58b116027fccd889349fbfabeebeec8409f655cff8b9fb3ca91f68c0cc3289ecd43028089aa2ef85f41cbb06fec46cf4c6a9ffb
6
+ metadata.gz: e411ca542ea1db8da7c50018698d07958d06da43ec83259ae9b98d5bec7c3417c3d5b42ef49bf58fc48ab082088277bc63832e633038720304e59a18a0c6bece
7
+ data.tar.gz: e9ee10f5a5a2d517b1579c14dc7f6369c043d74ba568bf3d4cff79996cec4386b032c0c9d1d442362be66fa89cf072524daf83157ad2272a746e54b68375747a
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -30,6 +30,21 @@ Please file a bug if you notice a violation of semantic versioning.
30
30
 
31
31
  ### Security
32
32
 
33
+ ## [0.3.3] - 2026-07-28
34
+
35
+ - TAG: [v0.3.3][0.3.3t]
36
+ - COVERAGE: 98.94% -- 935/945 lines in 8 files
37
+ - BRANCH COVERAGE: 90.91% -- 380/418 branches in 8 files
38
+ - 24.04% documented
39
+
40
+ ### Fixed
41
+
42
+ - Version comment normalization now rewrites equivalent comments to a real
43
+ action tag, preferring the most specific version spelling when both equivalent
44
+ tags exist.
45
+ - Two-segment version comments like `v2.0` are now parsed when deciding whether
46
+ an adjacent SHA-pin comment needs normalization.
47
+
33
48
  ## [0.3.2] - 2026-07-27
34
49
 
35
50
  - TAG: [v0.3.2][0.3.2t]
@@ -181,7 +196,9 @@ Please file a bug if you notice a violation of semantic versioning.
181
196
  - kettle-jem-template-20260720-005 - Generated README Support & Community rows
182
197
  now include a RubyForum help badge.
183
198
 
184
- [Unreleased]: https://github.com/kettle-dev/kettle-gha-pins/compare/v0.3.2...HEAD
199
+ [Unreleased]: https://github.com/kettle-dev/kettle-gha-pins/compare/v0.3.3...HEAD
200
+ [0.3.3]: https://github.com/kettle-dev/kettle-gha-pins/compare/v0.3.2...v0.3.3
201
+ [0.3.3t]: https://github.com/kettle-dev/kettle-gha-pins/releases/tag/v0.3.3
185
202
  [0.3.2]: https://github.com/kettle-dev/kettle-gha-pins/compare/v0.3.1...v0.3.2
186
203
  [0.3.2t]: https://github.com/kettle-dev/kettle-gha-pins/releases/tag/v0.3.2
187
204
  [0.3.1]: https://github.com/kettle-dev/kettle-gha-pins/compare/v0.3.0...v0.3.1
data/README.md CHANGED
@@ -563,7 +563,7 @@ Thanks for RTFM. ☺️
563
563
  [📌gitmoji]: https://gitmoji.dev
564
564
  [📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
565
565
  [🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
566
- [🧮kloc-img]: https://img.shields.io/badge/KLOC-0.925-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
566
+ [🧮kloc-img]: https://img.shields.io/badge/KLOC-0.945-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
567
567
  [🔐security]: https://github.com/kettle-dev/kettle-gha-pins/blob/main/SECURITY.md
568
568
  [🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
569
569
  [📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
@@ -27,9 +27,9 @@ module Kettle
27
27
  level = VersionRubric.normalize_upgrade_level(upgrade_level)
28
28
 
29
29
  current_ref = old_ref.to_s.strip
30
- return {is_outdated: false, updates: nil, reason: nil, current_version: nil} if current_ref.empty?
31
-
32
30
  available_versions = versions || []
31
+ return {is_outdated: false, updates: nil, reason: nil, current_version: nil, versions: available_versions} if current_ref.empty?
32
+
33
33
  latest = available_versions.first
34
34
 
35
35
  current_sha = if SHA_RE.match?(current_ref) || WEAK_SHA_RE.match?(current_ref)
@@ -114,6 +114,7 @@ module Kettle
114
114
  updates: updates,
115
115
  reason: reason,
116
116
  current_version: current_version,
117
+ versions: available_versions,
117
118
  latest_outdated: latest_outdated
118
119
  }
119
120
  end
@@ -34,8 +34,8 @@ module Kettle
34
34
  VALID_UPGRADE_LEVELS = Kettle::Gha::Pins::VALID_UPGRADE_LEVELS
35
35
  PersistentActionCache = Kettle::Gha::Pins::PersistentActionCache
36
36
  GitHubClient = Kettle::Gha::Pins::GitHubClient
37
- VERSION_COMMENT_SUFFIX_RE = /\A\s+#\s*v?(?<version>\d+(?:\.\d+\.\d+(?:[-.]?[0-9A-Za-z.-]+)?)?)/
38
- VERSION_COMMENT_REPLACEMENT_RE = /\A(?<prefix>\s+#\s*)v?\d+(?:\.\d+\.\d+(?:[-.]?[0-9A-Za-z.-]+)?)?/
37
+ VERSION_COMMENT_SUFFIX_RE = /\A\s+#\s*v?(?<version>\d+(?:\.\d+){0,2}(?:[-.]?[0-9A-Za-z.-]+)?)/
38
+ VERSION_COMMENT_REPLACEMENT_RE = /\A(?<prefix>\s+#\s*)v?\d+(?:\.\d+){0,2}(?:[-.]?[0-9A-Za-z.-]+)?/
39
39
 
40
40
  def self.release_version_sort_key(entry)
41
41
  Kettle::Gha::Pins::VersionRubric.sort_key(entry)
@@ -151,10 +151,15 @@ module Kettle
151
151
  end
152
152
  if updates.nil? && upgrade_plan[:current_version]
153
153
  comment_version = version_comment_from_line(text, node[:line], node[:col], parsed_ref[:value])
154
- if comment_version && comment_version != upgrade_plan[:current_version]
154
+ comment_update_version = VersionRubric.comment_update_version(
155
+ comment_version,
156
+ upgrade_plan[:current_version],
157
+ known_versions: upgrade_plan.fetch(:versions, [])
158
+ )
159
+ if comment_update_version
155
160
  updates = {
156
161
  new_ref: old_ref,
157
- new_version: upgrade_plan[:current_version],
162
+ new_version: comment_update_version,
158
163
  old_version: comment_version,
159
164
  reason: COMMENT_REASON,
160
165
  action: repo_ref
@@ -6,7 +6,7 @@ module Kettle
6
6
  # Version namespace for this gem.
7
7
  module Version
8
8
  # Current gem version.
9
- VERSION = "0.3.2"
9
+ VERSION = "0.3.3"
10
10
  end
11
11
  # Current gem version exposed at the traditional constant location.
12
12
  VERSION = Version::VERSION # Traditional Constant Location
@@ -106,6 +106,39 @@ module Kettle
106
106
  end.max_by { |entry| sort_key(entry) }
107
107
  end
108
108
 
109
+ def comment_update_version(comment_version, resolved_version, known_versions: [])
110
+ comment = parse(comment_version)
111
+ resolved = parse(resolved_version)
112
+ return nil unless comment && resolved
113
+
114
+ resolved_entry = exact_entry_for_version(known_versions, resolved_version)
115
+ comment_entry = exact_entry_for_version(known_versions, comment_version)
116
+
117
+ if comment == resolved && resolved_entry && comment_entry
118
+ preferred = entries_for_semantic_version(known_versions, comment).max_by { |known_entry| sort_key(known_entry) }
119
+ preferred_version = preferred.fetch(:version)
120
+ (preferred_version == comment_version.to_s) ? nil : preferred_version
121
+ else
122
+ return nil if comment_version.to_s == resolved_version.to_s
123
+
124
+ resolved_version
125
+ end
126
+ end
127
+
128
+ def exact_entry_for_version(versions, version)
129
+ parsed = parse(version)
130
+ return nil unless parsed
131
+
132
+ versions.find do |entry|
133
+ entry.fetch(:version_obj, nil) == parsed &&
134
+ entry.fetch(:version, nil).to_s == parsed.to_s
135
+ end
136
+ end
137
+
138
+ def entries_for_semantic_version(versions, version_obj)
139
+ versions.select { |entry| entry.fetch(:version_obj, nil) == version_obj }
140
+ end
141
+
109
142
  def normalize_upgrade_level(level)
110
143
  normalized = level.to_s.downcase
111
144
  VALID_UPGRADE_LEVELS.include?(normalized) ? normalized : DEFAULT_UPGRADE_LEVEL
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kettle-gha-pins
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter H. Boling
@@ -301,10 +301,10 @@ licenses:
301
301
  - MIT
302
302
  metadata:
303
303
  homepage_uri: https://github.com/kettle-dev/kettle-gha-pins
304
- source_code_uri: https://github.com/kettle-dev/kettle-gha-pins/tree/v0.3.2
305
- changelog_uri: https://github.com/kettle-dev/kettle-gha-pins/blob/v0.3.2/CHANGELOG.md
304
+ source_code_uri: https://github.com/kettle-dev/kettle-gha-pins/tree/v0.3.3
305
+ changelog_uri: https://github.com/kettle-dev/kettle-gha-pins/blob/v0.3.3/CHANGELOG.md
306
306
  bug_tracker_uri: https://github.com/kettle-dev/kettle-gha-pins/issues
307
- documentation_uri: https://www.rubydoc.info/gems/kettle-gha-pins/0.3.2
307
+ documentation_uri: https://www.rubydoc.info/gems/kettle-gha-pins/0.3.3
308
308
  funding_uri: https://github.com/sponsors/pboling
309
309
  wiki_uri: https://github.com/kettle-dev/kettle-gha-pins/wiki
310
310
  news_uri: https://www.railsbling.com/tags/kettle-gha-pins
metadata.gz.sig CHANGED
Binary file