kettle-dev 3.1.39 → 3.1.40

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: 0b14e7434f6f14f4ce8d13b07fda59eb9fc869c7b9a9d31e841adeee856d3be5
4
- data.tar.gz: 17a445314db889dec7c090c2d6502df68e661a4f611739381da61213637314f9
3
+ metadata.gz: 3ae2886baae33e7a58773229723010348ad312ab27a0f62ce0fddace28eec9b6
4
+ data.tar.gz: 399aada6ddd39e258e56e3a148e4cbe5c58c206aac6fcbc8424ca41f332f29d1
5
5
  SHA512:
6
- metadata.gz: 14ed3f6f7178f9aca3a32a602dbd69a995e91a29b1034d61f4c816552d7aa6c803dbd17d0724acdb9c394a4dc50bf060de1c0bffdbc8a2676d8cbdb25f049f17
7
- data.tar.gz: b2127ee81f5b95649e15162cd492c165a516aea7696816647a3d807c0d5b638d602eabf87a93716622936961ea9c17939985270c35d5c8e3a82fcd5106884080
6
+ metadata.gz: 1a8c61b5a3b9fdb06b9f76749a073b590b0083e6f4be236227e7953f2ccfbf05153a47db0b475efeeba30ba033eac2a02fecbb93d135d2c0e8b1ac4c09df63a0
7
+ data.tar.gz: 9a47eb30d0448179add78e2137c9dafab25bd7e32032f248a54d004a1b17621b0c3206a51ac247accc9d8286d2c7a8c172fabc9b9df529405becf925139719d7
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
+ ## [3.1.40] - 2026-12-04
34
+
35
+ - TAG: [v3.1.40][3.1.40t]
36
+ - COVERAGE: 91.46% -- 6685/7309 lines in 53 files
37
+ - BRANCH COVERAGE: 75.71% -- 2574/3400 branches in 53 files
38
+ - 57.05% documented
39
+
40
+ ### Added
41
+
42
+ - Add optional soft CI time limit (`--ci-time-limit SECONDS` / `K_RELEASE_CI_TIME_LIMIT`) and required test-suite workflow override (`--ci-required-workflows` / `K_RELEASE_CI_REQUIRED_WORKFLOWS`) to `kettle-release` and `Kettle::Dev::CIMonitor`, allowing releases to proceed with a warning when required tests (`current.yml` if present, otherwise an allow-listed test workflow) have passed and no workflows have failed, while failing closed if tests have not passed
43
+ - kettle-jem-template-20261025-001 - Duel performance regression guards: the
44
+ Perf workflow compares each pull request, each push to main, and, on a
45
+ schedule, the last release, and `rake duel` compares local changes, with
46
+ the benchmarks in `duel/`.
47
+
48
+ ### Changed
49
+
50
+ - Exclude `perf-comment.yml` (PR-only `workflow_run`/`pull_request_target` workflow) from `CIHelpers.exclusions` so `kettle-release` does not fail with a branch trigger mismatch on `main`
51
+ - [kc] kettle-jem/template: updated 15 project files since the last release:
52
+ - code and tests (1)
53
+ - dependencies (7)
54
+ - documentation (1)
55
+ - other (3)
56
+ - workflows (3)
57
+
58
+ ### Fixed
59
+
60
+ - Replace `bundle update --bundler=VERSION` with `bundle lock --bundler=VERSION --add-checksums` in `LockfileReset#reset_command` so lockfile resets no longer install the entire bundle (including native/Rust gems like `structuredmerge-core`) into disposable `tmp/kettle-reset/gem-home-*` directories across parallel release waves
61
+ - Cache isolated `LockfileReset` Gemfile bootstrap gems (such as `nomono`) in a `flock`-guarded XDG cache keyed by Ruby ABI, gem name, version, and source, and cap `CARGO_BUILD_JOBS` during bootstrap installation
62
+
33
63
  ## [3.1.39] - 2026-12-03
34
64
 
35
65
  - TAG: [v3.1.39][3.1.39t]
@@ -4549,7 +4579,9 @@ Please file a bug if you notice a violation of semantic versioning.
4549
4579
  - Selecting will run the selected workflow via `act`
4550
4580
  - This may move to its own gem in the future.
4551
4581
 
4552
- [Unreleased]: https://github.com/kettle-dev/kettle-dev/compare/v3.1.39...HEAD
4582
+ [Unreleased]: https://github.com/kettle-dev/kettle-dev/compare/v3.1.40...HEAD
4583
+ [3.1.40]: https://github.com/kettle-dev/kettle-dev/compare/v3.1.39...v3.1.40
4584
+ [3.1.40t]: https://github.com/kettle-dev/kettle-dev/releases/tag/v3.1.40
4553
4585
  [3.1.39]: https://github.com/kettle-dev/kettle-dev/compare/v3.1.38...v3.1.39
4554
4586
  [3.1.39t]: https://github.com/kettle-dev/kettle-dev/releases/tag/v3.1.39
4555
4587
  [3.1.38]: https://github.com/kettle-dev/kettle-dev/compare/v3.1.37...v3.1.38
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # 🍲 Kettle::Dev
4
4
 
