kettle-dev 3.1.40 → 3.1.41

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: 3ae2886baae33e7a58773229723010348ad312ab27a0f62ce0fddace28eec9b6
4
- data.tar.gz: 399aada6ddd39e258e56e3a148e4cbe5c58c206aac6fcbc8424ca41f332f29d1
3
+ metadata.gz: bf0e69682a72ff3f9debb5527d229782560d91c06fb9e5ac1305577eb69d035d
4
+ data.tar.gz: bec334cbf8d19acff4c7735206e9f5b8f5643509e6f85a60e9efc71c61fe4e4a
5
5
  SHA512:
6
- metadata.gz: 1a8c61b5a3b9fdb06b9f76749a073b590b0083e6f4be236227e7953f2ccfbf05153a47db0b475efeeba30ba033eac2a02fecbb93d135d2c0e8b1ac4c09df63a0
7
- data.tar.gz: 9a47eb30d0448179add78e2137c9dafab25bd7e32032f248a54d004a1b17621b0c3206a51ac247accc9d8286d2c7a8c172fabc9b9df529405becf925139719d7
6
+ metadata.gz: 9accbca8eaf70152a15e7e57e4924b28e108970b0245aad04a30c4bef3e23a30baccdf70ebbc1a50eaebe3169f40053dfe73b04c539c4e7a84eaa3a06932a2b7
7
+ data.tar.gz: 44b0402ae071d5cf15a4ee85649179ad406fd92715b866e2242696a214e2acb968a9fa79a35eadb9dd9125f94e0f55eb58ac9def0df0f011821cb8b012a2b12c
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
+ ## [3.1.41] - 2026-12-04
34
+
35
+ - TAG: [v3.1.41][3.1.41t]
36
+ - COVERAGE: 91.57% -- 6749/7370 lines in 53 files
37
+ - BRANCH COVERAGE: 75.71% -- 2597/3430 branches in 53 files
38
+ - 57.12% documented
39
+
40
+ ### Changed
41
+
42
+ - Poll GitHub Actions in `Kettle::Dev::CIMonitor` with a single `GET /repos/{owner}/{repo}/actions/runs?head_sha={sha}&per_page=100` request per repo per cycle (`CIHelpers.latest_runs_for_head`, falling back to per-workflow `latest_run` if `total_count > 100`), cutting wave API volume by ~15x, and raise default `K_RELEASE_CI_POLL_INTERVAL` from 1s to 5s
43
+
44
+ ### Fixed
45
+
46
+ - Gate `kettle-release` `bundle install` phases (pre-step-0 lockfile materialization, borrowed changelog bundles, and standard `bin/setup`) on read-only `bundle check` with the identical release ENV, and serialize actual `bundle install` runs with a cross-process `flock` under XDG state so parallel family releases do not race on Bundler's shared `bundler/gems/` git checkouts
47
+
33
48
  ## [3.1.40] - 2026-12-04
34
49
 
35
50
  - TAG: [v3.1.40][3.1.40t]
@@ -4579,7 +4594,9 @@ Please file a bug if you notice a violation of semantic versioning.
4579
4594
  - Selecting will run the selected workflow via `act`
4580
4595
  - This may move to its own gem in the future.
4581
4596
 
4582
- [Unreleased]: https://github.com/kettle-dev/kettle-dev/compare/v3.1.40...HEAD
4597
+ [Unreleased]: https://github.com/kettle-dev/kettle-dev/compare/v3.1.41...HEAD
4598
+ [3.1.41]: https://github.com/kettle-dev/kettle-dev/compare/v3.1.40...v3.1.41
4599
+ [3.1.41t]: https://github.com/kettle-dev/kettle-dev/releases/tag/v3.1.41
4583
4600
  [3.1.40]: https://github.com/kettle-dev/kettle-dev/compare/v3.1.39...v3.1.40
4584
4601
  [3.1.40t]: https://github.com/kettle-dev/kettle-dev/releases/tag/v3.1.40
4585
4602
  [3.1.39]: https://github.com/kettle-dev/kettle-dev/compare/v3.1.38...v3.1.39
data/README.md CHANGED
@@ -202,7 +202,12 @@ GitHub API and CI helpers
202
202
  - `GITHUB_TOKEN` or `GH_TOKEN`: Token used by `ci:act` and release workflow checks to query GitHub Actions status at higher rate limits
