kettle-dev 2.1.1 → 2.2.1
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +83 -1
- data/README.md +46 -3
- data/SECURITY.md +1 -1
- data/exe/kettle-bump +41 -0
- data/exe/kettle-gha-sha-pins +40 -0
- data/exe/kettle-pre-release +4 -2
- data/exe/kettle-release +4 -0
- data/lib/kettle/dev/bump_cli.rb +209 -0
- data/lib/kettle/dev/ci_helpers.rb +14 -6
- data/lib/kettle/dev/ci_monitor.rb +41 -2
- data/lib/kettle/dev/gem_spec_reader.rb +3 -3
- data/lib/kettle/dev/gha_sha_pins_cli.rb +1225 -0
- data/lib/kettle/dev/pre_release_cli.rb +18 -6
- data/lib/kettle/dev/rakelib/spec_test.rake +22 -14
- data/lib/kettle/dev/release_cli.rb +7 -0
- data/lib/kettle/dev/version.rb +1 -1
- data/lib/kettle/dev.rb +12 -0
- data/sig/kettle/dev/ci_helpers.rbs +5 -2
- data/sig/kettle/dev/ci_monitor.rbs +3 -0
- data.tar.gz.sig +0 -0
- metadata +14 -8
- metadata.gz.sig +0 -0
|
@@ -285,8 +285,13 @@ module Kettle
|
|
|
285
285
|
total = workflows.size
|
|
286
286
|
abort("No GitHub workflows found under .github/workflows; aborting.") if total.zero?
|
|
287
287
|
|
|
288
|
+
head_sha = Kettle::Dev::CIHelpers.current_head_sha
|
|
289
|
+
abort("Could not determine local HEAD SHA for GitHub Actions checks.") unless head_sha && !head_sha.empty?
|
|
290
|
+
|
|
288
291
|
passed = {}
|
|
292
|
+
started = {}
|
|
289
293
|
puts "Ensuring GitHub Actions workflows pass on #{branch} (#{owner}/#{repo}) via remote '#{gh_remote}'"
|
|
294
|
+
puts "Waiting for GitHub Actions runs to start for HEAD #{head_sha[0, 12]}."
|
|
290
295
|
pbar = if defined?(ProgressBar)
|
|
291
296
|
ProgressBar.create(title: "CI", total: total, format: "%t %b %c/%C", length: 30)
|
|
292
297
|
end
|
|
@@ -300,11 +305,15 @@ module Kettle
|
|
|
300
305
|
end
|
|
301
306
|
end
|
|
302
307
|
sleep((initial_sleep && initial_sleep >= 0) ? initial_sleep : 3)
|
|
308
|
+
start_timeout = github_start_timeout
|
|
309
|
+
poll_interval = github_poll_interval
|
|
310
|
+
start_deadline = monotonic_time + start_timeout
|
|
303
311
|
idx = 0
|
|
304
312
|
loop do
|
|
305
313
|
wf = workflows[idx]
|
|
306
|
-
run = Kettle::Dev::CIHelpers.latest_run(owner: owner, repo: repo, workflow_file: wf, branch: branch)
|
|
314
|
+
run = Kettle::Dev::CIHelpers.latest_run(owner: owner, repo: repo, workflow_file: wf, branch: branch, require_head: true, head_sha: head_sha)
|
|
307
315
|
if run
|
|
316
|
+
started[wf] = true
|
|
308
317
|
if Kettle::Dev::CIHelpers.success?(run)
|
|
309
318
|
unless passed[wf]
|
|
310
319
|
passed[wf] = true
|
|
@@ -317,9 +326,14 @@ module Kettle
|
|
|
317
326
|
end
|
|
318
327
|
end
|
|
319
328
|
break if passed.size == total
|
|
329
|
+
if started.size < total && monotonic_time >= start_deadline
|
|
330
|
+
missing = (workflows - started.keys).join(", ")
|
|
331
|
+
puts
|
|
332
|
+
abort("Timed out after #{start_timeout}s waiting for GitHub Actions workflows to start for HEAD #{head_sha[0, 12]}: #{missing}. Confirm GitHub Actions started, then restart this tool from CI validation with: #{restart_hint}")
|
|
333
|
+
end
|
|
320
334
|
|
|
321
335
|
idx = (idx + 1) % total
|
|
322
|
-
sleep(
|
|
336
|
+
sleep(poll_interval)
|
|
323
337
|
end
|
|
324
338
|
pbar&.finish unless pbar&.finished?
|
|
325
339
|
puts "\nAll GitHub workflows passing (#{passed.size}/#{total})."
|
|
@@ -327,6 +341,31 @@ module Kettle
|
|
|
327
341
|
end
|
|
328
342
|
module_function :monitor_github_internal!
|
|
329
343
|
|
|
344
|
+
def monotonic_time
|
|
345
|
+
Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
|
346
|
+
end
|
|
347
|
+
module_function :monotonic_time
|
|
348
|
+
|
|
349
|
+
def github_start_timeout
|
|
350
|
+
seconds = begin
|
|
351
|
+
Integer(ENV["K_RELEASE_CI_START_TIMEOUT"])
|
|
352
|
+
rescue
|
|
353
|
+
nil
|
|
354
|
+
end
|
|
355
|
+
(seconds && seconds >= 0) ? seconds : 120
|
|
356
|
+
end
|
|
357
|
+
module_function :github_start_timeout
|
|
358
|
+
|
|
359
|
+
def github_poll_interval
|
|
360
|
+
seconds = begin
|
|
361
|
+
Float(ENV["K_RELEASE_CI_POLL_INTERVAL"])
|
|
362
|
+
rescue
|
|
363
|
+
nil
|
|
364
|
+
end
|
|
365
|
+
(seconds && seconds >= 0) ? seconds : 1
|
|
366
|
+
end
|
|
367
|
+
module_function :github_poll_interval
|
|
368
|
+
|
|
330
369
|
def monitor_gitlab_internal!(restart_hint:)
|
|
331
370
|
root = Kettle::Dev::CIHelpers.project_root
|
|
332
371
|
gitlab_ci = File.exist?(File.join(root, ".gitlab-ci.yml"))
|
|
@@ -25,7 +25,7 @@ module Kettle
|
|
|
25
25
|
# @option return [String] :gem_name gem name ("" when not derivable)
|
|
26
26
|
# @option return [Gem::Version] :min_ruby minimum Ruby version derived or DEFAULT_MINIMUM_RUBY
|
|
27
27
|
# @option return [String] :homepage homepage string (may be "")
|
|
28
|
-
# @option return [String] :gh_org GitHub org (falls back to "kettle-
|
|
28
|
+
# @option return [String] :gh_org GitHub org (falls back to "kettle-dev")
|
|
29
29
|
# @option return [String] :forge_org primary forge org (currently same as gh_org)
|
|
30
30
|
# @option return [String, nil] :funding_org OpenCollective/org handle or nil when not discovered
|
|
31
31
|
# @option return [String, nil] :gh_repo GitHub repo name, if discoverable
|
|
@@ -107,8 +107,8 @@ module Kettle
|
|
|
107
107
|
forge_org = explicit_forge_org || forge_info[:forge_org]
|
|
108
108
|
gh_repo = forge_info[:origin_repo]
|
|
109
109
|
if forge_org.to_s.empty?
|
|
110
|
-
Kernel.warn("kettle-dev: Could not determine forge org from spec.homepage or git remote.\n - Ensure gemspec.homepage is set to a GitHub URL or that the git remote 'origin' points to GitHub.\n - Example homepage: https://github.com/<org>/<repo>\n - Proceeding with default org: kettle-
|
|
111
|
-
forge_org = "kettle-
|
|
110
|
+
Kernel.warn("kettle-dev: Could not determine forge org from spec.homepage or git remote.\n - Ensure gemspec.homepage is set to a GitHub URL or that the git remote 'origin' points to GitHub.\n - Example homepage: https://github.com/<org>/<repo>\n - Proceeding with default org: kettle-dev.")
|
|
111
|
+
forge_org = "kettle-dev"
|
|
112
112
|
end
|
|
113
113
|
|
|
114
114
|
camel = lambda do |s|
|