5
- [![Version][👽versioni]][👽version] [![Ruby Users Forum][✉️ruby-forum-top-img]][✉️ruby-forum] [![GitHub tag (latest SemVer)][⛳️tag-img]][⛳️tag] [![License: AGPL-3.0-only][📄license-img]][📄license] [![Total downloads][👽dl-ranki]][👽dl-rank] [![CodeCov Test Coverage][🏀codecovi]][🏀codecov] [![Coveralls Test Coverage][🏀coveralls-img]][🏀coveralls] [![QLTY Test Coverage][🏀qlty-covi]][🏀qlty-cov] [![QLTY Maintainability][🏀qlty-mnti]][🏀qlty-mnt] [![CI Heads][🚎3-hd-wfi]][🚎3-hd-wf] [![CI Runtime Dependencies @ HEAD][🚎12-crh-wfi]][🚎12-crh-wf] [![CI Current][🚎11-c-wfi]][🚎11-c-wf] [![CI Truffle Ruby][🚎9-t-wfi]][🚎9-t-wf] [![CI JRuby][🚎10-j-wfi]][🚎10-j-wf] [![Deps Locked][🚎13-🔒️-wfi]][🚎13-🔒️-wf] [![Deps Unlocked][🚎14-🔓️-wfi]][🚎14-🔓️-wf] [![CI Test Coverage][🚎2-cov-wfi]][🚎2-cov-wf] [![CI Style][🚎5-st-wfi]][🚎5-st-wf]
5
+ [![Version][👽versioni]][👽version] [![Ruby Users Forum][✉️ruby-forum-top-img]][✉️ruby-forum] [![GitHub tag (latest SemVer)][⛳️tag-img]][⛳️tag] [![License: AGPL-3.0-only][📄license-img]][📄license] [![Total downloads][👽dl-ranki]][👽dl-rank] [![CodeCov Test Coverage][🏀codecovi]][🏀codecov] [![Coveralls Test Coverage][🏀coveralls-img]][🏀coveralls] [![QLTY Test Coverage][🏀qlty-covi]][🏀qlty-cov] [![QLTY Maintainability][🏀qlty-mnti]][🏀qlty-mnt] [![CI Heads][🚎3-hd-wfi]][🚎3-hd-wf] [![CI Runtime Dependencies @ HEAD][🚎12-crh-wfi]][🚎12-crh-wf] [![CI Current][🚎11-c-wfi]][🚎11-c-wf] [![CI Truffle Ruby][🚎9-t-wfi]][🚎9-t-wf] [![CI JRuby][🚎10-j-wfi]][🚎10-j-wf] [![Deps Locked][🚎13-🔒️-wfi]][🚎13-🔒️-wf] [![Deps Unlocked][🚎14-🔓️-wfi]][🚎14-🔓️-wf] [![CI Test Coverage][🚎2-cov-wfi]][🚎2-cov-wf] [![CI Style][🚎5-st-wfi]][🚎5-st-wf] [![Duel][⚔️duel-img]][⚔️duel]
6
6
 
7
7
  `if ci_badges.map(&:color).detect { it != "green"}` ☝️ [let me know on Discord][✉️discord-invite] or [RubyForum][✉️ruby-forum], as I may have missed the notification.
8
8
 
@@ -1040,7 +1040,7 @@ Thanks for RTFM. ☺️
1040
1040
  [📌gitmoji]: https://gitmoji.dev