203
203
  - `GITLAB_TOKEN` or `GL_TOKEN`: Token used by `ci:act` and CI monitor to query GitLab pipeline status
204
204
  - `K_RELEASE_CI_REQUESTS_PER_MINUTE`: GitHub API request budget for the release CI monitor (default 90/min). Requests above the budget are spaced out; an exhausted quota parks the monitor until the reset instead of failing
205
+ - `K_RELEASE_CI_POLL_INTERVAL`: Seconds between GitHub Actions poll cycles (default 5; polls all workflows for `HEAD` in 1 `/actions/runs?head_sha=...` request per cycle)
205
206
  - `K_RELEASE_CI_JOBS_POLL_INTERVAL`: Minimum seconds between job-level polls of an in-flight workflow run during release CI monitoring (default 60). Job-level detection catches a failed job in a large matrix before the run concludes, without multiplying API request volume
207
+ - `K_RELEASE_CI_TIME_LIMIT`: Optional soft CI wait limit in seconds (also `--ci-time-limit SECONDS`, default unlimited). When reached with no failures, proceeds with a warning if `current.yml` (when present) or an allow-listed test workflow has passed; fails closed otherwise
208
+ - `K_RELEASE_CI_REQUIRED_WORKFLOWS`: Comma-separated test workflow files/stems required to pass before `--ci-time-limit` can bypass unfinished secondary workflows (also `--ci-required-workflows`)
209
+ - `KETTLE_DEV_RESET_BOOTSTRAP_CACHE`: Override the XDG cache directory (`~/.cache/kettle-dev/reset-bootstrap`) used to cache isolated `LockfileReset` bootstrap gems across parallel releases
210
+ - `KETTLE_DEV_BUNDLE_INSTALL_LOCK`: Override the XDG state `flock` path (`~/.local/state/kettle-dev/bundle-install-<ruby-abi>.lock`) used to serialize `bundle install` runs across parallel releases (redundant installs are skipped via `bundle check`)
206
211
 
207
212
  Releasing and signing
208
213
 
@@ -365,6 +370,7 @@ What it does:
365
370
  - After a transient CI or provider failure with no code, version, changelog, or lockfile changes, restart at the failed step: for example, `bundle exec kettle-release --start-step 10` for CI monitoring or `bundle exec kettle-release --start-step 15` for RubyGems publication. The legacy `start_step=10` spelling remains supported.
366
371
  - If the failure required a code or release-metadata change, rerun `bundle exec kettle-release` from step 0 so the release checks, prep metadata, commit, and CI all describe the new release commit.
367
372
  - For an intentional same-commit CI bypass, use `bundle exec kettle-release --skip-ci` (or `--skip-steps 10`); this skips remote CI monitoring only and does not claim that CI passed.
373
+ - To cap remote CI wait time while still requiring tests to pass: `bundle exec kettle-release --ci-time-limit 600` (optionally add `--ci-required-workflows current,locked_deps`).
368
374
  - To retain release documentation generation while bypassing a known Appraisal-only issue, use `bundle exec kettle-release --skip-appraisals`.
369
375
  - After fixing a failed pre-release gate, rerun from step 0: `bundle exec kettle-release`
370
376
  - After intentionally handling a failed pre-release gate, skip it and start numbered release steps: `bundle exec kettle-release --start-step 1`
@@ -1040,7 +1046,7 @@ Thanks for RTFM. ☺️
1040
1046
  [📌gitmoji]: https://gitmoji.dev
