kettle-gha-pins 0.3.10 → 0.3.12

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: e39d2df910b12d4b40d0978f63481a73d87a5efcdf6ea58c4966b397d3319470
4
- data.tar.gz: 584ac1b59952635a279806c03aba51460a757e9edd2dbcafc5b7f158b8a302dd
3
+ metadata.gz: bbd722b090d367d80e40c34de0df0f3abc00fff51e411a8c0676e45d556eb7ef
4
+ data.tar.gz: 80aa6f0f24d4c5473a6e78d5b487ce34ae3e200a032503b652b9ca37aacfc0ae
5
5
  SHA512:
6
- metadata.gz: 43c208e30cd0c6501479f4cf52a48a3e4df4b9192ada22b05017681a4761ffe01ca4abdb0398cf8c523828a32814ef9fcd51cf57f2be46f7ff55b81c89e05237
7
- data.tar.gz: a47e19be556a73215a786b4e9fe23b50ac1890e5087ed0b5eea1a14e8e7f9dd1ce8da62d8e95a329949a6e339aacda9c1b8e12cabd0debe167e301ed12ca96f9
6
+ metadata.gz: 9ad84fb8c23112d1dd16bdf9226f101daf0d685e1e8d59378118c941a4129b6b274552ca9397bbb6b6c0c3c3a96a85ad1394490421fccb1ff76920f484688266
7
+ data.tar.gz: 49b0370d149323a8a4735afbec6e49f29b34ce939b84b71c9d55980e94918961cf66f6b8edd591572b395bf5def8a3ddea27b1e04a803870cd6619d51c4d6094
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -30,6 +30,32 @@ Please file a bug if you notice a violation of semantic versioning.
30
30
 
31
31
  ### Security
32
32
 
33
+ ## [0.3.12] - 2026-08-12
34
+
35
+ - TAG: [v0.3.12][0.3.12t]
36
+ - COVERAGE: 97.00% -- 1033/1065 lines in 8 files
37
+ - BRANCH COVERAGE: 85.60% -- 416/486 branches in 8 files
38
+ - 25.93% documented
39
+
40
+ ### Changed
41
+
42
+ - Prepare project for kettle-jem templates: updated 7 project files across dependencies (7).
43
+
44
+ - Apply kettle-jem templates: updated 7 project files across configuration (1), dependencies (1), documentation (1), other (4).
45
+
46
+ ## [0.3.11] - 2026-08-10
47
+
48
+ - TAG: [v0.3.11][0.3.11t]
49
+ - COVERAGE: 97.00% -- 1033/1065 lines in 8 files
50
+ - BRANCH COVERAGE: 85.60% -- 416/486 branches in 8 files
51
+ - 25.93% documented
52
+
53
+ ### Fixed
54
+
55
+ - Resolve large GitHub Actions annotated-tag inventories through a single Git exchange so stale cache reviews do not time out on repositories such as codecov/codecov-action.
56
+
57
+ - Replace refreshed GitHub Actions cache inventories instead of retaining obsolete versions and forcing repeated refreshes.
58
+
33
59
  ## [0.3.10] - 2026-08-09
34
60
 
35
61
  - TAG: [v0.3.10][0.3.10t]
@@ -297,7 +323,11 @@ Please file a bug if you notice a violation of semantic versioning.
297
323
  - kettle-jem-template-20260720-005 - Generated README Support & Community rows
298
324
  now include a RubyForum help badge.
299
325
 
300
- [Unreleased]: https://github.com/kettle-dev/kettle-gha-pins/compare/v0.3.10...HEAD
326
+ [Unreleased]: https://github.com/kettle-dev/kettle-gha-pins/compare/v0.3.12...HEAD
327
+ [0.3.12]: https://github.com/kettle-dev/kettle-gha-pins/compare/v0.3.11...v0.3.12
328
+ [0.3.12t]: https://github.com/kettle-dev/kettle-gha-pins/releases/tag/v0.3.12
329
+ [0.3.11]: https://github.com/kettle-dev/kettle-gha-pins/compare/v0.3.10...v0.3.11
330
+ [0.3.11t]: https://github.com/kettle-dev/kettle-gha-pins/releases/tag/v0.3.11
301
331
  [0.3.10]: https://github.com/kettle-dev/kettle-gha-pins/compare/v0.3.9...v0.3.10
302
332
  [0.3.10t]: https://github.com/kettle-dev/kettle-gha-pins/releases/tag/v0.3.10
303
333
  [0.3.9]: https://github.com/kettle-dev/kettle-gha-pins/compare/v0.3.8...v0.3.9
data/README.md CHANGED
@@ -57,7 +57,7 @@ kettle-gha-pins --write --upgrade major
57
57
 
58
58
  ### Compatibility
59
59
 
60
- Compatible with MRI Ruby 2.4.0+, and concordant releases of JRuby, and TruffleRuby.
60
+ Compatible with MRI Ruby 2.4.0+, JRuby, and TruffleRuby.
61
61
  CI workflows and Appraisals are generated for MRI Ruby 2.4.0+.