1041
1041
  [📌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
1042
  [🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
1043
- [🧮kloc-img]: https://img.shields.io/badge/KLOC-7.194-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
1043
+ [🧮kloc-img]: https://img.shields.io/badge/KLOC-7.309-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
1044
1044
  [🔐security]: https://github.com/kettle-dev/kettle-dev/blob/main/SECURITY.md
1045
1045
  [🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
1046
1046
  [📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
@@ -1050,6 +1050,8 @@ Thanks for RTFM. ☺️
1050
1050
  [📄license-compat]: https://www.apache.org/legal/resolved.html#category-x
1051
1051
  [📄license-compat-img]: https://img.shields.io/badge/Apache_Incompatible:_Category_X-%E2%9C%97-C0392B.svg?style=flat&logo=Apache
1052
1052
 
1053
+ [⚔️duel]: https://github.com/sferik/duel-ruby
1054
+ [⚔️duel-img]: https://raw.githubusercontent.com/sferik/duel-ruby/main/assets/badge.svg
1053
1055
  [📄ilo-declaration]: https://www.ilo.org/declaration/lang--en/index.htm
1054
1056
  [📄ilo-declaration-img]: https://img.shields.io/badge/ILO_Fundamental_Principles-✓-259D6C.svg?style=flat
1055
1057
  [🚎yard-current]: http://rubydoc.info/gems/kettle-dev
data/exe/kettle-release CHANGED
@@ -49,7 +49,7 @@ end
49
49
  # Do not guard with __FILE__ == $PROGRAM_NAME because binstubs use Kernel.load.
50
50
  if ARGV.include?("-h") || ARGV.include?("--help")
51
51
  puts <<~USAGE
52
- Usage: kettle-release [--version VERSION] [--local-ci] [--yes] [--appraisal-update] [--skip-changelog] [--skip-appraisals] [--skip-bundle-audit] [--start-step STEP] [--skip-ci] [--skip-steps STEPS] [--ci-workflows WORKFLOWS] [--skip-remotes REMOTES] [--required-remotes REMOTES] [--secrets-provider NAME] [--json|--events[=TYPES]] [--report PATH] [start_step=<0-19>]
52
+ Usage: kettle-release [--version VERSION] [--local-ci] [--yes] [--appraisal-update] [--skip-changelog] [--skip-appraisals] [--skip-bundle-audit] [--start-step STEP] [--skip-ci] [--skip-steps STEPS] [--ci-workflows WORKFLOWS] [--ci-time-limit SECONDS] [--ci-required-workflows WORKFLOWS] [--skip-remotes REMOTES] [--required-remotes REMOTES] [--secrets-provider NAME] [--json|--events[=TYPES]] [--report PATH] [start_step=<0-19>]
53
53
 
54
54
  Automates the release flow for a Ruby gem in the host project.
55
55
 
@@ -94,6 +94,8 @@ if ARGV.include?("-h") || ARGV.include?("--help")
94
94
  --skip-appraisals # Skip appraisal generation at step 5 but still generate documentation
95
95
  --skip-bundle-audit # Skip bundle:audit/update during release rake checks
96
96
  --ci-workflows WORKFLOWS # Comma-separated workflow files or stems to monitor at CI step 10
97
+ --ci-time-limit SECONDS # Soft CI wait limit (e.g., 600); proceeds if required tests passed and nothing failed
98
+ --ci-required-workflows WFS # Comma-separated test workflows required to pass before --ci-time-limit can bypass others
97
99
  --skip-remotes REMOTES # Comma-separated git remote names to exclude from release fetch/push parity
98
100
  --required-remotes REMOTES # Comma-separated remote names that must fetch for release parity; defaults to origin
99
101
  --secrets-provider NAME # Release secrets provider: interactive, 1password
@@ -264,6 +266,56 @@ def extract_ci_workflows_arg!(argv)
264
266
  workflows
265
267
  end
266
268
 
269
+ def extract_ci_time_limit_arg!(argv)
270
+ limit = nil
271
+ if (idx = argv.index("--ci-time-limit"))
272
+ limit = argv[idx + 1]
273
+ if limit.to_s.empty? || limit.to_s.start_with?("-")
274
+ Kettle::Dev::ExitAdapter.abort("--ci-time-limit requires a positive number of seconds")
275
+ end
276
+ argv.slice!(idx, 2)
277
+ end
278
+ argv.delete_if do |arg|
279
+ if arg.start_with?("--ci-time-limit=", "ci_time_limit=")
280
+ limit = arg.split("=", 2)[1]
281
+ Kettle::Dev::ExitAdapter.abort("--ci-time-limit requires a positive number of seconds") if limit.to_s.empty?
282
+ true
283
+ else
284
+ false
285
+ end
286
+ end
287
+ if limit
288
+ valid = begin
289
+ Float(limit).positive?
290
+ rescue ArgumentError, TypeError
291
+ false
292
+ end
293
+ Kettle::Dev::ExitAdapter.abort("--ci-time-limit requires a positive number of seconds") unless valid
294
+ end
295
+ limit
296
+ end
297
+
298
+ def extract_ci_required_workflows_arg!(argv)
299
+ workflows = nil
300
+ if (idx = argv.index("--ci-required-workflows"))
301
+ workflows = argv[idx + 1]
302
+ if workflows.to_s.empty? || workflows.to_s.start_with?("-")
303
+ Kettle::Dev::ExitAdapter.abort("--ci-required-workflows requires a comma-separated workflow list")
304
+ end
305
+ argv.slice!(idx, 2)
306
+ end
307
+ argv.delete_if do |arg|
308
+ if arg.start_with?("--ci-required-workflows=", "ci_required_workflows=")
309
+ workflows = arg.split("=", 2)[1]
310
+ Kettle::Dev::ExitAdapter.abort("--ci-required-workflows requires a comma-separated workflow list") if workflows.to_s.empty?
311
+ true
312
+ else
313
+ false
314
+ end
315
+ end
316
+ workflows
317
+ end
318
+
267
319
  def extract_skip_remotes_arg!(argv)
268
320
  remotes = nil
269
321
  if (idx = argv.index("--skip-remotes"))
@@ -379,6 +431,8 @@ version_override = extract_version_arg!(ARGV)
379
431
  skip_steps = extract_skip_steps_arg!(ARGV)
380
432
  skip_steps = [skip_steps, "10"].compact.join(",") if skip_ci
381
433
  ci_workflows = extract_ci_workflows_arg!(ARGV)
434
+ ci_time_limit = extract_ci_time_limit_arg!(ARGV)
435
+ ci_required_workflows = extract_ci_required_workflows_arg!(ARGV)
382
436
  skip_remotes = extract_skip_remotes_arg!(ARGV)
383
437
  required_remotes = extract_required_remotes_arg!(ARGV)
384
438
  report_path = extract_report_arg!(ARGV)
@@ -386,7 +440,7 @@ secrets_provider = extract_secrets_provider_arg!(ARGV)
386
440
 
387
441
  begin
388
442
  event_stream = events_output ? Kettle::Ndjson.event_stream($stdout, types: event_types) : nil
389
- Kettle::Dev::ReleaseCLI.new(start_step: start_step, local_ci: local_ci, version: version_override, appraisal_task: appraisal_task, skip_steps: skip_steps, skip_changelog: skip_changelog, skip_appraisals: skip_appraisals, skip_bundle_audit: skip_bundle_audit, ci_workflows: ci_workflows, skip_remotes: skip_remotes, required_remotes: required_remotes, secrets_provider_name: secrets_provider, yes: yes, event_stream: event_stream, json_output: json_output, json_io: $stdout, report_path: report_path).run
443
+ Kettle::Dev::ReleaseCLI.new(start_step: start_step, local_ci: local_ci, version: version_override, appraisal_task: appraisal_task, skip_steps: skip_steps, skip_changelog: skip_changelog, skip_appraisals: skip_appraisals, skip_bundle_audit: skip_bundle_audit, ci_workflows: ci_workflows, ci_time_limit: ci_time_limit, ci_required_workflows: ci_required_workflows, skip_remotes: skip_remotes, required_remotes: required_remotes, secrets_provider_name: secrets_provider, yes: yes, event_stream: event_stream, json_output: json_output, json_io: $stdout, report_path: report_path).run
390
444
  rescue LoadError => e
391
445
  warn("#{script_basename}: could not load dependency: #{e.class}: #{e.message}")
392
446
  warn(Array(e.backtrace).join("\n")) if ENV["DEBUG"]
@@ -100,12 +100,23 @@ module Kettle
100
100
  # Matched on basename rather than a fixed list because templates vary the exact names.
101
101
  SLOW_WORKFLOW_PATTERN = /mac|windows|heads|platforms/i
102
102
 
103
+ # Strict allow-list of workflow basenames that execute the project's test suite.
104
+ # Used by CIMonitor's optional CI time limit to verify tests passed before allowing
105
+ # still-running or queued secondary workflows to be bypassed.
106
+ TEST_WORKFLOW_PATTERN = /\A(current|locked_deps|unlocked_deps|supported|unsupported|rspec|spec|test|tests|ci)\.ya?ml\z/i
107
+
103
108
  # @param name [String] workflow basename
104
109
  # @return [Boolean]
105
110
  def slow_workflow?(name)
106
111
  name.to_s.match?(SLOW_WORKFLOW_PATTERN)
107
112
  end
108
113
 
114
+ # @param name [String] workflow basename
115
+ # @return [Boolean]
116
+ def test_workflow?(name)
117
+ name.to_s.match?(TEST_WORKFLOW_PATTERN)
118
+ end
119
+
109
120
  # List of workflow files to exclude from interactive menus and checks.
110
121
  # @return [Array<String>]
111
122
  def exclusions
@@ -116,6 +127,7 @@ module Kettle
116
127
  dependency-review.yml
117
128
  discord-notifier.yml
118
129
  opencollective.yml
130
+ perf-comment.yml
119
131
  scorecard-analysis.yml
120
132
  ]
121
133
  end
@@ -48,18 +48,40 @@ module Kettle
48
48
  # tolerated through K_RELEASE_CI_CONTINUE.
49
49
  #
50
50
  # @param restart_hint [String] guidance command shown on failure
51
+ # @param time_limit [Numeric, String, nil] optional soft CI time limit in seconds
52
+ # @param required_workflows [Array<String>, String, nil] optional required test workflows for time-limit bypass
51
53
  # @return [Boolean] whether all configured CI providers passed
52
- def monitor_all!(restart_hint: "bundle exec kettle-release --start-step 10", workflows: nil, keepalive: nil, event_recorder: nil, **options)
54
+ def monitor_all!(restart_hint: "bundle exec kettle-release --start-step 10", workflows: nil, keepalive: nil, event_recorder: nil, time_limit: nil, required_workflows: nil, **options)
53
55
  clear_warnings!
56
+ resolved_limit = resolve_time_limit(time_limit)
57
+ deadline = resolved_limit ? (monotonic_time + resolved_limit) : nil
54
58
  # Rate limiting is recoverable: when the GitHub monitor parks for the
55
59
  # quota reset it returns :rate_limited and we re-enter it. GitLab has
56
60
  # no equivalent, so only the GitHub result drives the retry.
57
61
  results = nil
58
62
  loop do
59
- results = [
60
- monitor_github_internal!(restart_hint: restart_hint, workflows: workflows, keepalive: keepalive, event_recorder: event_recorder),
61
- monitor_gitlab_internal!(restart_hint: restart_hint, keepalive: keepalive, event_recorder: event_recorder)
62
- ]
63
+ gh_result = monitor_github_internal!(
64
+ restart_hint: restart_hint,
65
+ workflows: workflows,
66
+ keepalive: keepalive,
67
+ event_recorder: event_recorder,
68
+ deadline: deadline,
69
+ time_limit: resolved_limit,
70
+ required_workflows: required_workflows
71
+ )
72
+ gl_result = if gh_result == :rate_limited
73
+ nil
74
+ else
75
+ monitor_gitlab_internal!(
76
+ restart_hint: restart_hint,
77
+ keepalive: keepalive,
78
+ event_recorder: event_recorder,
79
+ deadline: deadline,
80
+ time_limit: resolved_limit,
81
+ github_passed: gh_result == true
82
+ )
83
+ end
84
+ results = [gh_result, gl_result]
63
85
  break unless results.first == :rate_limited
64
86
  end
65
87
  abort("CI configuration not detected (GitHub or GitLab). Ensure CI is configured and remotes point to the correct hosts.") if results.all?(&:nil?)
@@ -308,7 +330,7 @@ module Kettle
308
330
  end
309
331
  module_function :collect_gitlab
310
332
 
311
- def monitor_github_internal!(restart_hint:, workflows: nil, keepalive: nil, event_recorder: nil)
333
+ def monitor_github_internal!(restart_hint:, workflows: nil, keepalive: nil, event_recorder: nil, deadline: nil, time_limit: nil, required_workflows: nil)
312
334
  root = Kettle::Dev::CIHelpers.ci_project_root
313
335
  workflows = Array(workflows).empty? ? Kettle::Dev::CIHelpers.workflows_list(root) : Array(workflows)
314
336
  gh_remote = preferred_github_remote
@@ -343,6 +365,7 @@ module Kettle
343
365
  passed = {}
344
366
  failed = {}
345
367
  started = {}
368
+ last_status = {}
346
369
  emit_ci_monitor_event(
347
370
  event_recorder,
348
371
  action: "github_discover",
@@ -382,8 +405,10 @@ module Kettle
382
405
 
383
406
  sleep((initial_sleep && initial_sleep >= 0) ? initial_sleep : 3)
384
407
  start_timeout = github_start_timeout
408
+ start_timeout = [start_timeout, time_limit.to_i].min if time_limit&.positive?
385
409
  poll_interval = github_poll_interval
386
410
  start_deadline = monotonic_time + start_timeout
411
+ start_deadline = [start_deadline, deadline].min if deadline
387
412
  keepalive_timer = keepalive_timer(keepalive)
388
413
  all_started_emitted = false
389
414
  # Job-level failure detection polls one jobs endpoint per in-flight
@@ -414,6 +439,7 @@ module Kettle
414
439
  run = Kettle::Dev::CIHelpers.latest_run(owner: owner, repo: repo, workflow_file: wf, branch: branch, require_head: true, head_sha: head_sha)
415
440
  completed_workflow = nil
416
441
  if run
442
+ last_status[wf] = run["status"].to_s unless run["status"].to_s.empty?
417
443
  unless started[wf]
418
444
  started[wf] = true
419
445
  emit_ci_monitor_event(
@@ -530,6 +556,19 @@ module Kettle
530
556
  )
531
557
  end
532
558
  break if completed == total
559
+ if deadline && monotonic_time >= deadline
560
+ return handle_github_time_limit!(
561
+ workflows: workflows,
562
+ passed: passed,
563
+ failed: failed,
564
+ last_status: last_status,
565
+ time_limit: time_limit,
566
+ required_workflows: required_workflows,
567
+ restart_hint: restart_hint,
568
+ pbar: pbar,
569
+ event_recorder: event_recorder
570
+ )
571
+ end
533
572
  if started.size < total && monotonic_time >= start_deadline
534
573
  missing = (workflows - started.keys).join(", ")
535
574
  puts
@@ -771,7 +810,118 @@ module Kettle
771
810
  end
772
811
  module_function :keepalive_interval
773
812
 
774
- def monitor_gitlab_internal!(restart_hint:, keepalive: nil, event_recorder: nil)
813
+ def resolve_time_limit(explicit = nil)
814
+ raw = explicit.nil? ? ENV["K_RELEASE_CI_TIME_LIMIT"] : explicit
815
+ return nil if raw.nil? || raw.to_s.strip.empty?
816
+
817
+ seconds = Float(raw)
818
+ seconds.positive? ? seconds : nil
819
+ rescue ArgumentError, TypeError
820
+ nil
821
+ end
822
+ module_function :resolve_time_limit
823
+
824
+ def normalize_required_workflows(value)
825
+ raw = value.nil? ? ENV["K_RELEASE_CI_REQUIRED_WORKFLOWS"] : value
826
+ entries = case raw
827
+ when Array
828
+ raw
829
+ when String
830
+ raw.split(",")
831
+ else
832
+ []
833
+ end
834
+ entries.map { |entry| entry.to_s.strip }.reject(&:empty?).map do |entry|
835
+ entry.match?(/\.ya?ml\z/i) ? entry : "#{entry}.yml"
836
+ end.uniq
837
+ end
838
+ module_function :normalize_required_workflows
839
+
840
+ def evaluate_time_limit_gate(workflows:, passed:, failed:, required_workflows: nil)
841
+ return [false, "one or more workflows failed"] unless failed.empty?
842
+
843
+ explicit = normalize_required_workflows(required_workflows)
844
+ unless explicit.empty?
845
+ matching = explicit & workflows
846
+ return [false, "none of the required workflows (#{explicit.join(", ")}) exist in this repo"] if matching.empty?
847
+
848
+ missing = matching.reject { |wf| passed[wf] }
849
+ return [true, matching.join(", ")] if missing.empty?
850
+
851
+ return [false, "required workflow(s) did not pass in time: #{missing.join(", ")}"]
852
+ end
853
+
854
+ test_wfs = workflows.select { |wf| Kettle::Dev::CIHelpers.test_workflow?(wf) }
855
+ return [false, "no test-suite workflows matched the allow-list (fail-closed)"] if test_wfs.empty?
856
+
857
+ if workflows.include?("current.yml")
858
+ return [true, "current.yml"] if passed["current.yml"]
859
+
860
+ return [false, "current.yml did not pass in time"]
861
+ end
862
+
863
+ passed_tests = test_wfs.select { |wf| passed[wf] }
864
+ return [true, passed_tests.join(", ")] unless passed_tests.empty?
865
+
866
+ [false, "no test-suite workflow passed in time (checked: #{test_wfs.join(", ")})"]
867
+ end
868
+ module_function :evaluate_time_limit_gate
869
+
870
+ def handle_github_time_limit!(workflows:, passed:, failed:, last_status:, time_limit:, required_workflows:, restart_hint:, pbar:, event_recorder:)
871
+ pbar&.finish unless pbar&.finished?
872
+ ok, detail = evaluate_time_limit_gate(
873
+ workflows: workflows,
874
+ passed: passed,
875
+ failed: failed,
876
+ required_workflows: required_workflows
877
+ )
878
+ pending_wfs = workflows.reject { |wf| passed[wf] || failed[wf] }
879
+ bypassed = pending_wfs.map { |wf| "#{wf} (#{last_status[wf] || "not_started"})" }
880
+ limit_i = time_limit.to_i
881
+
882
+ if ok
883
+ msg = "CI time limit (#{limit_i}s) reached: #{passed.size}/#{workflows.size} passed " \
884
+ "(test suite verified: #{detail}); bypassing unfinished workflow(s): #{bypassed.join(", ")}"
885
+ warn("\nWARNING: #{msg}")
886
+ record_warning(kind: "ci_time_limit_bypass", message: msg)
887
+ emit_ci_monitor_event(
888
+ event_recorder,
889
+ action: "github_time_limit",
890
+ status: "warning",
891
+ provider: "github",
892
+ time_limit: limit_i,
893
+ passed: passed.keys,
894
+ verified_tests: detail,
895
+ bypassed: bypassed,
896
+ completed: passed.size + failed.size,
897
+ total: workflows.size,
898
+ reason: msg
899
+ )
900
+ return true
901
+ end
902
+
903
+ msg = "CI time limit (#{limit_i}s) reached without required tests passing (#{detail}). " \
904
+ "Unfinished: #{bypassed.join(", ")}. Fix or rerun CI, then restart with: #{restart_hint}"
905
+ emit_ci_monitor_event(
906
+ event_recorder,
907
+ action: "github_time_limit",
908
+ status: "failed",
909
+ provider: "github",
910
+ time_limit: limit_i,
911
+ passed: passed.keys,
912
+ pending: bypassed,
913
+ completed: passed.size + failed.size,
914
+ total: workflows.size,
915
+ reason: msg
916
+ )
917
+ abort(msg) unless continue_ci_failures?
918
+
919
+ puts "\n#{msg} Continuing because K_RELEASE_CI_CONTINUE=true."
920
+ false
921
+ end
922
+ module_function :handle_github_time_limit!
923
+
924
+ def monitor_gitlab_internal!(restart_hint:, keepalive: nil, event_recorder: nil, deadline: nil, time_limit: nil, github_passed: false)
775
925
  root = Kettle::Dev::CIHelpers.ci_project_root
776
926
  gitlab_ci = File.exist?(File.join(root, ".gitlab-ci.yml"))
777
927
  gl_remote = gitlab_remote_candidates.first
@@ -876,6 +1026,40 @@ module Kettle
876
1026
  break
877
1027
  end
878
1028
  end
1029
+ if deadline && monotonic_time >= deadline
1030
+ pbar&.finish unless pbar&.finished?
1031
+ limit_i = time_limit.to_i
1032
+ if github_passed
1033
+ msg = "GitLab pipeline still running at CI time limit (#{limit_i}s); proceeding because GitHub tests passed."
1034
+ warn("\nWARNING: #{msg}")
1035
+ record_warning(kind: "ci_time_limit_bypass", message: msg)
1036
+ emit_ci_monitor_event(
1037
+ event_recorder,
1038
+ action: "gitlab_time_limit",
1039
+ status: "warning",
1040
+ provider: "gitlab",
1041
+ time_limit: limit_i,
1042
+ completed: 0,
1043
+ total: 1,
1044
+ reason: msg
1045
+ )
1046
+ return true
1047
+ end
1048
+ msg = "GitLab pipeline did not complete within CI time limit (#{limit_i}s). Fix or rerun CI, then restart with: #{restart_hint}"
1049
+ emit_ci_monitor_event(
1050
+ event_recorder,
1051
+ action: "gitlab_time_limit",
1052
+ status: "failed",
1053
+ provider: "gitlab",
1054
+ time_limit: limit_i,
1055
+ completed: 0,
1056
+ total: 1,
1057
+ reason: msg
1058
+ )
1059
+ abort(msg) unless continue_ci_failures?
1060
+ puts "\n#{msg} Continuing because K_RELEASE_CI_CONTINUE=true."
1061
+ return false
1062
+ end
879
1063
  sleep(1)
880
1064
  end
881
1065
  pbar&.finish unless pbar&.finished?
@@ -1,5 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "digest"
4
+ require "etc"
5
+ require "rbconfig"
3
6
  require "set"
4
7
  require "shellwords"
5
8
  require "fileutils"
@@ -208,7 +211,8 @@ module Kettle
208
211
  end
209
212
 
210
213
  with_isolated_gem_paths do |gem_home|
211
- install_gemfile_bootstrap_gems!(gemfile: gemfile, lockfile: path, gem_home: gem_home)
214
+ bootstrap_dirs = install_gemfile_bootstrap_gems!(gemfile: gemfile, lockfile: path, gem_home: gem_home)
215
+ isolated_gem_path = ([gem_home] + bootstrap_dirs).uniq.join(File::PATH_SEPARATOR)
212
216
  command = reset_command(
213
217
  path: path,
214
218
  gemfile: gemfile,
@@ -217,6 +221,7 @@ module Kettle
217
221
  skip_changelog_dependency: skip_changelog_dependency,
218
222
  update_bundler: update_bundler,
219
223
  isolated_gem_home: gem_home,
224
+ isolated_gem_path: isolated_gem_path,
220
225
  strict: strict
221
226
  )
222
227
  if full_update || has_local_path_remote?(path, strict: strict)
@@ -256,17 +261,13 @@ module Kettle
256
261
  command << " --add-platform #{platforms.map { |platform| Shellwords.escape(platform) }.join(" ")}" unless platforms.empty?
257
262
  command << " --update"
258
263
  command << " #{update_gems.map { |gem_name| Shellwords.escape(gem_name) }.join(" ")}" unless update_gems.empty?
259
- command << " --add-checksums" unless update_bundler
260
- return command unless update_bundler
261
-
262
- # `bundle lock --bundler` accepts a requirement and retains a locked
263
- # prerelease that satisfies it. `bundle update --bundler=VERSION`
264
- # records the exact Bundler that is executing the reset instead.
265
- # Finish with `bundle lock --add-checksums`, since `bundle update`
266
- # does not support that option.
267
- bundler_version = Shellwords.escape(Bundler::VERSION)
268
- command << " && #{command_prefix} bundle update --bundler=#{bundler_version}"
269
- command << " && #{command_prefix} bundle lock --add-checksums"
264
+ # Use `bundle lock --bundler=VERSION` (NOT `bundle update --bundler=...`):
265
+ # `bundle update` installs the entire bundle (including native/Rust gems)
266
+ # into the disposable isolated GEM_HOME, whereas `bundle lock --bundler=`
267
+ # records the exact Bundler version in `BUNDLED WITH` without installing
268
+ # any gems.
269
+ command << " --bundler=#{Shellwords.escape(Bundler::VERSION)}" if update_bundler
270
+ command << " --add-checksums"
270
271
  command
271
272
  end
272
273
 
@@ -606,10 +607,13 @@ module Kettle
606
607
  end
607
608
 
608
609
  # Bundler evaluates a Gemfile and its static eval_gemfile inputs before it
609
- # resolves declared gems. Install only literal bootstrap requires into the
610
- # reset sandbox so unrelated gems from the invoking Ruby cannot influence
611
- # resolution.
610
+ # resolves declared gems. Install only literal bootstrap requires into a
611
+ # versioned, flock-guarded XDG cache keyed by Ruby ABI, gem name, version,
612
+ # and source so parallel family releases compile native bootstrap deps
613
+ # (e.g., structuredmerge-core via nomono) once instead of N times concurrently,
614
+ # while keeping Bundler isolated from the host Ruby's Gem.path.
612
615
  def install_gemfile_bootstrap_gems!(gemfile:, lockfile:, gem_home:)
616
+ bootstrap_dirs = []
613
617
  gemfile_bootstrap_gems(gemfile).each do |name, required_by_root_gemfile|
614
618
  version = locked_registry_gem_version(lockfile, name)
615
619
  source_url = registry_source_urls(lockfile).first
@@ -620,8 +624,51 @@ module Kettle
620
624
  raise Error, "Cannot isolate Gemfile bootstrap #{name.inspect}: #{display_path(lockfile)} does not lock it from a registry source"
621
625
  end
622
626
 
623
- command_runner.call(bootstrap_gem_install_command(name, version, source_url, gem_home))
627
+ cache_dir = bootstrap_cache_dir(name: name, version: version, source_url: source_url)
628
+ ensure_bootstrap_gem_installed!(name: name, version: version, source_url: source_url, cache_dir: cache_dir)
629
+ bootstrap_dirs << cache_dir
624
630
  end
631
+ bootstrap_dirs
632
+ end
633
+
634
+ def bootstrap_cache_root
635
+ override = ENV["KETTLE_DEV_RESET_BOOTSTRAP_CACHE"].to_s.strip
636
+ return override unless override.empty?
637
+
638
+ xdg_cache = ENV["XDG_CACHE_HOME"].to_s.strip
639
+ base = xdg_cache.empty? ? File.join(Dir.home, ".cache") : xdg_cache
640
+ File.join(base, "kettle-dev", "reset-bootstrap")
641
+ end
642
+
643
+ def bootstrap_cache_dir(name:, version:, source_url:)
644
+ ruby_abi = "#{RUBY_ENGINE}-#{RbConfig::CONFIG["ruby_version"]}-#{RUBY_PLATFORM}"
645
+ source_digest = Digest::SHA256.hexdigest(source_url.to_s)[0, 12]
646
+ File.join(bootstrap_cache_root, ruby_abi, "#{name}-#{version}-#{source_digest}")
647
+ end
648
+
649
+ def ensure_bootstrap_gem_installed!(name:, version:, source_url:, cache_dir:)
650
+ ready_stamp = File.join(cache_dir, ".ready")
651
+ return if File.file?(ready_stamp)
652
+
653
+ FileUtils.mkdir_p(File.dirname(cache_dir))
654
+ lock_path = "#{cache_dir}.lock"
655
+ File.open(lock_path, File::RDWR | File::CREAT, 0o600) do |lock_file|
656
+ lock_file.flock(File::LOCK_EX)
657
+ next if File.file?(ready_stamp)
658
+
659
+ FileUtils.mkdir_p(cache_dir)
660
+ command_runner.call(bootstrap_gem_install_command(name, version, source_url, cache_dir))
661
+ File.write(ready_stamp, "#{name} #{version}\n")
662
+ end
663
+ end
664
+
665
+ def bootstrap_cargo_build_jobs
666
+ explicit = ENV["CARGO_BUILD_JOBS"].to_s.strip
667
+ return explicit unless explicit.empty?
668
+
669
+ (Etc.nprocessors / 4).clamp(2, 4).to_s
670
+ rescue
671
+ "2"
625
672
  end
626
673
 
627
674
  def gemfile_bootstrap_gems(gemfile)
@@ -689,7 +736,11 @@ module Kettle
689
736
  end
690
737
 
691
738
  def bootstrap_gem_install_command(name, version, source_url, gem_home)
692
- env = unbundled_env.merge("GEM_HOME" => gem_home, "GEM_PATH" => gem_home)
739
+ env = unbundled_env.merge(
740
+ "GEM_HOME" => gem_home,
741
+ "GEM_PATH" => gem_home,
742
+ "CARGO_BUILD_JOBS" => bootstrap_cargo_build_jobs
743
+ )
693
744
  command = +"env"
694
745
  env.each do |key, value|
695
746
  assignment = value.nil? ? " -u #{key}" : " #{key}=#{Shellwords.escape(value)}"
@@ -238,7 +238,7 @@ module Kettle
238
238
 
239
239
  public
240
240
 
241
- def initialize(start_step: 0, local_ci: false, version: nil, appraisal_task: nil, skip_steps: nil, skip_changelog: nil, skip_appraisals: nil, skip_bundle_audit: nil, ci_workflows: nil, skip_remotes: nil, required_remotes: nil, secrets_provider_name: nil, yes: false, **options)
241
+ def initialize(start_step: 0, local_ci: false, version: nil, appraisal_task: nil, skip_steps: nil, skip_changelog: nil, skip_appraisals: nil, skip_bundle_audit: nil, ci_workflows: nil, ci_time_limit: nil, ci_required_workflows: nil, skip_remotes: nil, required_remotes: nil, secrets_provider_name: nil, yes: false, **options)
242
242
  @root = Kettle::Dev::CIHelpers.project_root
243
243
  @git = Kettle::Dev::GitAdapter.new(@root)
244
244
  @start_step = (start_step || 0).to_i
@@ -247,6 +247,8 @@ module Kettle
247
247
  @skip_changelog = truthy_value?(skip_changelog) || truthy_value?(ENV["KETTLE_DEV_SKIP_CHANGELOG"])
248
248
  @skip_appraisals = truthy_value?(skip_appraisals) || truthy_value?(ENV["KETTLE_DEV_SKIP_APPRAISALS"])
249
249
  @ci_workflows = normalize_ci_workflows(ci_workflows || ENV["K_RELEASE_CI_WORKFLOWS"])
250
+ @ci_time_limit = Kettle::Dev::CIMonitor.resolve_time_limit(ci_time_limit)
251
+ @ci_required_workflows = normalize_ci_workflows(ci_required_workflows || ENV["K_RELEASE_CI_REQUIRED_WORKFLOWS"])
250
252
  @skip_remotes = normalize_remote_names(skip_remotes || ENV["K_RELEASE_SKIP_REMOTES"], "skip remotes")
251
253
  @required_remotes = normalize_required_remotes(required_remotes)
252
254
  @local_ci = !!local_ci
@@ -1593,7 +1595,9 @@ module Kettle
1593
1595
  restart_hint: restart_hint,
1594
1596
  workflows: @ci_workflows,
1595
1597
  keepalive: release_secrets_keepalive_required? ? -> { keep_release_secrets_alive!("CI monitoring") } : nil,
1596
- event_recorder: @event_recorder
1598
+ event_recorder: @event_recorder,
1599
+ time_limit: @ci_time_limit,
1600
+ required_workflows: @ci_required_workflows.empty? ? nil : @ci_required_workflows
1597
1601
  )
1598
1602
  if ci_ok
1599
1603
  emit_ci_monitor_event(action: "finish", status: "ok", workflows: @ci_workflows, restart_hint: restart_hint)
@@ -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.39"
8
+ VERSION = "3.1.40"
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
@@ -1,3 +1,3 @@
1
- 4t<(Ob+.�SVM�3�"�H��Z�!\D���C-�P ����b=`���)0�����sT�_9+F�� �����h]����m^ϕ�U6"�=&]��ȳ���g�� 3�A"�R����y�
2
- 7��Đi���R�&8�p_���q7�5�&��=
3
- ~��y�����ͷ��- n/%>�4��:h��'^Oⶈ(m�
4
- �Д �B�lc�ѫ=Fݸ�Y��ByN���e���� ��%�E}e#�,
5
- ����_-T�.���*��=ܢ���EY����Q���36 E&j~
6
- v����.��hj�.�Y��~
7
- 1� �)_ǕF�T7S)��O�] -��ԟ��Ui��@i��P6�`_ n��_��K� �s�2�ÿ;�|y���(�R
1
+ n�俊a�Pɇ�q��f�s�DyB�%���l9�Cc���uV}��hr����S���4ar�'i��
2
+ �me^ �e�*��]���̽Cl��X AeE��jt���P�Q�N�S� p�J���R�\��V�*�#Q��¤U����r��-�k��Ώ��a�*m��OZ"}N�3H�n�h���`$�jq���V<�&��U�YUSHM��x�噋m-�SYޥ�
3
+ ��B�"�uJɟOzh��u�g��?��5�G�Z
4
+ O,(�E�Q��J^@�uT�{p��6G��
5
+ �ͬ�d5(���b��ne �i�1LS�]��IJm&���l�,����[;�Q���Bܤ���<�q��Eۉ_B�L���oR�8eh�}s@�A@�R��H���s�
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.39
4
+ version: 3.1.40
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter H. Boling
@@ -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.39"
483
- changelog_uri: "https://github.com/kettle-dev/kettle-dev/blob/v3.1.39/CHANGELOG.md"
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"
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.39"
485
+ documentation_uri: "https://www.rubydoc.info/gems/kettle-dev/3.1.40"
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