1041
1047
  [📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
1042
1048
  [🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
1043
- [🧮kloc-img]: https://img.shields.io/badge/KLOC-7.309-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
1049
+ [🧮kloc-img]: https://img.shields.io/badge/KLOC-7.370-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
1044
1050
  [🔐security]: https://github.com/kettle-dev/kettle-dev/blob/main/SECURITY.md
1045
1051
  [🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
1046
1052
  [📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
@@ -182,6 +182,50 @@ module Kettle
182
182
  nil
183
183
  end
184
184
 
185
+ # Fetch all workflow runs for +head_sha+ in a single API request and return
186
+ # a Hash of workflow basename => latest normalized run hash. Returns nil on
187
+ # transient failure or when total_count exceeds 100 so callers can fall back
188
+ # to per-workflow {#latest_run} queries.
189
+ # @param owner [String]
190
+ # @param repo [String]
191
+ # @param head_sha [String]
192
+ # @param token [String, nil]
193
+ # @return [Hash{String => Hash}, nil]
194
+ def latest_runs_for_head(owner:, repo:, head_sha:, token: default_token)
195
+ return nil if owner.to_s.empty? || repo.to_s.empty? || head_sha.to_s.empty?
196
+
197
+ url = "https://api.github.com/repos/#{owner}/#{repo}/actions/runs?head_sha=#{URI.encode_www_form_component(head_sha)}&per_page=100"
198
+ data = github_get_json(url, token: token)
199
+ return nil unless data.is_a?(Hash)
200
+ return nil if data["total_count"].to_i > 100
201
+
202
+ grouped = Hash.new { |h, k| h[k] = [] }
203
+ Array(data["workflow_runs"]).each do |run|
204
+ wf = File.basename(run["path"].to_s)
205
+ next if wf.empty?
206
+
207
+ grouped[wf] << run
208
+ end
209
+
210
+ grouped.each_with_object({}) do |(wf, runs), memo|
211
+ run = preferred_head_run(runs)
212
+ next unless run
213
+
214
+ memo[wf] = {
215
+ "status" => run["status"],
216
+ "conclusion" => run["conclusion"],
217
+ "html_url" => run["html_url"],
218
+ "id" => run["id"],
219
+ "head_sha" => run["head_sha"]
220
+ }
221
+ end
222
+ rescue Kettle::Dev::CIAuthError, Kettle::Dev::CIRateLimitError, Kettle::Dev::CIConfigurationError
223
+ raise
224
+ rescue => e
225
+ Kettle::Dev.debug_error(e, __method__)
226
+ nil
227
+ end
228
+
185
229
  def latest_repository_workflow_run(owner:, repo:, workflow_file:, branch:, head_sha:, token:)
186
230
  data = github_get_json(
187
231
  "https://api.github.com/repos/#{owner}/#{repo}/actions/runs?branch=#{URI.encode_www_form_component(branch)}&per_page=100",
@@ -434,9 +434,14 @@ module Kettle
434
434
  break if pending_workflows.empty?
435
435
 
436
436
  completed = passed.size + failed.size
437
+ batch_runs = Kettle::Dev::CIHelpers.latest_runs_for_head(owner: owner, repo: repo, head_sha: head_sha)
437
438
  pending_workflows.each do |wf|
438
439
  keepalive_timer.call
439
- run = Kettle::Dev::CIHelpers.latest_run(owner: owner, repo: repo, workflow_file: wf, branch: branch, require_head: true, head_sha: head_sha)
440
+ run = if batch_runs
441
+ batch_runs[wf]
442
+ else
443
+ Kettle::Dev::CIHelpers.latest_run(owner: owner, repo: repo, workflow_file: wf, branch: branch, require_head: true, head_sha: head_sha)
444
+ end
440
445
  completed_workflow = nil
441
446
  if run
442
447
  last_status[wf] = run["status"].to_s unless run["status"].to_s.empty?
@@ -781,7 +786,7 @@ module Kettle
781
786
  rescue
782
787
  nil
783
788
  end
784
- (seconds && seconds >= 0) ? seconds : 1
789
+ (seconds && seconds >= 0) ? seconds : 5
785
790
  end
786
791
  module_function :github_poll_interval
787
792
 
@@ -426,7 +426,7 @@ module Kettle
426
426
  prepare_rubocop_lts_local_branch! if rubocop_lts_release_preflight_needed?
427
427
 
428
428
  # 3. bin/setup
429
- with_release_resume_step(3) { run_cmd!(release_setup_command) } if run_step?(3)
429
+ with_release_resume_step(3) { run_release_setup! } if run_step?(3)
430
430
  # 4. bin/rake
431
431
  with_release_resume_step(4) { run_cmd!(release_default_task_command) } if run_step?(4)
432
432
 
@@ -900,15 +900,22 @@ module Kettle
900
900
  begin
901
901
  stage = "before release task bundle installs"
902
902
  task_lockfile = release_task_lockfile_path(gemfile: gemfile)
903
+ install_env = {
904
+ "BUNDLE_GEMFILE" => gemfile,
905
+ "BUNDLE_LOCKFILE" => task_lockfile || lockfile
906
+ }
907
+ if bundle_satisfied?(environment: install_env)
908
+ emit_release_lockfile_event(action: "install", status: "ok", stage: stage, reason: "#{File.basename(gemfile)} (already satisfied)")
909
+ next
910
+ end
911
+
903
912
  emit_release_lockfile_event(action: "install", status: "started", stage: stage, reason: File.basename(gemfile))
904
913
  puts "Installing normalized release bundle for #{File.basename(gemfile)}..."
905
- run_cmd!(release_child_command(
906
- "bundle install",
907
- environment: {
908
- "BUNDLE_GEMFILE" => gemfile,
909
- "BUNDLE_LOCKFILE" => task_lockfile || lockfile
910
- }
911
- ))
914
+ with_bundle_install_lock do
915
+ unless bundle_satisfied?(environment: install_env)
916
+ run_cmd!(release_child_command("bundle install", environment: install_env))
917
+ end
918
+ end
912
919
  emit_release_lockfile_event(action: "install", status: "ok", stage: stage, reason: File.basename(gemfile))
913
920
  rescue => error
914
921
  emit_release_lockfile_event(action: "install", status: "failed", stage: stage, reason: error.message)
@@ -1165,8 +1172,14 @@ module Kettle
1165
1172
  if (lockfile = release_borrowed_bundle_lockfile(gemfile))
1166
1173
  environment["BUNDLE_LOCKFILE"] = lockfile
1167
1174
  end
1175
+ next if bundle_satisfied?(environment: environment)
1176
+
1168
1177
  puts "Installing changelog bundle for #{gemfile}..."
1169
- run_cmd!(release_child_command("bundle install", environment: environment))
1178
+ with_bundle_install_lock do
1179
+ unless bundle_satisfied?(environment: environment)
1180
+ run_cmd!(release_child_command("bundle install", environment: environment))
1181
+ end
1182
+ end
1170
1183
  end
1171
1184
  end
1172
1185
 
@@ -1283,6 +1296,57 @@ module Kettle
1283
1296
  release_project_command("bin/setup")
1284
1297
  end
1285
1298
 
1299
+ def run_release_setup!
1300
+ if standard_bundle_install_setup? && bundle_satisfied?
1301
+ puts "Bundle already satisfied; skipping redundant bin/setup."
1302
+ return
1303
+ end
1304
+
1305
+ with_bundle_install_lock { run_cmd!(release_setup_command) }
1306
+ end
1307
+
1308
+ def standard_bundle_install_setup?
1309
+ setup_path = File.join(@root, "bin", "setup")
1310
+ return false unless File.file?(setup_path)
1311
+
1312
+ content = File.read(setup_path)
1313
+ return false unless content.include?('bundle "${bundle_args[@]}"') || content.include?("bundle install")
1314
+
1315
+ # Only treat as standard bundle-install-only wrapper when there are no
1316
+ # custom non-comment lines after the bundle invocation.
1317
+ tail = content.split(/bundle (?:"\$\{bundle_args\[@\]\}"|install)/, 2).last.to_s
1318
+ tail.lines.none? { |line| !line.strip.empty? && !line.strip.start_with?("#") }
1319
+ rescue SystemCallError
1320
+ false
1321
+ end
1322
+
1323
+ def bundle_satisfied?(environment: {})
1324
+ cmd = release_child_command("bundle check", environment: environment)
1325
+ _out, _err, status = Open3.capture3(cmd, chdir: @root)
1326
+ status.success?
1327
+ rescue SystemCallError
1328
+ false
1329
+ end
1330
+
1331
+ def bundle_install_lock_path
1332
+ override = ENV["KETTLE_DEV_BUNDLE_INSTALL_LOCK"].to_s.strip
1333
+ return override unless override.empty?
1334
+
1335
+ xdg_state = ENV["XDG_STATE_HOME"].to_s.strip
1336
+ base = xdg_state.empty? ? File.join(Dir.home, ".local", "state") : xdg_state
1337
+ ruby_abi = "#{RUBY_ENGINE}-#{RbConfig::CONFIG["ruby_version"]}-#{RUBY_PLATFORM}"
1338
+ File.join(base, "kettle-dev", "bundle-install-#{ruby_abi}.lock")
1339
+ end
1340
+
1341
+ def with_bundle_install_lock
1342
+ lock_path = bundle_install_lock_path
1343
+ FileUtils.mkdir_p(File.dirname(lock_path))
1344
+ File.open(lock_path, File::RDWR | File::CREAT, 0o600) do |lock_file|
1345
+ lock_file.flock(File::LOCK_EX)
1346
+ yield
1347
+ end
1348
+ end
1349
+
1286
1350
  # Canonical release commands use the tracked project lockfiles. These
1287
1351
  # lockfiles are shared state and are normalized/committed before release
1288
1352
  # prep; they must never contain sibling PATH sources.
@@ -5,7 +5,7 @@ module Kettle
5
5
  # Version namespace for this gem.
6
6
  module Version
7
7
  # Current gem version.
8
- VERSION = "3.1.40"
8
+ VERSION = "3.1.41"
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-dev
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.40
4
+ version: 3.1.41
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter H. Boling
@@ -64,7 +64,7 @@ dependencies:
64
64
  -
65
65
  - ">="
66
66
  - !ruby/object:Gem::Version
67
- version: 0.3.22
67
+ version: 0.3.23
68
68
  type: :runtime
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
@@ -76,7 +76,7 @@ dependencies:
76
76
  -
77
77
  - ">="
78
78
  - !ruby/object:Gem::Version
79
- version: 0.3.22
79
+ version: 0.3.23
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: kettle-ndjson
82
82
  requirement: !ruby/object:Gem::Requirement
@@ -88,7 +88,7 @@ dependencies:
88
88
  -
89
89
  - ">="
90
90
  - !ruby/object:Gem::Version
91
- version: 0.1.25
91
+ version: 0.1.27
92
92
  type: :runtime
93
93
  prerelease: false
94
94
  version_requirements: !ruby/object:Gem::Requirement
@@ -100,7 +100,7 @@ dependencies:
100
100
  -
101
101
  - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: 0.1.25
103
+ version: 0.1.27
104
104
  - !ruby/object:Gem::Dependency
105
105
  name: kettle-rb
106
106
  requirement: !ruby/object:Gem::Requirement
@@ -112,7 +112,7 @@ dependencies:
112
112
  -
113
113
  - ">="
114
114
  - !ruby/object:Gem::Version
115
- version: 0.1.22
115
+ version: 0.1.24
116
116
  type: :runtime
117
117
  prerelease: false
118
118
  version_requirements: !ruby/object:Gem::Requirement
@@ -124,7 +124,7 @@ dependencies:
124
124
  -
125
125
  - ">="
126
126
  - !ruby/object:Gem::Version
127
- version: 0.1.22
127
+ version: 0.1.24
128
128
  - !ruby/object:Gem::Dependency
129
129
  name: kettle-test
130
130
  requirement: !ruby/object:Gem::Requirement
@@ -136,7 +136,7 @@ dependencies:
136
136
  -
137
137
  - ">="
138
138
  - !ruby/object:Gem::Version
139
- version: 2.0.31
139
+ version: 2.0.32
140
140
  type: :runtime
141
141
  prerelease: false
142
142
  version_requirements: !ruby/object:Gem::Requirement
@@ -148,7 +148,7 @@ dependencies:
148
148
  -
149
149
  - ">="
150
150
  - !ruby/object:Gem::Version
151
- version: 2.0.31
151
+ version: 2.0.32
152
152
  - !ruby/object:Gem::Dependency
153
153
  name: ruby-progressbar
154
154
  requirement: !ruby/object:Gem::Requirement
@@ -479,10 +479,10 @@ licenses:
479
479
  - AGPL-3.0-only
480
480
  metadata:
481
481
  homepage_uri: "https://kettle-dev.galtzo.com"
482
- source_code_uri: "https://github.com/kettle-dev/kettle-dev/tree/v3.1.40"
483
- changelog_uri: "https://github.com/kettle-dev/kettle-dev/blob/v3.1.40/CHANGELOG.md"
482
+ source_code_uri: "https://github.com/kettle-dev/kettle-dev/tree/v3.1.41"
483
+ changelog_uri: "https://github.com/kettle-dev/kettle-dev/blob/v3.1.41/CHANGELOG.md"
484
484
  bug_tracker_uri: "https://github.com/kettle-dev/kettle-dev/issues"
485
- documentation_uri: "https://www.rubydoc.info/gems/kettle-dev/3.1.40"
485
+ documentation_uri: "https://www.rubydoc.info/gems/kettle-dev/3.1.41"
486
486
  funding_uri: "https://github.com/sponsors/pboling"
487
487
  wiki_uri: "https://github.com/kettle-dev/kettle-dev/wiki"
488
488
  news_uri: "https://www.railsbling.com/tags/kettle-dev"
metadata.gz.sig CHANGED
Binary file