kettle-gha-pins 0.3.20 → 0.3.21

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: b9905dfbde804dd5dfc5722ab134b52c02edded39701caf0d058e4d557f44dc7
4
- data.tar.gz: 8de770c94f6772d01dffb88530400a91ab111ae9fd380ff49a6c3be780c0ab42
3
+ metadata.gz: 7a6e9332df48eb65706569d35bb7ed9f2fb8074775b0348c8635308dd09cdb58
4
+ data.tar.gz: 2fccf392bfa9adf038c153d0122c6b99dc200e06e08c8a3d8624009a42071152
5
5
  SHA512:
6
- metadata.gz: 3796fc440478ca1780105e0066f5cbd4f76d6931fad51dd548e128a760fe79ad66520863e55a0865feabb45cc0e7ff678cfb074e3a51a4df52db0d03b77a8b22
7
- data.tar.gz: fe85c5a5c2255bbc0b557d02a8da7d7eebe06dac0f3ffbf05fb3f17811ab2ba7e99399047b5252bca8ed185132728b1ed7c6059a076d9975fc7f67af82e8009c
6
+ metadata.gz: a18abe0cda784d3981480797268d9cdd858dd320d11d217e1e61d3edd6251f3e5187aaddc51d8ab69b479d71c77e3c971661eb6d886c784223b02675ebec846a
7
+ data.tar.gz: 7a43763fd9eab50687659b0f16ce023d731fcc3d8433d8831a0a82056eb9a0c27aa41dfe9f4d14de294628d5d968bab7ac610e78b417a46761c3b2cf0ac81d1c
checksums.yaml.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- ��'�� ��A=�lm�Bd���9��:���� N29�5�(���E���U�6ٺxFmߙ*�_�����s�u����j���7��'a���k<o����69�!K�.[�7xE8p�R����@�'|��Fj5��g{i��k���9\{ld�!�D�d~��:%[1��3�_&TPꗴ�E�!{S�%=��!��7�<���__�;9 �`���w�n�����1
2
- �ܳy�-��)�
1
+ ��������7ڄz@�Ԑ���Z7K��h�=$f�|���ES7��2� YFQ4�QX]�r��w.`
2
+ ��ڧS!
data/CHANGELOG.md CHANGED
@@ -30,6 +30,17 @@ Please file a bug if you notice a violation of semantic versioning.
30
30
 
31
31
  ### Security
32
32
 
33
+ ## [0.3.21] - 2026-11-08
34
+
35
+ - TAG: [v0.3.21][0.3.21t]
36
+ - COVERAGE: 95.18% -- 1085/1140 lines in 8 files
37
+ - BRANCH COVERAGE: 84.10% -- 439/522 branches in 8 files
38
+ - 25.89% documented
39
+
40
+ ### Added
41
+
42
+ - --offline-fallback flag and KETTLE_GHA_PINS_OFFLINE_FALLBACK env switch: with --offline, fetch live from the GitHub API on a cache miss and populate the cache instead of failing with 'offline cache miss' (family pins runs no longer die on newly introduced actions)
43
+
33
44
  ## [0.3.20] - 2026-10-28
34
45
 
35
46
  - TAG: [v0.3.20][0.3.20t]
@@ -473,7 +484,9 @@ Please file a bug if you notice a violation of semantic versioning.
473
484
  - kettle-jem-template-20260720-005 - Generated README Support & Community rows
474
485
  now include a RubyForum help badge.
475
486
 
476
- [Unreleased]: https://github.com/kettle-dev/kettle-gha-pins/compare/v0.3.20...HEAD
487
+ [Unreleased]: https://github.com/kettle-dev/kettle-gha-pins/compare/v0.3.21...HEAD
488
+ [0.3.21]: https://github.com/kettle-dev/kettle-gha-pins/compare/v0.3.20...v0.3.21
489
+ [0.3.21t]: https://github.com/kettle-dev/kettle-gha-pins/releases/tag/v0.3.21
477
490
  [0.3.20]: https://github.com/kettle-dev/kettle-gha-pins/compare/v0.3.19...v0.3.20
478
491
  [0.3.20t]: https://github.com/kettle-dev/kettle-gha-pins/releases/tag/v0.3.20
479
492
  [0.3.19]: https://github.com/kettle-dev/kettle-gha-pins/compare/v0.3.18...v0.3.19
data/README.md CHANGED
@@ -144,7 +144,9 @@ unless a project opts into a warning window.
144
144
  The action metadata cache uses a one-day TTL by default. Set `--ttl DAYS` to
145
145
  change it; `--ttl 0` forces a refresh. `--offline` trusts the cache without
146
146
  checking TTL or contacting GitHub and fails if required repository metadata is
147
- missing.
147
+ missing. Add `--offline-fallback` (or set `KETTLE_GHA_PINS_OFFLINE_FALLBACK=true`)
148
+ to fetch live from the GitHub API on a cache miss instead of failing; the
149
+ fetched metadata populates the cache, so later offline runs succeed.
148
150
 
149
151
  For family orchestration, `kettle-gha-pins --list --json` emits the action
150
152
  repositories used by a project without network access. A separate
@@ -547,7 +549,7 @@ Thanks for RTFM. ☺️
547
549
  [📌gitmoji]: https://gitmoji.dev
548
550
  [📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
549
551
  [🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
550
- [🧮kloc-img]: https://img.shields.io/badge/KLOC-1.136-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
552
+ [🧮kloc-img]: https://img.shields.io/badge/KLOC-1.140-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
551
553
  [🔐security]: https://github.com/kettle-dev/kettle-gha-pins/blob/main/SECURITY.md
552
554
  [🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
553
555
  [📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
@@ -76,6 +76,7 @@ module Kettle
76
76
  clock: clock,
77
77
  refresh_cache: false,
78
78
  offline: false,
79
+ offline_fallback: %w[true yes 1 on enabled].include?(ENV["KETTLE_GHA_PINS_OFFLINE_FALLBACK"].to_s.strip.downcase),
79
80
  mode: :project,
80
81
  input: nil,
81
82
  reject_patterns: Set.new,
@@ -108,7 +109,7 @@ module Kettle
108
109
  private
109
110
 
110
111
  def build_client
111
- @options[:token] ||= gh_auth_token if @options[:api_base] == API_BASE && !@options[:offline]
112
+ @options[:token] ||= gh_auth_token if @options[:api_base] == API_BASE && (!@options[:offline] || @options[:offline_fallback])
112
113
  persistent_cache = if @options[:cache_path].to_s.empty?
113
114
  nil
114
115
  else
@@ -125,6 +126,7 @@ module Kettle
125
126
  persistent_cache: persistent_cache,
126
127
  refresh_cache: @options[:refresh_cache],
127
128
  offline: @options[:offline],
129
+ offline_fallback: @options[:offline_fallback],
128
130
  fail_on_refresh_error: @options[:mode] == :review
129
131
  )
130
132
  [client, persistent_cache]
@@ -459,6 +461,9 @@ module Kettle
459
461
  opt.on("--offline", "Use only the persistent cache; fail on a cache miss") do
460
462
  @options[:offline] = true
461
463
  end
464
+ opt.on("--offline-fallback", "With --offline, fetch live from the GitHub API on a cache miss and populate the cache") do
465
+ @options[:offline_fallback] = true
466
+ end
462
467
  opt.on("--list", "List project action pins as JSON without network access") do
463
468
  raise OptionParser::InvalidOption, "--list cannot be combined with --review" if @options[:mode] == :review
464
469
 
@@ -17,13 +17,14 @@ module Kettle
17
17
  class CacheMissError < Error; end
18
18
  class RefreshError < Error; end
19
19
 
20
- def initialize(token:, api_base:, user_agent:, persistent_cache: nil, refresh_cache: false, offline: false, fail_on_refresh_error: false, open_timeout: DEFAULT_HTTP_OPEN_TIMEOUT_SECONDS, read_timeout: DEFAULT_HTTP_READ_TIMEOUT_SECONDS, refresh_timeout: DEFAULT_HTTP_REFRESH_TIMEOUT_SECONDS)
20
+ def initialize(token:, api_base:, user_agent:, persistent_cache: nil, refresh_cache: false, offline: false, offline_fallback: false, fail_on_refresh_error: false, open_timeout: DEFAULT_HTTP_OPEN_TIMEOUT_SECONDS, read_timeout: DEFAULT_HTTP_READ_TIMEOUT_SECONDS, refresh_timeout: DEFAULT_HTTP_REFRESH_TIMEOUT_SECONDS)
21
21
  @token = token
22
22
  @api_base = api_base
23
23
  @user_agent = user_agent
24
24
  @persistent_cache = persistent_cache
25
25
  @refresh_cache = refresh_cache
26
26
  @offline = offline
27
+ @offline_fallback = offline_fallback
27
28
  @fail_on_refresh_error = fail_on_refresh_error
28
29
  @open_timeout = open_timeout
29
30
  @read_timeout = read_timeout
@@ -46,15 +47,17 @@ module Kettle
46
47
 
47
48
  if @offline
48
49
  cached = @persistent_cache&.versions_for_repo(repo_ref, fresh: false)
49
- raise CacheMissError, "offline cache miss for #{repo_ref}" if cached.nil?
50
-
51
- @last_versions_cache_hit = true
52
- @release_cache[repo_ref] = cached
53
- return cached
50
+ if cached.nil?
51
+ raise CacheMissError, "offline cache miss for #{repo_ref}" unless @offline_fallback
52
+ else
53
+ @last_versions_cache_hit = true
54
+ @release_cache[repo_ref] = cached
55
+ return cached
56
+ end
54
57
  end
55
58
 
56
59
  stale = nil
57
- unless @refresh_cache
60
+ unless @refresh_cache || @offline
58
61
  cached = @persistent_cache&.versions_for_repo(repo_ref, fresh: true)
59
62
  if cached
60
63
  @last_versions_cache_hit = true
@@ -98,7 +101,7 @@ module Kettle
98
101
  end
99
102
  end
100
103
 
101
- raise CacheMissError, "offline cache miss for #{repo_ref}@#{ref}" if @offline
104
+ raise CacheMissError, "offline cache miss for #{repo_ref}@#{ref}" if @offline && !@offline_fallback
102
105
 
103
106
  data = request_json("/repos/#{repo_ref}/commits/#{uri_encode(ref)}")
104
107
  sha = if data.is_a?(Hash)
@@ -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.20"
9
+ VERSION = "0.3.21"
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.20
4
+ version: 0.3.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter H. Boling
@@ -46,7 +46,7 @@ dependencies:
46
46
  version: '0.1'
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: 0.1.20
49
+ version: 0.1.23
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
@@ -56,7 +56,7 @@ dependencies:
56
56
  version: '0.1'
57
57
  - - ">="
58
58
  - !ruby/object:Gem::Version
59
- version: 0.1.20
59
+ version: 0.1.23
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: ruby-progressbar
62
62
  requirement: !ruby/object:Gem::Requirement
@@ -114,7 +114,7 @@ dependencies:
114
114
  version: '3.1'
115
115
  - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: 3.1.25
117
+ version: 3.1.28
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
@@ -124,7 +124,7 @@ dependencies:
124
124
  version: '3.1'
125
125
  - - ">="
126
126
  - !ruby/object:Gem::Version
127
- version: 3.1.25
127
+ version: 3.1.28
128
128
  - !ruby/object:Gem::Dependency
129
129
  name: bundler-audit
130
130
  requirement: !ruby/object:Gem::Requirement
@@ -222,7 +222,7 @@ dependencies:
222
222
  version: '2.0'
223
223
  - - ">="
224
224
  - !ruby/object:Gem::Version
225
- version: 2.0.28
225
+ version: 2.0.29
226
226
  type: :development
227
227
  prerelease: false
228
228
  version_requirements: !ruby/object:Gem::Requirement
@@ -232,7 +232,7 @@ dependencies:
232
232
  version: '2.0'
233
233
  - - ">="
234
234
  - !ruby/object:Gem::Version
235
- version: 2.0.28
235
+ version: 2.0.29
236
236
  - !ruby/object:Gem::Dependency
237
237
  name: turbo_tests2
238
238
  requirement: !ruby/object:Gem::Requirement
@@ -321,10 +321,10 @@ licenses:
321
321
  - MIT
322
322
  metadata:
323
323
  homepage_uri: https://github.com/kettle-dev/kettle-gha-pins
324
- source_code_uri: https://github.com/kettle-dev/kettle-gha-pins/tree/v0.3.20
325
- changelog_uri: https://github.com/kettle-dev/kettle-gha-pins/blob/v0.3.20/CHANGELOG.md
324
+ source_code_uri: https://github.com/kettle-dev/kettle-gha-pins/tree/v0.3.21
325
+ changelog_uri: https://github.com/kettle-dev/kettle-gha-pins/blob/v0.3.21/CHANGELOG.md
326
326
  bug_tracker_uri: https://github.com/kettle-dev/kettle-gha-pins/issues
327
- documentation_uri: https://www.rubydoc.info/gems/kettle-gha-pins/0.3.20
327
+ documentation_uri: https://www.rubydoc.info/gems/kettle-gha-pins/0.3.21
328
328
  funding_uri: https://github.com/sponsors/pboling
329
329
  wiki_uri: https://github.com/kettle-dev/kettle-gha-pins/wiki
330
330
  news_uri: https://www.railsbling.com/tags/kettle-gha-pins
@@ -355,7 +355,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
355
355
  - !ruby/object:Gem::Version
356
356
  version: '0'
357
357
  requirements: []
358
- rubygems_version: 4.0.20
358
+ rubygems_version: 4.0.24
359
359
  specification_version: 4
360
360
  summary: "\U0001F4CC Shared GitHub Actions pin version rules for kettle-dev tooling."
361
361
  test_files: []
metadata.gz.sig CHANGED
Binary file