62
62
  This test floor is configured by `ruby.test_minimum` in `.kettle-jem.yml` and
63
63
  may be higher than the gem's runtime compatibility floor when legacy Rubies are
@@ -277,8 +277,7 @@ See [SECURITY.md][🔐security].
277
277
  ## 🤝 Contributing
278
278
 
279
279
  If you need some ideas of where to help, you could work on adding more code coverage,
280
- or if it is already 💯 (see [below](#code-coverage)) check [issues][🤝gh-issues] or [PRs][🤝gh-pulls],
281
- or use the gem and think about how it could be better.
280
+ check [issues][🤝gh-issues] or [PRs][🤝gh-pulls], or use the gem and think about how it could be better.
282
281
 
283
282
  We [![Keep A Changelog][📗keep-changelog-img]][📗keep-changelog] so if you make changes, remember to update it.
284
283
 
@@ -314,19 +313,6 @@ Made with [contributors-img][🖐contrib-rocks].
314
313
 
315
314
  Also see GitLab Contributors: [https://gitlab.com/kettle-dev/kettle-gha-pins/-/graphs/main][🚎contributors-gl]
316
315
 
317
- <details markdown="1">
318
- <summary>⭐️ Star History</summary>
319
-
320
- <a href="https://star-history.com/kettle-dev/kettle-gha-pins&Date">
321
- <picture>
322
- <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=kettle-dev/kettle-gha-pins&type=Date&theme=dark" />
323
- <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=kettle-dev/kettle-gha-pins&type=Date" />
324
- <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=kettle-dev/kettle-gha-pins&type=Date" />
325
- </picture>
326
- </a>
327
-
328
- </details>
329
-
330
316
  ## 📌 Versioning
331
317
 
332
318
  This library follows [![Semantic Versioning 2.0.0][📌semver-img]][📌semver] for its public API where practical.
@@ -582,7 +568,7 @@ Thanks for RTFM. ☺️
582
568
  [📌gitmoji]: https://gitmoji.dev
583
569
  [📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
584
570
  [🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
585
- [🧮kloc-img]: https://img.shields.io/badge/KLOC-1.042-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
571
+ [🧮kloc-img]: https://img.shields.io/badge/KLOC-1.065-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
586
572
  [🔐security]: https://github.com/kettle-dev/kettle-gha-pins/blob/main/SECURITY.md
587
573
  [🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
588
574
  [📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
@@ -2,6 +2,7 @@
2
2
 
3
3
  require "json"
4
4
  require "net/http"
5
+ require "open3"
5
6
  require "timeout"
6
7
  require "uri"
7
8
 
@@ -10,6 +11,7 @@ module Kettle
10
11
  module Pins
11
12
  # Lightweight GitHub API client for commit and release SHA resolution.
12
13
  class GitHubClient
14
+ ANNOTATED_TAG_GIT_FALLBACK_THRESHOLD = 4
13
15
  class CacheMissError < Error; end
14
16
  class RefreshError < Error; end
15
17
 
@@ -150,7 +152,7 @@ module Kettle
150
152
  data = request_json("/repos/#{repo_ref}/git/matching-refs/tags/")
151
153
  return nil unless data.is_a?(Array)
152
154
 
153
- data.each_with_object({}) do |entry, memo|
155
+ entries = data.each_with_object([]) do |entry, memo|
154
156
  ref = entry["ref"].to_s
155
157
  next unless ref.start_with?("refs/tags/")
156
158
 
@@ -160,16 +162,51 @@ module Kettle
160
162
  object = entry["object"]
161
163
  next unless object.is_a?(Hash)
162
164
 
163
- sha = object["sha"].to_s[0, 40]
164
- case object["type"]
165
+ memo << [tag, object["type"].to_s, object["sha"].to_s[0, 40]]
166
+ end
167
+ annotated_tag_shas = git_tag_ref_shas(repo_ref) if entries.count { |_, type, _| type == "tag" } > ANNOTATED_TAG_GIT_FALLBACK_THRESHOLD
168
+
169
+ entries.each_with_object({}) do |(tag, type, sha), memo|
170
+ case type
165
171
  when "commit"
166
172
  memo[tag] = sha
167
173
  when "tag"
168
- memo[tag] = annotated_tag_commit_sha(repo_ref, sha)
174
+ memo[tag] = annotated_tag_shas&.fetch(tag, nil) || annotated_tag_commit_sha(repo_ref, sha)
169
175
  end
170
176
  end
171
177
  end
172
178
 
179
+ # The REST API exposes annotated tags as tag objects, requiring one
180
+ # additional request per tag to reach the commit. A single Git
181
+ # protocol exchange returns both tag objects and peeled commit refs,
182
+ # avoiding a refresh timeout for repositories with large tag histories.
183
+ def git_tag_ref_shas(repo_ref)
184
+ return unless @api_base.to_s.sub(%r{/\z}, "") == API_BASE
185
+
186
+ stdout, _stderr, status = Open3.capture3(
187
+ {"GIT_TERMINAL_PROMPT" => "0"},
188
+ "git",
189
+ "ls-remote",
190
+ "--tags",
191
+ "https://github.com/#{repo_ref}.git"
192
+ )
193
+ return unless status.success?
194
+
195
+ stdout.each_line.each_with_object({}) do |line, memo|
196
+ sha, ref = line.split
197
+ next unless SHA_RE.match?(sha.to_s)
198
+ next unless ref.to_s.start_with?("refs/tags/")
199
+
200
+ peeled = ref.end_with?("^{}")
201
+ tag = ref.sub(%r{\Arefs/tags/}, "").sub(/\^\{\}\z/, "")
202
+ next unless VersionRubric.parse(tag)
203
+
204
+ memo[tag] = sha if peeled || !memo.key?(tag)
205
+ end
206
+ rescue IOError, SystemCallError
207
+ nil
208
+ end
209
+
173
210
  def annotated_tag_commit_sha(repo_ref, tag_sha)
174
211
  return nil if tag_sha.to_s.empty?
175
212
 
@@ -54,8 +54,15 @@ module Kettle
54
54
  return if repo_ref.to_s.empty?
55
55
 
56
56
  action = data.fetch("actions")[repo_ref] ||= {}
57
- stored_versions = action["versions"] ||= {}
58
- refs = action["refs"] ||= {}
57
+ previous_versions = action["versions"] || {}
58
+ previous_tags = previous_versions.values.each_with_object([]) do |entry, tags|
59
+ tag = entry["tag"].to_s
60
+ tags << tag unless tag.empty?
61
+ end
62
+ stored_versions = {}
63
+ refs = (action["refs"] || {}).reject { |ref, _entry| previous_tags.include?(ref) }
64
+ action["versions"] = stored_versions
65
+ action["refs"] = refs
59
66
  timestamp = @clock.call.utc.iso8601
60
67
 
61
68
  versions.each do |entry|
@@ -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.10"
9
+ VERSION = "0.3.12"
10
10
  end
11
11
  # Current gem version exposed at the traditional constant location.
12
12
  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-gha-pins
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.10
4
+ version: 0.3.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter H. Boling
@@ -91,20 +91,20 @@ dependencies:
91
91
  requirements:
92
92
  - - "~>"
93
93
  - !ruby/object:Gem::Version
94
- version: '2.5'
94
+ version: '3.0'
95
95
  - - ">="
96
96
  - !ruby/object:Gem::Version
97
- version: 2.5.18
97
+ version: 3.0.6
98
98
  type: :development
99
99
  prerelease: false
100
100
  version_requirements: !ruby/object:Gem::Requirement
101
101
  requirements:
102
102
  - - "~>"
103
103
  - !ruby/object:Gem::Version
104
- version: '2.5'
104
+ version: '3.0'
105
105
  - - ">="
106
106
  - !ruby/object:Gem::Version
107
- version: 2.5.18
107
+ version: 3.0.6
108
108
  - !ruby/object:Gem::Dependency
109
109
  name: bundler-audit
110
110
  requirement: !ruby/object:Gem::Requirement
@@ -182,7 +182,7 @@ dependencies:
182
182
  version: '3.2'
183
183
  - - ">="
184
184
  - !ruby/object:Gem::Version
185
- version: 3.2.0
185
+ version: 3.2.2
186
186
  type: :development
187
187
  prerelease: false
188
188
  version_requirements: !ruby/object:Gem::Requirement
@@ -192,7 +192,7 @@ dependencies:
192
192
  version: '3.2'
193
193
  - - ">="
194
194
  - !ruby/object:Gem::Version
195
- version: 3.2.0
195
+ version: 3.2.2
196
196
  - !ruby/object:Gem::Dependency
197
197
  name: kettle-test
198
198
  requirement: !ruby/object:Gem::Requirement
@@ -222,7 +222,7 @@ dependencies:
222
222
  version: '3.2'
223
223
  - - ">="
224
224
  - !ruby/object:Gem::Version
225
- version: 3.2.4
225
+ version: 3.2.5
226
226
  type: :development
227
227
  prerelease: false
228
228
  version_requirements: !ruby/object:Gem::Requirement
@@ -232,7 +232,7 @@ dependencies:
232
232
  version: '3.2'
233
233
  - - ">="
234
234
  - !ruby/object:Gem::Version
235
- version: 3.2.4
235
+ version: 3.2.5
236
236
  - !ruby/object:Gem::Dependency
237
237
  name: stone_checksums
238
238
  requirement: !ruby/object:Gem::Requirement
@@ -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.10
305
- changelog_uri: https://github.com/kettle-dev/kettle-gha-pins/blob/v0.3.10/CHANGELOG.md
304
+ source_code_uri: https://github.com/kettle-dev/kettle-gha-pins/tree/v0.3.12
305
+ changelog_uri: https://github.com/kettle-dev/kettle-gha-pins/blob/v0.3.12/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.10
307
+ documentation_uri: https://www.rubydoc.info/gems/kettle-gha-pins/0.3.12
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