kettle-dev 3.1.35 → 3.1.36
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 +24 -1
- data/README.md +1 -1
- data/exe/kettle-dvcs +5 -2
- data/lib/kettle/dev/dvcs_cli.rb +183 -32
- data/lib/kettle/dev/release_cli.rb +26 -0
- data/lib/kettle/dev/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +4 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6aba42924fa36bffd3d25687913a2c18f79884d3503e979e66d0f54e4f984b8a
|
|
4
|
+
data.tar.gz: a4cd7b3978fa34eb87cfc79fe67d1579f15cbd63abece42b893ed75118951d7c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e44ec33626a3c83166009a9cf03d58f1d0b8560e50bf33170d7552239ef86dbbf7c61870a0c3d63ffc711b0d783899f5962c24f531ba72d193cad39e32abd8d8
|
|
7
|
+
data.tar.gz: c3704ef5aed6ad4f085e4f8ad891520922c0b4ffebc66deec30c48f167ae75211cb2f4f43c0ba8b2a2df7e1c6cf00f46396acf53b7dc7305906628de8c2454e2
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/CHANGELOG.md
CHANGED
|
@@ -30,6 +30,27 @@ Please file a bug if you notice a violation of semantic versioning.
|
|
|
30
30
|
|
|
31
31
|
### Security
|
|
32
32
|
|
|
33
|
+
## [3.1.36] - 2026-11-29
|
|
34
|
+
|
|
35
|
+
- TAG: [v3.1.36][3.1.36t]
|
|
36
|
+
- COVERAGE: 91.60% -- 6404/6991 lines in 51 files
|
|
37
|
+
- BRANCH COVERAGE: 76.01% -- 2494/3281 branches in 51 files
|
|
38
|
+
- 57.19% documented
|
|
39
|
+
|
|
40
|
+
### Added
|
|
41
|
+
|
|
42
|
+
- `kettle-dvcs` now writes per-forge availability to `.kettle/forges.yml` (`live` / `pending` / `off`, with `off` preserved across runs), which kettle-jem renders into README forge badges and the Federated DVCS table.
|
|
43
|
+
- `kettle-dvcs --create` creates missing mirrors when fetch fails: GitLab via push-to-create (flipping the default-private visibility to public via API when `GL_TOKEN`/`GITLAB_TOKEN` is set, and refusing to treat rename redirects as creation), Codeberg via the Forgejo API (`CB_TOKEN`/`CODEBERG_TOKEN`, since Codeberg disables push-to-create), each verified with a follow-up fetch.
|
|
44
|
+
|
|
45
|
+
### Changed
|
|
46
|
+
|
|
47
|
+
- `kettle-release` now syncs the checkout to its upstream (`Kettle::Dev::Rebase`) before step 0, so the release-prep commit is built on current upstream instead of conflicting when the trunk is synced at step 8. A conflicting sync aborts before any changes; branch-stack branches, local-CI releases, nested runs, and resumes past step 1 are skipped.
|
|
48
|
+
- `kettle-dvcs` no longer edits `README.md` (the summary-toggle regex had drifted from the kettle-jem template and was a no-op); kettle-jem owns README rendering from the state file instead.
|
|
49
|
+
|
|
50
|
+
### Fixed
|
|
51
|
+
|
|
52
|
+
- `appraisal_rake_spec` failure-mode mocks now match fallback targets on the command only, not the env hash; the rake derives its env partly from ambient `*_DEV` / `*_LOCAL` selectors (e.g. `STRUCTUREDMERGE_DEV`), so exact hash equality broke the fallback specs whenever those were set.
|
|
53
|
+
|
|
33
54
|
## [3.1.35] - 2026-11-28
|
|
34
55
|
|
|
35
56
|
- TAG: [v3.1.35][3.1.35t]
|
|
@@ -4448,7 +4469,9 @@ Please file a bug if you notice a violation of semantic versioning.
|
|
|
4448
4469
|
- Selecting will run the selected workflow via `act`
|
|
4449
4470
|
- This may move to its own gem in the future.
|
|
4450
4471
|
|
|
4451
|
-
[Unreleased]: https://github.com/kettle-dev/kettle-dev/compare/v3.1.
|
|
4472
|
+
[Unreleased]: https://github.com/kettle-dev/kettle-dev/compare/v3.1.36...HEAD
|
|
4473
|
+
[3.1.36]: https://github.com/kettle-dev/kettle-dev/compare/v3.1.35...v3.1.36
|
|
4474
|
+
[3.1.36t]: https://github.com/kettle-dev/kettle-dev/releases/tag/v3.1.36
|
|
4452
4475
|
[3.1.35]: https://github.com/kettle-dev/kettle-dev/compare/v3.1.34...v3.1.35
|
|
4453
4476
|
[3.1.35t]: https://github.com/kettle-dev/kettle-dev/releases/tag/v3.1.35
|
|
4454
4477
|
[3.1.34]: https://github.com/kettle-dev/kettle-dev/compare/v3.1.33...v3.1.34
|
data/README.md
CHANGED
|
@@ -1034,7 +1034,7 @@ Thanks for RTFM. ☺️
|
|
|
1034
1034
|
[📌gitmoji]: https://gitmoji.dev
|
|
1035
1035
|
[📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
|
|
1036
1036
|
[🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
|
|
1037
|
-
[🧮kloc-img]: https://img.shields.io/badge/KLOC-6.
|
|
1037
|
+
[🧮kloc-img]: https://img.shields.io/badge/KLOC-6.991-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
|
|
1038
1038
|
[🔐security]: https://github.com/kettle-dev/kettle-dev/blob/main/SECURITY.md
|
|
1039
1039
|
[🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
|
|
1040
1040
|
[📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
|
data/exe/kettle-dvcs
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
# kettle-dvcs: Normalize git remotes across GitHub, GitLab, and Codeberg
|
|
7
7
|
# - Aligns/creates remotes for the three forges and an 'all' remote
|
|
8
|
-
# - Attempts fetch from each forge and
|
|
8
|
+
# - Attempts fetch from each forge and records per-forge state in .kettle/forges.yml
|
|
9
9
|
|
|
10
10
|
# Immediate, unbuffered output
|
|
11
11
|
$stdout.sync = true
|
|
@@ -49,13 +49,16 @@ if ARGV.include?("-h") || ARGV.include?("--help")
|
|
|
49
49
|
--gitlab-name NAME Remote name for GitLab (default: gl)
|
|
50
50
|
--codeberg-name NAME Remote name for Codeberg (default: cb)
|
|
51
51
|
--status Fetch remotes; show ahead/behind vs origin/main
|
|
52
|
+
--create Create missing mirrors when fetch fails
|
|
53
|
+
(GitLab via push-to-create; Codeberg via API, CB_TOKEN required)
|
|
52
54
|
--force Non-interactive; accept defaults
|
|
53
55
|
|
|
54
56
|
Behavior:
|
|
55
57
|
- Ensures remotes exist and have consistent URLs
|
|
56
58
|
- Creates an 'all' remote that fetches from origin only and pushes to all three
|
|
57
59
|
- Prints `git remote -v`
|
|
58
|
-
- Fetches each forge to detect availability and
|
|
60
|
+
- Fetches each forge to detect availability and writes .kettle/forges.yml,
|
|
61
|
+
which kettle-jem renders into README forge badges and the Federated DVCS table
|
|
59
62
|
|
|
60
63
|
Environment:
|
|
61
64
|
KETTLE_DEV_DISABLE_GIT_GEM=true # force CLI git backend even if 'git' gem present
|
data/lib/kettle/dev/dvcs_cli.rb
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
require "optparse"
|
|
2
|
+
require "fileutils"
|
|
3
|
+
require "json"
|
|
4
|
+
require "net/http"
|
|
5
|
+
require "uri"
|
|
6
|
+
require "yaml"
|
|
2
7
|
|
|
3
8
|
module Kettle
|
|
4
9
|
module Dev
|
|
@@ -14,13 +19,17 @@ module Kettle
|
|
|
14
19
|
# --protocol [ssh|https] Use git+ssh or HTTPS URLs (default: ssh)
|
|
15
20
|
# --gitlab-name NAME Remote name for GitLab (default: gl)
|
|
16
21
|
# --codeberg-name NAME Remote name for Codeberg (default: cb)
|
|
22
|
+
# --create Create missing mirrors (GitLab via push-to-create,
|
|
23
|
+
# Codeberg via API with CB_TOKEN) when fetch fails
|
|
17
24
|
# --force Accept defaults; non-interactive
|
|
18
25
|
#
|
|
19
26
|
# Behavior:
|
|
20
27
|
# - Aligns or creates remotes for github, gitlab, and codeberg with consistent org/repo and protocol
|
|
21
28
|
# - Renames existing remotes to match chosen naming scheme when URLs already match
|
|
22
29
|
# - Creates an "all" remote that fetches from origin only and pushes to all three forges
|
|
23
|
-
# - Attempts to fetch from each forge to determine availability and
|
|
30
|
+
# - Attempts to fetch from each forge to determine availability and writes the
|
|
31
|
+
# per-forge state to .kettle/forges.yml, which kettle-jem renders into the
|
|
32
|
+
# README forge badges and Federated DVCS table
|
|
24
33
|
#
|
|
25
34
|
# Examples:
|
|
26
35
|
# Non-interactive run with defaults (origin: github, protocol: ssh)
|
|
@@ -36,13 +45,16 @@ module Kettle
|
|
|
36
45
|
gl_name: "gl",
|
|
37
46
|
cb_name: "cb",
|
|
38
47
|
force: false,
|
|
39
|
-
status: false
|
|
48
|
+
status: false,
|
|
49
|
+
create: false
|
|
40
50
|
}.freeze
|
|
41
51
|
FORGE_MIGRATION_TOOLS = {
|
|
42
52
|
github: "https://github.com/new/import",
|
|
43
53
|
gitlab: "https://gitlab.com/projects/new#import_project",
|
|
44
54
|
codeberg: "https://codeberg.org/repo/migrate"
|
|
45
55
|
}.freeze
|
|
56
|
+
FORGES = %i[github gitlab codeberg].freeze
|
|
57
|
+
FORGES_STATE_PATH = ".kettle/forges.yml"
|
|
46
58
|
|
|
47
59
|
# Create the CLI with argv-like arguments
|
|
48
60
|
# @param argv [Array<String>] the command-line arguments (without program name)
|
|
@@ -97,7 +109,9 @@ module Kettle
|
|
|
97
109
|
say("Remotes normalized. Origin: #{names[:origin]} (#{urls[@opts[:origin].to_sym]})")
|
|
98
110
|
show_remotes!(git)
|
|
99
111
|
fetch_results = attempt_fetches!(git, names)
|
|
100
|
-
|
|
112
|
+
fetch_results = create_missing_mirrors!(git, names, org, repo, fetch_results) if @opts[:create]
|
|
113
|
+
write_forge_state!(fetch_results)
|
|
114
|
+
print_import_links(fetch_results)
|
|
101
115
|
0
|
|
102
116
|
end
|
|
103
117
|
|
|
@@ -182,6 +196,7 @@ module Kettle
|
|
|
182
196
|
o.on("--gitlab-name NAME", "Remote name for GitLab (default: gl)") { |v| @opts[:gl_name] = v }
|
|
183
197
|
o.on("--codeberg-name NAME", "Remote name for Codeberg (default: cb)") { |v| @opts[:cb_name] = v }
|
|
184
198
|
o.on("--status", "Fetch remotes and show ahead/behind relative to origin/main") { @opts[:status] = true }
|
|
199
|
+
o.on("--create", "Create missing mirrors (GitLab via push-to-create, Codeberg via API) when fetch fails") { @opts[:create] = true }
|
|
185
200
|
o.on("--force", "Accept defaults; non-interactive") { @opts[:force] = true }
|
|
186
201
|
o.on("-h", "--help", "Show help") {
|
|
187
202
|
puts o
|
|
@@ -356,41 +371,177 @@ module Kettle
|
|
|
356
371
|
results
|
|
357
372
|
end
|
|
358
373
|
|
|
359
|
-
#
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
374
|
+
# Write per-forge availability to .kettle/forges.yml for kettle-jem,
|
|
375
|
+
# which renders it into the README forge badges and Federated DVCS
|
|
376
|
+
# table. Manually opted-out ("off") forges survive re-runs.
|
|
377
|
+
def write_forge_state!(results)
|
|
378
|
+
states = FORGES.each_with_object({}) { |forge, acc| acc[forge.to_s] = results[forge] ? "live" : "pending" }
|
|
379
|
+
preserve_off_states!(states)
|
|
380
|
+
FileUtils.mkdir_p(File.dirname(FORGES_STATE_PATH))
|
|
381
|
+
File.write(FORGES_STATE_PATH, <<~YAML)
|
|
382
|
+
# Written by kettle-dvcs; consumed by kettle-jem README templating.
|
|
383
|
+
# states: live (verified reachable), pending (not yet), off (opted out manually).
|
|
384
|
+
# Values are quoted: bare `off`/`on` parse as booleans in YAML 1.1.
|
|
385
|
+
origin: #{@opts[:origin]}
|
|
386
|
+
forges:
|
|
387
|
+
github: "#{states.fetch("github")}"
|
|
388
|
+
gitlab: "#{states.fetch("gitlab")}"
|
|
389
|
+
codeberg: "#{states.fetch("codeberg")}"
|
|
390
|
+
YAML
|
|
391
|
+
summary = FORGES.map { |forge| "#{forge}=#{states.fetch(forge.to_s)}" }.join(", ")
|
|
392
|
+
say("Wrote #{FORGES_STATE_PATH} (#{summary})")
|
|
393
|
+
end
|
|
394
|
+
|
|
395
|
+
def preserve_off_states!(states)
|
|
396
|
+
return unless File.file?(FORGES_STATE_PATH)
|
|
397
|
+
|
|
398
|
+
existing = Kettle::Dev.safe_load_yaml_file(FORGES_STATE_PATH)
|
|
399
|
+
return unless existing.is_a?(Hash) && existing["forges"].is_a?(Hash)
|
|
400
|
+
|
|
401
|
+
existing["forges"].each do |name, value|
|
|
402
|
+
state = value.is_a?(Hash) ? value["state"] : value
|
|
403
|
+
state = "off" if state == false # YAML 1.1 parses bare `off` as false
|
|
404
|
+
states[name.to_s] = "off" if state.to_s == "off" && states.key?(name.to_s)
|
|
378
405
|
end
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
406
|
+
rescue Psych::Exception
|
|
407
|
+
nil
|
|
408
|
+
end
|
|
409
|
+
|
|
410
|
+
# Print import links for any forge that is still unavailable.
|
|
411
|
+
def print_import_links(results)
|
|
412
|
+
return if FORGES.all? { |forge| results[forge] }
|
|
413
|
+
|
|
414
|
+
say("\nSome forges are not yet available. Use these import links to create mirrors:")
|
|
415
|
+
FORGES.each do |forge|
|
|
416
|
+
next if results[forge]
|
|
417
|
+
|
|
418
|
+
say(" - #{forge.capitalize} import: #{FORGE_MIGRATION_TOOLS[forge]}")
|
|
382
419
|
end
|
|
383
|
-
|
|
384
|
-
unless all_ok
|
|
385
|
-
say("\nSome forges are not yet available. Use these import links to create mirrors:")
|
|
386
|
-
[:github, :gitlab, :codeberg].each do |forge|
|
|
387
|
-
next if results[forge]
|
|
420
|
+
end
|
|
388
421
|
|
|
389
|
-
|
|
422
|
+
# --create: attempt to create mirrors for forges that failed fetch, then
|
|
423
|
+
# re-fetch to verify. GitLab supports push-to-create; Codeberg disables
|
|
424
|
+
# it, so creation goes through the Forgejo API (CB_TOKEN required).
|
|
425
|
+
def create_missing_mirrors!(git, names, org, repo, results)
|
|
426
|
+
branch = detect_default_branch!(git)
|
|
427
|
+
FORGES.each do |forge|
|
|
428
|
+
next if results[forge]
|
|
429
|
+
|
|
430
|
+
remote = names[forge]
|
|
431
|
+
next unless remote
|
|
432
|
+
|
|
433
|
+
created = case forge
|
|
434
|
+
when :gitlab then create_gitlab_mirror!(git, remote, org, repo, branch)
|
|
435
|
+
when :codeberg then create_codeberg_mirror!(git, remote, org, repo, branch)
|
|
436
|
+
else
|
|
437
|
+
say(" - #{forge}: cannot auto-create; use #{FORGE_MIGRATION_TOOLS[forge]}")
|
|
438
|
+
false
|
|
390
439
|
end
|
|
440
|
+
next unless created
|
|
441
|
+
|
|
442
|
+
verified = git.fetch(remote)
|
|
443
|
+
results[forge] = !!verified
|
|
444
|
+
say(" - #{forge}: mirror created and verified") if results[forge]
|
|
445
|
+
say(" - #{forge}: created, but verification fetch still fails") unless results[forge]
|
|
446
|
+
end
|
|
447
|
+
results
|
|
448
|
+
end
|
|
449
|
+
|
|
450
|
+
# GitLab creates a project when pushing to a nonexistent path in a
|
|
451
|
+
# namespace you can create in (push-to-create). New projects are
|
|
452
|
+
# PRIVATE, so visibility is flipped to public via API when a token is
|
|
453
|
+
# available; otherwise the settings link is printed. Beware: pushing to
|
|
454
|
+
# a previously renamed path silently targets the renamed project
|
|
455
|
+
# instead of creating a new one, so the output is checked for the
|
|
456
|
+
# "was created" notice.
|
|
457
|
+
def create_gitlab_mirror!(git, remote, org, repo, branch)
|
|
458
|
+
say(" - gitlab: attempting push-to-create (git push #{remote} #{branch})...")
|
|
459
|
+
out, ok = git.capture(["push", remote, branch])
|
|
460
|
+
unless ok
|
|
461
|
+
say(" - gitlab: push-to-create failed: #{out}")
|
|
462
|
+
return false
|
|
463
|
+
end
|
|
464
|
+
if out.to_s.match?(/redirect/i)
|
|
465
|
+
say(" - gitlab: push followed a rename redirect; refusing to treat that as mirror creation")
|
|
466
|
+
return false
|
|
467
|
+
end
|
|
468
|
+
if out.to_s.include?("was created")
|
|
469
|
+
token = ENV["GL_TOKEN"] || ENV["GITLAB_TOKEN"]
|
|
470
|
+
if token.to_s.empty?
|
|
471
|
+
say(" - gitlab: project created as PRIVATE. Make it public: https://gitlab.com/#{org}/#{repo}/-/edit (or set GL_TOKEN)")
|
|
472
|
+
else
|
|
473
|
+
make_gitlab_project_public!(org, repo, token)
|
|
474
|
+
end
|
|
475
|
+
else
|
|
476
|
+
say(" - gitlab: pushed to existing project (fetch failure may be auth/visibility related)")
|
|
477
|
+
end
|
|
478
|
+
true
|
|
479
|
+
end
|
|
480
|
+
|
|
481
|
+
def make_gitlab_project_public!(org, repo, token)
|
|
482
|
+
path = URI.encode_www_form_component("#{org}/#{repo}")
|
|
483
|
+
code, = http_json_request(:put, "https://gitlab.com/api/v4/projects/#{path}", headers: {"PRIVATE-TOKEN" => token}, payload: {visibility: "public"})
|
|
484
|
+
if (200..299).cover?(code)
|
|
485
|
+
say(" - gitlab: project visibility set to public")
|
|
486
|
+
else
|
|
487
|
+
say(" - gitlab: could not set visibility via API (#{code}); make it public: https://gitlab.com/#{org}/#{repo}/-/edit")
|
|
488
|
+
end
|
|
489
|
+
end
|
|
490
|
+
|
|
491
|
+
# Codeberg (Forgejo) disables push-to-create, so the repository is
|
|
492
|
+
# created via API (personal namespace vs org chosen from the token's
|
|
493
|
+
# user), then content is mirrored with a normal push.
|
|
494
|
+
def create_codeberg_mirror!(git, remote, org, repo, branch)
|
|
495
|
+
token = ENV["CB_TOKEN"] || ENV["CODEBERG_TOKEN"]
|
|
496
|
+
if token.to_s.empty?
|
|
497
|
+
say(" - codeberg: push-to-create is disabled on Codeberg; set CB_TOKEN to create via API, or use #{FORGE_MIGRATION_TOOLS[:codeberg]}")
|
|
498
|
+
return false
|
|
499
|
+
end
|
|
500
|
+
code, user = http_json_request(:get, "https://codeberg.org/api/v1/user", headers: {"Authorization" => "token #{token}"})
|
|
501
|
+
unless (200..299).cover?(code)
|
|
502
|
+
say(" - codeberg: API authentication failed (#{code}); check CB_TOKEN")
|
|
503
|
+
return false
|
|
504
|
+
end
|
|
505
|
+
endpoint = if user["login"].to_s.casecmp(org).zero?
|
|
506
|
+
"https://codeberg.org/api/v1/user/repos"
|
|
507
|
+
else
|
|
508
|
+
"https://codeberg.org/api/v1/orgs/#{URI.encode_www_form_component(org)}/repos"
|
|
509
|
+
end
|
|
510
|
+
code, body = http_json_request(:post, endpoint, headers: {"Authorization" => "token #{token}"}, payload: {name: repo, private: false})
|
|
511
|
+
unless [201, 409].include?(code) # 409: repo already exists
|
|
512
|
+
say(" - codeberg: repo creation failed (#{code}): #{body["message"]}")
|
|
513
|
+
return false
|
|
514
|
+
end
|
|
515
|
+
out, ok = git.capture(["push", remote, branch])
|
|
516
|
+
say(" - codeberg: push failed: #{out}") unless ok
|
|
517
|
+
ok
|
|
518
|
+
end
|
|
519
|
+
|
|
520
|
+
def http_json_request(method, url, headers:, payload: nil)
|
|
521
|
+
uri = URI(url)
|
|
522
|
+
request = case method
|
|
523
|
+
when :get then Net::HTTP::Get.new(uri)
|
|
524
|
+
when :post then Net::HTTP::Post.new(uri)
|
|
525
|
+
when :put then Net::HTTP::Put.new(uri)
|
|
526
|
+
else
|
|
527
|
+
raise ArgumentError, "unsupported HTTP method: #{method}"
|
|
528
|
+
end
|
|
529
|
+
headers.each { |key, value| request[key] = value }
|
|
530
|
+
request["Accept"] = "application/json"
|
|
531
|
+
if payload
|
|
532
|
+
request["Content-Type"] = "application/json"
|
|
533
|
+
request.body = JSON.generate(payload)
|
|
534
|
+
end
|
|
535
|
+
response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
|
|
536
|
+
body = begin
|
|
537
|
+
JSON.parse(response.body.to_s)
|
|
538
|
+
rescue JSON::ParserError
|
|
539
|
+
{}
|
|
391
540
|
end
|
|
541
|
+
[response.code.to_i, body]
|
|
392
542
|
rescue => e
|
|
393
|
-
|
|
543
|
+
say(" - HTTP #{method.to_s.upcase} #{url} failed: #{e.class}: #{e.message}")
|
|
544
|
+
[0, {}]
|
|
394
545
|
end
|
|
395
546
|
|
|
396
547
|
def say(msg)
|
|
@@ -306,6 +306,8 @@ module Kettle
|
|
|
306
306
|
return run_family_member_publish if family_member_publish?
|
|
307
307
|
return run_family_member_finalize if family_member_finalize?
|
|
308
308
|
|
|
309
|
+
sync_upstream_before_release_prep!
|
|
310
|
+
|
|
309
311
|
# Changelog generation at step 0 runs the target project's test bundle
|
|
310
312
|
# to collect coverage. Normalize its canonical release lockfile before
|
|
311
313
|
# that subprocess starts; otherwise a local development PATH lock can
|
|
@@ -3276,6 +3278,30 @@ module Kettle
|
|
|
3276
3278
|
puts "Merged #{feature} into #{trunk} and pushed. The PR (if any) should auto-close."
|
|
3277
3279
|
end
|
|
3278
3280
|
|
|
3281
|
+
# Release prep (changelog, README, docs, lockfiles) is committed at step 6,
|
|
3282
|
+
# but the trunk is only synced at step 8. Upstream changes to those files
|
|
3283
|
+
# then conflict with the prep commit mid-rebase. Sync the checkout to its
|
|
3284
|
+
# upstream up front, while it is still clean, so step 8 has nothing to do.
|
|
3285
|
+
#
|
|
3286
|
+
# Skipped when resuming past the first steps (the prep commit may already
|
|
3287
|
+
# exist), for local CI releases, for branch-stack release branches (they
|
|
3288
|
+
# sync their own lanes), and when nested inside an outer command that
|
|
3289
|
+
# already synced (Kettle::Dev::Rebase honors KETTLE_REBASE_NESTED).
|
|
3290
|
+
def sync_upstream_before_release_prep!
|
|
3291
|
+
return if @start_step > 1 || local_ci?
|
|
3292
|
+
return if local_kettle_family_release_target_branches.include?(current_branch)
|
|
3293
|
+
|
|
3294
|
+
result = Kettle::Dev::Rebase.call(root: @root)
|
|
3295
|
+
return if result.status == :skipped_nested
|
|
3296
|
+
|
|
3297
|
+
puts "Upstream sync: #{result.message}"
|
|
3298
|
+
return if result.ok?
|
|
3299
|
+
|
|
3300
|
+
abort("Aborting before release prep: #{result.message}") if result.status == :conflict
|
|
3301
|
+
|
|
3302
|
+
warn("Upstream sync failed (#{result.message}); continuing with local state.")
|
|
3303
|
+
end
|
|
3304
|
+
|
|
3279
3305
|
def branch_stack_release_branch?(branch, trunk = nil)
|
|
3280
3306
|
return false if branch.to_s.empty?
|
|
3281
3307
|
return false if trunk && branch == trunk
|
data/lib/kettle/dev/version.rb
CHANGED
|
@@ -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.
|
|
8
|
+
VERSION = "3.1.36"
|
|
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.
|
|
4
|
+
version: 3.1.36
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Peter H. Boling
|
|
@@ -477,10 +477,10 @@ licenses:
|
|
|
477
477
|
- AGPL-3.0-only
|
|
478
478
|
metadata:
|
|
479
479
|
homepage_uri: "https://kettle-dev.galtzo.com"
|
|
480
|
-
source_code_uri: "https://github.com/kettle-dev/kettle-dev/tree/v3.1.
|
|
481
|
-
changelog_uri: "https://github.com/kettle-dev/kettle-dev/blob/v3.1.
|
|
480
|
+
source_code_uri: "https://github.com/kettle-dev/kettle-dev/tree/v3.1.36"
|
|
481
|
+
changelog_uri: "https://github.com/kettle-dev/kettle-dev/blob/v3.1.36/CHANGELOG.md"
|
|
482
482
|
bug_tracker_uri: "https://github.com/kettle-dev/kettle-dev/issues"
|
|
483
|
-
documentation_uri: "https://www.rubydoc.info/gems/kettle-dev/3.1.
|
|
483
|
+
documentation_uri: "https://www.rubydoc.info/gems/kettle-dev/3.1.36"
|
|
484
484
|
funding_uri: "https://github.com/sponsors/pboling"
|
|
485
485
|
wiki_uri: "https://github.com/kettle-dev/kettle-dev/wiki"
|
|
486
486
|
news_uri: "https://www.railsbling.com/tags/kettle-dev"
|
metadata.gz.sig
CHANGED
|
Binary file
|