kettle-dev 3.1.35 → 3.1.37
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 +52 -1
- data/README.md +94 -92
- data/exe/kettle-dvcs +5 -2
- data/lib/kettle/dev/dvcs_cli.rb +183 -32
- data/lib/kettle/dev/probe_dispatch.rb +146 -0
- data/lib/kettle/dev/registry_availability.rb +178 -0
- data/lib/kettle/dev/release_cli.rb +108 -0
- data/lib/kettle/dev/version.rb +1 -1
- data/lib/kettle/dev.rb +2 -0
- data.tar.gz.sig +0 -0
- metadata +6 -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: 6c7f5ee6b47ecfcb73bd6b367c023576a16fa567c1838f41b349dcd8fd52f3c2
|
|
4
|
+
data.tar.gz: fdaa373ef6442071f8b6e88cf9ef81aada14ed65d5df514186a6dd047fd894bb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4475a80a7efeb2ec5cd2de07bc352a43ac4dd13a790ca227f7d882270125f20a1d2f94e72ea2fe927f1432968cd4211663f07e0db9a146fff169ce469abc5698
|
|
7
|
+
data.tar.gz: cc18cffa72e089f2958ff7b098e66ea09eff50838b5d104d7a60a9a171ed8e6cc7dfd0785ffeb9cae08cf5562d36e2d644e9b9875ea42dad72f4128bced0cc6f
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/CHANGELOG.md
CHANGED
|
@@ -30,6 +30,53 @@ Please file a bug if you notice a violation of semantic versioning.
|
|
|
30
30
|
|
|
31
31
|
### Security
|
|
32
32
|
|
|
33
|
+
## [3.1.37] - 2026-12-02
|
|
34
|
+
|
|
35
|
+
- TAG: [v3.1.37][3.1.37t]
|
|
36
|
+
- COVERAGE: 91.73% -- 6599/7194 lines in 53 files
|
|
37
|
+
- BRANCH COVERAGE: 76.09% -- 2530/3325 branches in 53 files
|
|
38
|
+
- 57.28% documented
|
|
39
|
+
|
|
40
|
+
### Added
|
|
41
|
+
|
|
42
|
+
- Kettle::Dev::RegistryAvailability (shared poller) and Kettle::Dev::ProbeDispatch (file-based channel) so a family can run one central poll dispatcher for all members (KETTLE_RELEASE_PROBE_DISPATCH_DIR); children fall back to local polling
|
|
43
|
+
|
|
44
|
+
### Changed
|
|
45
|
+
|
|
46
|
+
- [kc] kettle-jem/prepare: updated 12 project files since the last release:
|
|
47
|
+
- configuration (1)
|
|
48
|
+
- dependencies (9)
|
|
49
|
+
- other (2)
|
|
50
|
+
|
|
51
|
+
- [kc] kettle-jem/template: updated 9 project files since the last release:
|
|
52
|
+
- code and tests (2)
|
|
53
|
+
- documentation (1)
|
|
54
|
+
- other (2)
|
|
55
|
+
- workflows (4)
|
|
56
|
+
|
|
57
|
+
- kettle-release availability probe now asks the registry index (compact index plus artifact reachability) instead of resolving and installing the gem and its dependency tree into a throwaway GEM_HOME on every attempt; set KETTLE_DEV_RELEASE_PROBE_MODE=install for the legacy probe, KETTLE_DEV_RELEASE_PROBE_TIMEOUT to bound the wait
|
|
58
|
+
|
|
59
|
+
## [3.1.36] - 2026-11-29
|
|
60
|
+
|
|
61
|
+
- TAG: [v3.1.36][3.1.36t]
|
|
62
|
+
- COVERAGE: 91.60% -- 6404/6991 lines in 51 files
|
|
63
|
+
- BRANCH COVERAGE: 76.01% -- 2494/3281 branches in 51 files
|
|
64
|
+
- 57.19% documented
|
|
65
|
+
|
|
66
|
+
### Added
|
|
67
|
+
|
|
68
|
+
- `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.
|
|
69
|
+
- `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.
|
|
70
|
+
|
|
71
|
+
### Changed
|
|
72
|
+
|
|
73
|
+
- `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.
|
|
74
|
+
- `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.
|
|
75
|
+
|
|
76
|
+
### Fixed
|
|
77
|
+
|
|
78
|
+
- `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.
|
|
79
|
+
|
|
33
80
|
## [3.1.35] - 2026-11-28
|
|
34
81
|
|
|
35
82
|
- TAG: [v3.1.35][3.1.35t]
|
|
@@ -4448,7 +4495,11 @@ Please file a bug if you notice a violation of semantic versioning.
|
|
|
4448
4495
|
- Selecting will run the selected workflow via `act`
|
|
4449
4496
|
- This may move to its own gem in the future.
|
|
4450
4497
|
|
|
4451
|
-
[Unreleased]: https://github.com/kettle-dev/kettle-dev/compare/v3.1.
|
|
4498
|
+
[Unreleased]: https://github.com/kettle-dev/kettle-dev/compare/v3.1.37...HEAD
|
|
4499
|
+
[3.1.37]: https://github.com/kettle-dev/kettle-dev/compare/v3.1.36...v3.1.37
|
|
4500
|
+
[3.1.37t]: https://github.com/kettle-dev/kettle-dev/releases/tag/v3.1.37
|
|
4501
|
+
[3.1.36]: https://github.com/kettle-dev/kettle-dev/compare/v3.1.35...v3.1.36
|
|
4502
|
+
[3.1.36t]: https://github.com/kettle-dev/kettle-dev/releases/tag/v3.1.36
|
|
4452
4503
|
[3.1.35]: https://github.com/kettle-dev/kettle-dev/compare/v3.1.34...v3.1.35
|
|
4453
4504
|
[3.1.35t]: https://github.com/kettle-dev/kettle-dev/releases/tag/v3.1.35
|
|
4454
4505
|
[3.1.34]: https://github.com/kettle-dev/kettle-dev/compare/v3.1.33...v3.1.34
|
data/README.md
CHANGED
|
@@ -6,18 +6,13 @@
|
|
|
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
|
|
|
9
|
-
---
|
|
10
|
-
|
|
11
9
|
`if ci_badges.map(&:color).all? { it == "green"}` 👇️ send money so I can do more of this. FLOSS maintenance is now my full-time job.
|
|
12
10
|
|
|
13
11
|
[![OpenCollective Backers][🖇osc-backers-i]][🖇osc-backers] [![OpenCollective Sponsors][🖇osc-sponsors-i]][🖇osc-sponsors] [![Sponsor Me on Github][🖇sponsor-img]][🖇sponsor] [![Liberapay Goal Progress][⛳liberapay-img]][⛳liberapay] [![Donate on PayPal][🖇paypal-img]][🖇paypal] [![Buy me a coffee][🖇buyme-small-img]][🖇buyme] [![Donate at ko-fi.com][🖇kofi-img]][🖇kofi]
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
I've summarized my thoughts in [this blog post](https://dev.to/galtzo/hostile-takeover-of-rubygems-my-thoughts-5hlo).
|
|
19
|
-
|
|
20
|
-
</details>
|
|
13
|
+
<!-- kettle-sponsors:shields:start -->
|
|
14
|
+
<a href="#corporate-sponsorship"><img src="https://logos.galtzo.com/assets/images/sponsors/shield/github.svg" alt="services: GitHub"></a> <a href="#corporate-sponsorship"><img src="https://logos.galtzo.com/assets/images/sponsors/shield/healthsherpa.svg" alt="sponsor: HealthSherpa"></a> <a href="#corporate-sponsorship"><img src="https://logos.galtzo.com/assets/images/sponsors/shield/microsoft.svg" alt="compute: Microsoft"></a>
|
|
15
|
+
<!-- kettle-sponsors:shields:end -->
|
|
21
16
|
|
|
22
17
|
## 🌻 Synopsis <a href="https://discord.gg/3qme4XHNKN"><img alt="Galtzo FLOSS Logo by Aboling0, CC BY-SA 4.0" src="https://logos.galtzo.com/assets/images/galtzo-floss/avatar-128px.svg" width="8%" align="right"/></a> <a href="https://ruby-toolbox.com"><img alt="ruby-lang Logo, Yukihiro Matsumoto, Ruby Visual Identity Team, CC BY-SA 2.5" src="https://logos.galtzo.com/assets/images/ruby-lang/avatar-128px.svg" width="8%" align="right"/></a>
|
|
23
18
|
|
|
@@ -88,73 +83,6 @@ out to `kettle-release` for each member that needs publishing.
|
|
|
88
83
|
- `kettle-readme-backers` for Open Collective README sections.
|
|
89
84
|
- `kettle-dev-setup` as a deprecated compatibility executable that exits with instructions to use kettle-jem.
|
|
90
85
|
|
|
91
|
-
## 💡 Info you can shake a stick at
|
|
92
|
-
|
|
93
|
-
| Tokens to Remember | [![Gem name][⛳️name-img]][⛳️gem-name] [![Gem namespace][⛳️namespace-img]][⛳️gem-namespace] |
|
|
94
|
-
|-------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
95
|
-
| Works with JRuby | [![JRuby 10.0 Compat][💎jruby-10.0i]][🚎jruby-10.0-wf] [![JRuby current Compat][💎jruby-c-i]][🚎10-j-wf] [![JRuby HEAD Compat][💎jruby-headi]][🚎3-hd-wf]|
|
|
96
|
-
| Works with Truffle Ruby | [![Truffle Ruby 33.0 Compat][💎truby-33.0i]][🚎truby-33.0-wf] [![Truffle Ruby current Compat][💎truby-c-i]][🚎9-t-wf]|
|
|
97
|
-
| Works with MRI Ruby 4 | [![Ruby current Compat][💎ruby-c-i]][🚎11-c-wf] [![Ruby HEAD Compat][💎ruby-headi]][🚎3-hd-wf]|
|
|
98
|
-
| Works with MRI Ruby 3 | [![Ruby 3.0 Compat][💎ruby-3.0i]][🚎ruby-3.0-wf] [![Ruby 3.1 Compat][💎ruby-3.1i]][🚎ruby-3.1-wf] [![Ruby 3.2 Compat][💎ruby-3.2i]][🚎ruby-3.2-wf] [![Ruby 3.3 Compat][💎ruby-3.3i]][🚎ruby-3.3-wf] [![Ruby 3.4 Compat][💎ruby-3.4i]][🚎ruby-3.4-wf]|
|
|
99
|
-
| Works with MRI Ruby 2 | [![Ruby 2.4 Compat][💎ruby-2.4i]][🚎ruby-2.4-wf] [![Ruby 2.5 Compat][💎ruby-2.5i]][🚎ruby-2.5-wf] [![Ruby 2.6 Compat][💎ruby-2.6i]][🚎ruby-2.6-wf] [![Ruby 2.7 Compat][💎ruby-2.7i]][🚎ruby-2.7-wf]|
|
|
100
|
-
| Support & Community | [![Join Me on Daily.dev's RubyFriends][✉️ruby-friends-img]][✉️ruby-friends] [![Get help from RubyForum][✉️ruby-forum-img]][✉️ruby-forum] [![Live Chat on Discord][✉️discord-invite-img-ftb]][✉️discord-invite] [![Get help from me on Upwork][👨🏼🏫expsup-upwork-img]][👨🏼🏫expsup-upwork] [![Get help from me on Codementor][👨🏼🏫expsup-codementor-img]][👨🏼🏫expsup-codementor] |
|
|
101
|
-
| Source | [![Source on GitLab.com][📜src-gl-img]][📜src-gl] [![Source on CodeBerg.org][📜src-cb-img]][📜src-cb] [![Source on GitHub.com][📜src-gh-img]][📜src-gh] [![The best SHA: dQw4w9WgXcQ!][🧮kloc-img]][🧮kloc] |
|
|
102
|
-
| Documentation | [![Current release on RubyDoc.info][📜docs-cr-rd-img]][🚎yard-current] [![YARD on Galtzo.com][📜docs-head-rd-img]][🚎yard-head] [![Maintainer Blog][🚂maint-blog-img]][🚂maint-blog] [![GitLab Wiki][📜gl-wiki-img]][📜gl-wiki] [![GitHub Wiki][📜gh-wiki-img]][📜gh-wiki] |
|
|
103
|
-
| Compliance | [![License: AGPL-3.0-only][📄license-img]][📄license] [![Apache license compatibility: Category X][📄license-compat-img]][📄license-compat] [![📄ilo-declaration-img]][📄ilo-declaration] [![Security Policy][🔐security-img]][🔐security] [![Contributor Covenant 2.1][🪇conduct-img]][🪇conduct] [![SemVer 2.0.0][📌semver-img]][📌semver] |
|
|
104
|
-
| Style | [![Enforced Code Style Linter][💎rlts-img]][💎rlts] [![Keep-A-Changelog 1.0.0][📗keep-changelog-img]][📗keep-changelog] [![Gitmoji Commits][📌gitmoji-img]][📌gitmoji] [![Compatibility appraised by: appraisal2][💎appraisal2-img]][💎appraisal2] |
|
|
105
|
-
| Maintainer 🎖️ | [![Follow Me on LinkedIn][💖🖇linkedin-img]][💖🖇linkedin] [![Follow Me on Ruby.Social][💖🐘ruby-mast-img]][💖🐘ruby-mast] [![Follow Me on Bluesky][💖🦋bluesky-img]][💖🦋bluesky] [![Contact Maintainer][🚂maint-contact-img]][🚂maint-contact] [![My technical writing][💖💁🏼♂️devto-img]][💖💁🏼♂️devto] |
|
|
106
|
-
| `...` 💖 | [![Find Me on WellFound:][💖✌️wellfound-img]][💖✌️wellfound] [![Find Me on CrunchBase][💖💲crunchbase-img]][💖💲crunchbase] [![My LinkTree][💖🌳linktree-img]][💖🌳linktree] [![More About Me][💖💁🏼♂️aboutme-img]][💖💁🏼♂️aboutme] [🧊][💖🧊berg] [🐙][💖🐙hub] [🛖][💖🛖hut] [🧪][💖🧪lab] |
|
|
107
|
-
|
|
108
|
-
### Compatibility
|
|
109
|
-
|
|
110
|
-
The gem's declared runtime compatibility floor is MRI Ruby 2.4.0+, with concordant releases of JRuby and TruffleRuby.
|
|
111
|
-
CI workflows and Appraisals are generated for MRI Ruby 2.4+.
|
|
112
|
-
The current MRI CI lane runs on Linux and macOS.
|
|
113
|
-
The test floor is configured by `ruby.test_minimum` in `.kettle-jem.yml`.
|
|
114
|
-
When it is higher than the runtime floor, older runtime-compatible Rubies are
|
|
115
|
-
not covered by the generated CI or Appraisal matrix.
|
|
116
|
-
|
|
117
|
-
<a href="https://github.com/kettle-dev"><img alt="kettle-dev Logo by Aboling0, CC BY-SA 4.0" src="https://logos.galtzo.com/assets/images/kettle-dev/avatar-128px.svg" width="14%" align="right"/></a>
|
|
118
|
-
|
|
119
|
-
The _amazing_ test matrix is powered by the kettle-dev stack.
|
|
120
|
-
|
|
121
|
-
<details markdown="1">
|
|
122
|
-
<summary>How kettle-dev manages complexity in tests</summary>
|
|
123
|
-
|
|
124
|
-
| Gem | Source | Role | Total downloads |
|
|
125
|
-
|-----|--------|------|---------------------|
|
|
126
|
-
| [appraisal2](https://clickgems.clickhouse.com/dashboard/appraisal2) | [GitHub](https://github.com/appraisal-rb/appraisal2) | multi-dependency Appraisal matrix generation | [](https://clickgems.clickhouse.com/dashboard/appraisal2) |
|
|
127
|
-
| [appraisal2-rubocop](https://clickgems.clickhouse.com/dashboard/appraisal2-rubocop) | [GitHub](https://github.com/appraisal-rb/appraisal2-rubocop) | RuboCop Appraisal generator integration | [](https://clickgems.clickhouse.com/dashboard/appraisal2-rubocop) |
|
|
128
|
-
| [kettle-jem](https://clickgems.clickhouse.com/dashboard/kettle-jem) | [GitHub](https://github.com/kettle-dev/kettle-jem) | Appraisals & CI workflow templates | [](https://clickgems.clickhouse.com/dashboard/kettle-jem) |
|
|
129
|
-
| [kettle-soup-cover](https://clickgems.clickhouse.com/dashboard/kettle-soup-cover) | [GitHub](https://github.com/kettle-dev/kettle-soup-cover) | SimpleCov coverage policy and reporting | [](https://clickgems.clickhouse.com/dashboard/kettle-soup-cover) |
|
|
130
|
-
| [kettle-test](https://clickgems.clickhouse.com/dashboard/kettle-test) | [GitHub](https://github.com/kettle-dev/kettle-test) | standard test runner and coverage harness | [](https://clickgems.clickhouse.com/dashboard/kettle-test) |
|
|
131
|
-
| [rubocop-lts](https://clickgems.clickhouse.com/dashboard/rubocop-lts) | [GitHub](https://github.com/rubocop-lts/rubocop-lts) | Ruby-version-aware linting | [](https://clickgems.clickhouse.com/dashboard/rubocop-lts) |
|
|
132
|
-
| [turbo_tests2](https://clickgems.clickhouse.com/dashboard/turbo_tests2) | [GitHub](https://github.com/galtzo-floss/turbo_tests2) | parallel test execution | [](https://clickgems.clickhouse.com/dashboard/turbo_tests2) |
|
|
133
|
-
|
|
134
|
-
</details>
|
|
135
|
-
|
|
136
|
-
### Federated DVCS
|
|
137
|
-
|
|
138
|
-
<details markdown="1">
|
|
139
|
-
<summary>Find this repo on federated forges (Coming soon!)</summary>
|
|
140
|
-
|
|
141
|
-
| Federated [DVCS][💎d-in-dvcs] Repository | Status | Issues | PRs | Wiki | CI |
|
|
142
|
-
|-------------------------------------------------|-------------------------------------------|-------------------|------------------|-----------------|----------------|
|
|
143
|
-
| 🧪 [kettle-dev/kettle-dev on GitLab][📜src-gl] | The Truth | [💚][🤝gl-issues] | [💚][🤝gl-pulls] | [💚][📜gl-wiki] | 🐭 Tiny Matrix |
|
|
144
|
-
| 🧊 [kettle-dev/kettle-dev on CodeBerg][📜src-cb] | An Ethical Mirror ([Donate][🤝cb-donate]) | [💚][🤝cb-issues] | [💚][🤝cb-pulls] | ➖ | ⭕️ No Matrix |
|
|
145
|
-
| 🐙 [kettle-dev/kettle-dev on GitHub][📜src-gh] | Another Mirror | [💚][🤝gh-issues] | [💚][🤝gh-pulls] | [💚][📜gh-wiki] | 💯 Full Matrix |
|
|
146
|
-
|
|
147
|
-
</details>
|
|
148
|
-
|
|
149
|
-
### Enterprise Support
|
|
150
|
-
|
|
151
|
-
For enterprise support from the maintainer, use [Upwork][👨🏼🏫expsup-upwork] or [CodeMentor][👨🏼🏫expsup-codementor].
|
|
152
|
-
|
|
153
|
-
Other support channels:
|
|
154
|
-
|
|
155
|
-
- [![Ruby Users Forum][✉️ruby-forum-img]][✉️ruby-forum]
|
|
156
|
-
- [![Live Chat on Discord][✉️discord-invite-img-ftb]][✉️discord-invite]
|
|
157
|
-
|
|
158
86
|
## ✨ Installation
|
|
159
87
|
|
|
160
88
|
Install the gem and add to the application's Gemfile by executing:
|
|
@@ -756,6 +684,89 @@ versions that are newer than the latest released version.
|
|
|
756
684
|
- The updater will look for `REPO` or `GITHUB_REPOSITORY` (both usually set by GitHub Actions) to infer `<YOUR_ORG>` for guidance.
|
|
757
685
|
- If `README_UPDATER_TOKEN` is missing, the tool prints a helpful error to STDERR and aborts, including a direct link to the expected org settings page.
|
|
758
686
|
|
|
687
|
+
## 🏢 Corporate Sponsorship
|
|
688
|
+
|
|
689
|
+
<!-- kettle-sponsors:cards:start -->
|
|
690
|
+
<a href="https://github.com"><picture><source media="(max-width: 600px)" srcset="https://logos.galtzo.com/assets/images/sponsors/phone/github.svg"><img src="https://logos.galtzo.com/assets/images/sponsors/github.svg" align="top" alt="Sponsor: GitHub - Copilot Max"></picture></a> <a href="https://healthsherpa.com"><picture><source media="(max-width: 600px)" srcset="https://logos.galtzo.com/assets/images/sponsors/phone/healthsherpa.svg"><img src="https://logos.galtzo.com/assets/images/sponsors/healthsherpa.svg" align="top" alt="Sponsor: HealthSherpa - GitHub Sponsors"></picture></a> <a href="https://opensource.microsoft.com"><picture><source media="(max-width: 600px)" srcset="https://logos.galtzo.com/assets/images/sponsors/phone/microsoft.svg"><img src="https://logos.galtzo.com/assets/images/sponsors/microsoft.svg" align="top" alt="Sponsor: Microsoft - Azure compute resources"></picture></a>
|
|
691
|
+
<!-- kettle-sponsors:cards:end -->
|
|
692
|
+
|
|
693
|
+
**If you're working in a company that's making significant use of kettle-dev tools we'd
|
|
694
|
+
appreciate it if you suggest to your company to become a kettle-dev sponsor.**
|
|
695
|
+
|
|
696
|
+
## 💡 Info you can shake a stick at
|
|
697
|
+
|
|
698
|
+
| Tokens to Remember | [![Gem name][⛳️name-img]][⛳️gem-name] [![Gem namespace][⛳️namespace-img]][⛳️gem-namespace] |
|
|
699
|
+
|-------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
700
|
+
| Works with JRuby | [![JRuby 10.0 Compat][💎jruby-10.0i]][🚎jruby-10.0-wf] [![JRuby current Compat][💎jruby-c-i]][🚎10-j-wf] [![JRuby HEAD Compat][💎jruby-headi]][🚎3-hd-wf]|
|
|
701
|
+
| Works with Truffle Ruby | [![Truffle Ruby 33.0 Compat][💎truby-33.0i]][🚎truby-33.0-wf] [![Truffle Ruby current Compat][💎truby-c-i]][🚎9-t-wf]|
|
|
702
|
+
| Works with MRI Ruby 4 | [![Ruby current Compat][💎ruby-c-i]][🚎11-c-wf] [![Ruby HEAD Compat][💎ruby-headi]][🚎3-hd-wf]|
|
|
703
|
+
| Works with MRI Ruby 3 | [![Ruby 3.0 Compat][💎ruby-3.0i]][🚎ruby-3.0-wf] [![Ruby 3.1 Compat][💎ruby-3.1i]][🚎ruby-3.1-wf] [![Ruby 3.2 Compat][💎ruby-3.2i]][🚎ruby-3.2-wf] [![Ruby 3.3 Compat][💎ruby-3.3i]][🚎ruby-3.3-wf] [![Ruby 3.4 Compat][💎ruby-3.4i]][🚎ruby-3.4-wf]|
|
|
704
|
+
| Works with MRI Ruby 2 | [![Ruby 2.4 Compat][💎ruby-2.4i]][🚎ruby-2.4-wf] [![Ruby 2.5 Compat][💎ruby-2.5i]][🚎ruby-2.5-wf] [![Ruby 2.6 Compat][💎ruby-2.6i]][🚎ruby-2.6-wf] [![Ruby 2.7 Compat][💎ruby-2.7i]][🚎ruby-2.7-wf]|
|
|
705
|
+
| Support & Community | [![Join Me on Daily.dev's RubyFriends][✉️ruby-friends-img]][✉️ruby-friends] [![Get help from RubyForum][✉️ruby-forum-img]][✉️ruby-forum] [![Live Chat on Discord][✉️discord-invite-img-ftb]][✉️discord-invite] [![Get help from me on Upwork][👨🏼🏫expsup-upwork-img]][👨🏼🏫expsup-upwork] [![Get help from me on Codementor][👨🏼🏫expsup-codementor-img]][👨🏼🏫expsup-codementor] |
|
|
706
|
+
| Source | [![Source on GitLab.com][📜src-gl-img]][📜src-gl] [![Source on CodeBerg.org][📜src-cb-img]][📜src-cb] [![Source on GitHub.com][📜src-gh-img]][📜src-gh] [![The best SHA: dQw4w9WgXcQ!][🧮kloc-img]][🧮kloc] |
|
|
707
|
+
| Documentation | [![Current release on RubyDoc.info][📜docs-cr-rd-img]][🚎yard-current] [![YARD on Galtzo.com][📜docs-head-rd-img]][🚎yard-head] [![Maintainer Blog][🚂maint-blog-img]][🚂maint-blog] [![GitLab Wiki][📜gl-wiki-img]][📜gl-wiki] [![GitHub Wiki][📜gh-wiki-img]][📜gh-wiki] |
|
|
708
|
+
| Compliance | [![License: AGPL-3.0-only][📄license-img]][📄license] [![Apache license compatibility: Category X][📄license-compat-img]][📄license-compat] [![📄ilo-declaration-img]][📄ilo-declaration] [![Security Policy][🔐security-img]][🔐security] [![Contributor Covenant 2.1][🪇conduct-img]][🪇conduct] [![SemVer 2.0.0][📌semver-img]][📌semver] |
|
|
709
|
+
| Style | [![Enforced Code Style Linter][💎rlts-img]][💎rlts] [![Keep-A-Changelog 1.0.0][📗keep-changelog-img]][📗keep-changelog] [![Gitmoji Commits][📌gitmoji-img]][📌gitmoji] [![Compatibility appraised by: appraisal2][💎appraisal2-img]][💎appraisal2] |
|
|
710
|
+
| Maintainer 🎖️ | [![Follow Me on LinkedIn][💖🖇linkedin-img]][💖🖇linkedin] [![Follow Me on Ruby.Social][💖🐘ruby-mast-img]][💖🐘ruby-mast] [![Follow Me on Bluesky][💖🦋bluesky-img]][💖🦋bluesky] [![Contact Maintainer][🚂maint-contact-img]][🚂maint-contact] [![My technical writing][💖💁🏼♂️devto-img]][💖💁🏼♂️devto] |
|
|
711
|
+
| `...` 💖 | [![Find Me on WellFound:][💖✌️wellfound-img]][💖✌️wellfound] [![Find Me on CrunchBase][💖💲crunchbase-img]][💖💲crunchbase] [![My LinkTree][💖🌳linktree-img]][💖🌳linktree] [![More About Me][💖💁🏼♂️aboutme-img]][💖💁🏼♂️aboutme] [🧊][💖🧊berg] [🐙][💖🐙hub] [🛖][💖🛖hut] [🧪][💖🧪lab] |
|
|
712
|
+
|
|
713
|
+
### Compatibility
|
|
714
|
+
|
|
715
|
+
The gem's declared runtime compatibility floor is MRI Ruby 2.4.0+, with concordant releases of JRuby and TruffleRuby.
|
|
716
|
+
CI workflows and Appraisals are generated for MRI Ruby 2.4+.
|
|
717
|
+
The current MRI CI lane runs on Linux and macOS.
|
|
718
|
+
The test floor is configured by `ruby.test_minimum` in `.structuredmerge/kettle-jem.yml`.
|
|
719
|
+
When it is higher than the runtime floor, older runtime-compatible Rubies are
|
|
720
|
+
not covered by the generated CI or Appraisal matrix.
|
|
721
|
+
|
|
722
|
+
<a href="https://github.com/kettle-dev"><img alt="kettle-dev Logo by Aboling0, CC BY-SA 4.0" src="https://logos.galtzo.com/assets/images/kettle-dev/avatar-128px.svg" width="14%" align="right"/></a>
|
|
723
|
+
|
|
724
|
+
The _amazing_ test matrix is powered by the kettle-dev stack.
|
|
725
|
+
|
|
726
|
+
<details markdown="1">
|
|
727
|
+
<summary>How kettle-dev manages complexity in tests</summary>
|
|
728
|
+
|
|
729
|
+
| Gem | Source | Role | Total downloads |
|
|
730
|
+
|-----|--------|------|---------------------|
|
|
731
|
+
| [appraisal2](https://clickgems.clickhouse.com/dashboard/appraisal2) | [GitHub](https://github.com/appraisal-rb/appraisal2) | multi-dependency Appraisal matrix generation | [](https://clickgems.clickhouse.com/dashboard/appraisal2) |
|
|
732
|
+
| [appraisal2-rubocop](https://clickgems.clickhouse.com/dashboard/appraisal2-rubocop) | [GitHub](https://github.com/appraisal-rb/appraisal2-rubocop) | RuboCop Appraisal generator integration | [](https://clickgems.clickhouse.com/dashboard/appraisal2-rubocop) |
|
|
733
|
+
| [kettle-jem](https://clickgems.clickhouse.com/dashboard/kettle-jem) | [GitHub](https://github.com/kettle-dev/kettle-jem) | Appraisals & CI workflow templates | [](https://clickgems.clickhouse.com/dashboard/kettle-jem) |
|
|
734
|
+
| [kettle-soup-cover](https://clickgems.clickhouse.com/dashboard/kettle-soup-cover) | [GitHub](https://github.com/kettle-dev/kettle-soup-cover) | SimpleCov coverage policy and reporting | [](https://clickgems.clickhouse.com/dashboard/kettle-soup-cover) |
|
|
735
|
+
| [kettle-test](https://clickgems.clickhouse.com/dashboard/kettle-test) | [GitHub](https://github.com/kettle-dev/kettle-test) | standard test runner and coverage harness | [](https://clickgems.clickhouse.com/dashboard/kettle-test) |
|
|
736
|
+
| [rubocop-lts](https://clickgems.clickhouse.com/dashboard/rubocop-lts) | [GitHub](https://github.com/rubocop-lts/rubocop-lts) | Ruby-version-aware linting | [](https://clickgems.clickhouse.com/dashboard/rubocop-lts) |
|
|
737
|
+
| [turbo_tests2](https://clickgems.clickhouse.com/dashboard/turbo_tests2) | [GitHub](https://github.com/galtzo-floss/turbo_tests2) | parallel test execution | [](https://clickgems.clickhouse.com/dashboard/turbo_tests2) |
|
|
738
|
+
|
|
739
|
+
</details>
|
|
740
|
+
|
|
741
|
+
### Federated DVCS
|
|
742
|
+
|
|
743
|
+
<details markdown="1">
|
|
744
|
+
<summary>Find this repo on federated forges (Coming soon!)</summary>
|
|
745
|
+
|
|
746
|
+
| Federated [DVCS][💎d-in-dvcs] Repository | Status | Issues | PRs | Wiki | CI |
|
|
747
|
+
|-------------------------------------------------|-------------------------------------------|-------------------|------------------|-----------------|----------------|
|
|
748
|
+
| 🧪 [kettle-dev/kettle-dev on GitLab][📜src-gl] | The Truth | [💚][🤝gl-issues] | [💚][🤝gl-pulls] | [💚][📜gl-wiki] | 🐭 Tiny Matrix |
|
|
749
|
+
| 🧊 [kettle-dev/kettle-dev on CodeBerg][📜src-cb] | An Ethical Mirror ([Donate][🤝cb-donate]) | [💚][🤝cb-issues] | [💚][🤝cb-pulls] | ➖ | ⭕️ No Matrix |
|
|
750
|
+
| 🐙 [kettle-dev/kettle-dev on GitHub][📜src-gh] | Another Mirror | [💚][🤝gh-issues] | [💚][🤝gh-pulls] | [💚][📜gh-wiki] | 💯 Full Matrix |
|
|
751
|
+
|
|
752
|
+
</details>
|
|
753
|
+
|
|
754
|
+
<details markdown="1">
|
|
755
|
+
<summary>👣 How will this project approach the September 2025 hostile takeover of RubyGems? 🚑️</summary>
|
|
756
|
+
|
|
757
|
+
I've summarized my thoughts in [this blog post](https://dev.to/galtzo/hostile-takeover-of-rubygems-my-thoughts-5hlo).
|
|
758
|
+
|
|
759
|
+
</details>
|
|
760
|
+
|
|
761
|
+
### Enterprise Support
|
|
762
|
+
|
|
763
|
+
For enterprise support from the maintainer, use [Upwork][👨🏼🏫expsup-upwork] or [CodeMentor][👨🏼🏫expsup-codementor].
|
|
764
|
+
|
|
765
|
+
Other support channels:
|
|
766
|
+
|
|
767
|
+
- [![Ruby Users Forum][✉️ruby-forum-img]][✉️ruby-forum]
|
|
768
|
+
- [![Live Chat on Discord][✉️discord-invite-img-ftb]][✉️discord-invite]
|
|
769
|
+
|
|
759
770
|
## 🔐 Security
|
|
760
771
|
|
|
761
772
|
See [SECURITY.md][🔐security].
|
|
@@ -843,27 +854,18 @@ See [LICENSE.md][📄license] for the official copyright notice.
|
|
|
843
854
|
|
|
844
855
|
</details>
|
|
845
856
|
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
Maintainers have teeth and need to pay their dentists.
|
|
849
|
-
After getting laid off in an RIF in March, and encountering difficulty finding a new one,
|
|
850
|
-
I began spending most of my time building open source tools.
|
|
851
|
-
I'm hoping to be able to pay for my kids' health insurance this month,
|
|
852
|
-
so if you value the work I am doing, I need your support.
|
|
853
|
-
Please consider sponsoring me or the project.
|
|
854
|
-
|
|
855
|
-
To join the community or get help, use the RubyForum or Discord.
|
|
857
|
+
### Please give the project a star ⭐ ♥.
|
|
856
858
|
|
|
857
|
-
|
|
858
|
-
[![Live Chat on Discord][✉️discord-invite-img-ftb]][✉️discord-invite]
|
|
859
|
+
Many parts of this project are actively managed by a [kettle-jem](https://github.com/structuredmerge/structuredmerge-ruby/tree/main/gems/kettle-jem) smart template utilizing [StructuredMerge.org](https://structuredmerge.org) merge contracts.
|
|
859
860
|
|
|
860
|
-
|
|
861
|
+
If this project helps you, please consider supporting the maintainer. This is not gated on the project's license; it appears in every README:
|
|
861
862
|
|
|
862
|
-
[![Sponsor kettle-dev/kettle-dev on Open Source Collective][🖇osc-all-bottom-img]][🖇osc] 💌 [![Sponsor me on GitHub Sponsors][🖇sponsor-bottom-img]][🖇sponsor] 💌 [![Sponsor me on Liberapay][⛳liberapay-bottom-img]][⛳liberapay] 💌 [![Donate on PayPal][🖇paypal-bottom-img]][🖇paypal]
|
|
863
|
+
[![Sponsor kettle-dev/kettle-dev on Open Source Collective][🖇osc-all-bottom-img]][🖇osc] 💌 [![Sponsor me on GitHub Sponsors][🖇sponsor-bottom-img]][🖇sponsor] 💌 [![Sponsor me on Liberapay][⛳liberapay-bottom-img]][⛳liberapay] 💌 [![Donate on PayPal][🖇paypal-bottom-img]][🖇paypal] 💌 [![Buy me a coffee][🖇buyme-small-img]][🖇buyme] 💌 [![Donate at ko-fi.com][🖇kofi-img]][🖇kofi]
|
|
863
864
|
|
|
864
|
-
|
|
865
|
+
I use [Cloudroom][🖇cloudroom], an agentic AI coding environment, every day. It's the first AI product that made me say "shut up and take my money."
|
|
866
|
+
If you sign up with [my referral link][🖇cloudroom], I receive a share of your subscription for as long as you stay subscribed, at no extra cost to you.
|
|
865
867
|
|
|
866
|
-
|
|
868
|
+
[🖇cloudroom]: https://go.cloudroom.dev/u9f53f181a
|
|
867
869
|
|
|
868
870
|
Thanks for RTFM. ☺️
|
|
869
871
|
|
|
@@ -1034,7 +1036,7 @@ Thanks for RTFM. ☺️
|
|
|
1034
1036
|
[📌gitmoji]: https://gitmoji.dev
|
|
1035
1037
|
[📌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
1038
|
[🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
|
|
1037
|
-
[🧮kloc-img]: https://img.shields.io/badge/KLOC-
|
|
1039
|
+
[🧮kloc-img]: https://img.shields.io/badge/KLOC-7.194-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
|
|
1038
1040
|
[🔐security]: https://github.com/kettle-dev/kettle-dev/blob/main/SECURITY.md
|
|
1039
1041
|
[🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
|
|
1040
1042
|
[📄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)
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "fileutils"
|
|
4
|
+
require "json"
|
|
5
|
+
|
|
6
|
+
require_relative "registry_availability"
|
|
7
|
+
|
|
8
|
+
module Kettle
|
|
9
|
+
module Dev
|
|
10
|
+
# File-based channel between kettle-release children (clients) and ONE
|
|
11
|
+
# central poll dispatcher (server) owned by the family process.
|
|
12
|
+
#
|
|
13
|
+
# Each release member is its own process, so a shared poller needs IPC.
|
|
14
|
+
# A directory of small files is enough and needs no sockets or ports:
|
|
15
|
+
#
|
|
16
|
+
# <dir>/<gem>-<version>.req child -> dispatcher: please watch this
|
|
17
|
+
# <dir>/<gem>-<version>.ack dispatcher -> child: claimed, will answer
|
|
18
|
+
# <dir>/<gem>-<version>.res dispatcher -> child: final outcome (JSON)
|
|
19
|
+
#
|
|
20
|
+
# The child only ever sleeps and stats one local file. All registry traffic
|
|
21
|
+
# comes from the dispatcher's single schedule. If no dispatcher answers
|
|
22
|
+
# (standalone `kettle-release`, dispatcher died) the client returns nil and
|
|
23
|
+
# the caller polls locally, so the channel is strictly an optimization.
|
|
24
|
+
module ProbeDispatch
|
|
25
|
+
ENV_DIR = "KETTLE_RELEASE_PROBE_DISPATCH_DIR"
|
|
26
|
+
ACK_TIMEOUT_SECONDS = 10
|
|
27
|
+
RESULT_GRACE_SECONDS = 60
|
|
28
|
+
TICK_SECONDS = 0.25
|
|
29
|
+
|
|
30
|
+
module_function
|
|
31
|
+
|
|
32
|
+
def dir_from_env(env = ENV)
|
|
33
|
+
value = env.fetch(ENV_DIR, "").to_s
|
|
34
|
+
value.empty? ? nil : value
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def path(dir, key, ext)
|
|
38
|
+
File.join(dir, "#{key.to_s.gsub(/[^A-Za-z0-9_.-]+/, "_")}.#{ext}")
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def write_atomic(file, payload)
|
|
42
|
+
tmp = "#{file}.#{$$}.tmp"
|
|
43
|
+
File.write(tmp, JSON.generate(payload))
|
|
44
|
+
File.rename(tmp, file)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Client side. Returns {"outcome" => "ok"|"upstream_only"|"failed", ...}
|
|
48
|
+
# or nil when no dispatcher is serving (caller must poll locally).
|
|
49
|
+
module Client
|
|
50
|
+
module_function
|
|
51
|
+
|
|
52
|
+
def await(dir:, gem_name:, version:, result_timeout:, sleeper: Kernel.method(:sleep), clock: -> { Process.clock_gettime(Process::CLOCK_MONOTONIC) })
|
|
53
|
+
key = "#{gem_name}-#{version}"
|
|
54
|
+
req = ProbeDispatch.path(dir, key, "req")
|
|
55
|
+
ack = ProbeDispatch.path(dir, key, "ack")
|
|
56
|
+
res = ProbeDispatch.path(dir, key, "res")
|
|
57
|
+
FileUtils.mkdir_p(dir)
|
|
58
|
+
[ack, res].each { |stale| FileUtils.rm_f(stale) }
|
|
59
|
+
ProbeDispatch.write_atomic(req, {"gem" => gem_name.to_s, "version" => version.to_s, "pid" => $$})
|
|
60
|
+
|
|
61
|
+
started = clock.call
|
|
62
|
+
until File.exist?(ack) || File.exist?(res)
|
|
63
|
+
if clock.call - started > ACK_TIMEOUT_SECONDS
|
|
64
|
+
FileUtils.rm_f(req)
|
|
65
|
+
return nil
|
|
66
|
+
end
|
|
67
|
+
sleeper.call(TICK_SECONDS)
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
deadline = clock.call + result_timeout + RESULT_GRACE_SECONDS
|
|
71
|
+
until File.exist?(res)
|
|
72
|
+
return nil if clock.call > deadline
|
|
73
|
+
|
|
74
|
+
sleeper.call(TICK_SECONDS)
|
|
75
|
+
end
|
|
76
|
+
JSON.parse(File.read(res))
|
|
77
|
+
rescue JSON::ParserError, SystemCallError
|
|
78
|
+
nil
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Server side: one thread, one Poller, every member's watch.
|
|
83
|
+
class Server
|
|
84
|
+
attr_reader :poller
|
|
85
|
+
|
|
86
|
+
def initialize(dir:, poller:, tick: TICK_SECONDS)
|
|
87
|
+
@dir = dir
|
|
88
|
+
@poller = poller
|
|
89
|
+
@tick = tick
|
|
90
|
+
@mutex = Mutex.new
|
|
91
|
+
@stop = false
|
|
92
|
+
@thread = nil
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def start
|
|
96
|
+
FileUtils.mkdir_p(@dir)
|
|
97
|
+
@thread = Thread.new { run } # rubocop:disable ThreadSafety/NewThread -- the single central poll dispatcher.
|
|
98
|
+
self
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
def stop
|
|
102
|
+
@mutex.synchronize { @stop = true }
|
|
103
|
+
@thread&.join(5)
|
|
104
|
+
@thread = nil
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# One scan + one poll pass. Public so it can be driven synchronously.
|
|
108
|
+
def tick
|
|
109
|
+
claim_requests
|
|
110
|
+
@poller.poll_once.each { |watch| answer(watch) }
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
private
|
|
114
|
+
|
|
115
|
+
def run
|
|
116
|
+
until @mutex.synchronize { @stop }
|
|
117
|
+
tick
|
|
118
|
+
sleep(@tick)
|
|
119
|
+
end
|
|
120
|
+
rescue => error
|
|
121
|
+
warn("[kettle-family] probe dispatcher stopped: #{error.class}: #{error.message}")
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
def claim_requests
|
|
125
|
+
Dir.glob(File.join(@dir, "*.req")).sort.each do |req|
|
|
126
|
+
begin
|
|
127
|
+
data = JSON.parse(File.read(req))
|
|
128
|
+
FileUtils.rm_f(req)
|
|
129
|
+
watch = @poller.add(data.fetch("gem"), data.fetch("version"))
|
|
130
|
+
ProbeDispatch.write_atomic(ProbeDispatch.path(@dir, watch.key, "ack"), {"claimed" => true})
|
|
131
|
+
rescue JSON::ParserError, KeyError, SystemCallError
|
|
132
|
+
FileUtils.rm_f(req)
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
def answer(watch)
|
|
138
|
+
ProbeDispatch.write_atomic(
|
|
139
|
+
ProbeDispatch.path(@dir, watch.key, "res"),
|
|
140
|
+
{"outcome" => watch.outcome.to_s, "attempts" => watch.attempts, "upstream_confirmed" => watch.upstream_confirmed}
|
|
141
|
+
)
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
end
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "net/http"
|
|
4
|
+
require "openssl"
|
|
5
|
+
require "timeout"
|
|
6
|
+
require "uri"
|
|
7
|
+
|
|
8
|
+
module Kettle
|
|
9
|
+
module Dev
|
|
10
|
+
# Cheap "can a consumer resolve this exact gem version from this registry"
|
|
11
|
+
# checks, plus the single poller implementation shared by kettle-release
|
|
12
|
+
# (one watch, local) and the family poll dispatcher (many watches).
|
|
13
|
+
#
|
|
14
|
+
# The old probe ran `bundler/inline` in a fresh GEM_HOME on every attempt,
|
|
15
|
+
# i.e. a full resolve + download + install of the gem and its whole
|
|
16
|
+
# dependency tree, per member, per attempt, all members at once. The
|
|
17
|
+
# question being asked is only "has the registry published this version",
|
|
18
|
+
# which Bundler itself answers from the compact index. So ask exactly that,
|
|
19
|
+
# with two small HTTP requests, instead of reproducing a consumer install.
|
|
20
|
+
module RegistryAvailability
|
|
21
|
+
OPEN_TIMEOUT_SECONDS = 5
|
|
22
|
+
READ_TIMEOUT_SECONDS = 10
|
|
23
|
+
|
|
24
|
+
# Outcome of one registry question. +nil+ means "could not tell" and is
|
|
25
|
+
# never read as "absent".
|
|
26
|
+
module Checker
|
|
27
|
+
module_function
|
|
28
|
+
|
|
29
|
+
# True when the compact index lists +version+ for +gem_name+ AND the
|
|
30
|
+
# .gem artifact is reachable. The index is what Bundler resolves from;
|
|
31
|
+
# the artifact is what it then downloads, and a mirror can serve one
|
|
32
|
+
# before the other.
|
|
33
|
+
def visible?(gem_name, version, source:)
|
|
34
|
+
return false unless index_lists_version?(gem_name, version, source: source)
|
|
35
|
+
|
|
36
|
+
artifact_reachable?(gem_name, version, source: source)
|
|
37
|
+
rescue SystemCallError, Timeout::Error, IOError, SocketError, OpenSSL::SSL::SSLError
|
|
38
|
+
nil
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# The index alone, for the push-target registry: it only has to answer
|
|
42
|
+
# "did the push land", not "can a consumer download it yet".
|
|
43
|
+
def published?(gem_name, version, source:)
|
|
44
|
+
index_lists_version?(gem_name, version, source: source)
|
|
45
|
+
rescue SystemCallError, Timeout::Error, IOError, SocketError, OpenSSL::SSL::SSLError
|
|
46
|
+
nil
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def index_lists_version?(gem_name, version, source:)
|
|
50
|
+
response = get(URI("#{source.to_s.sub(%r{/+\z}, "")}/info/#{gem_name}"), head: false)
|
|
51
|
+
return false unless response.is_a?(Net::HTTPSuccess)
|
|
52
|
+
|
|
53
|
+
# Compact index: "<version>[-<platform>] <deps>|checksum:..." per line.
|
|
54
|
+
response.body.to_s.each_line.any? do |line|
|
|
55
|
+
token = line.split(" ", 2).first.to_s
|
|
56
|
+
token == version.to_s || token.start_with?("#{version}-")
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def artifact_reachable?(gem_name, version, source:)
|
|
61
|
+
response = get(URI("#{source.to_s.sub(%r{/+\z}, "")}/gems/#{gem_name}-#{version}.gem"), head: true)
|
|
62
|
+
response.is_a?(Net::HTTPSuccess) || response.is_a?(Net::HTTPRedirection)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def get(uri, head:)
|
|
66
|
+
request = (head ? Net::HTTP::Head : Net::HTTP::Get).new(uri)
|
|
67
|
+
# A stale proxy answer here would defeat the entire purpose.
|
|
68
|
+
request["Cache-Control"] = "no-cache"
|
|
69
|
+
request["Pragma"] = "no-cache"
|
|
70
|
+
Net::HTTP.start(
|
|
71
|
+
uri.host,
|
|
72
|
+
uri.port,
|
|
73
|
+
use_ssl: uri.scheme == "https",
|
|
74
|
+
open_timeout: OPEN_TIMEOUT_SECONDS,
|
|
75
|
+
read_timeout: READ_TIMEOUT_SECONDS
|
|
76
|
+
) { |http| http.request(request) }
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# One gem+version being waited on.
|
|
81
|
+
Watch = Struct.new(:gem_name, :version, :started_at, :attempts, :next_at, :upstream_confirmed, :outcome, :reason) do
|
|
82
|
+
def key
|
|
83
|
+
"#{gem_name}-#{version}"
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
def resolved?
|
|
87
|
+
!outcome.nil?
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Polls any number of watches from one place, on one shared schedule.
|
|
92
|
+
#
|
|
93
|
+
# Outcomes: :ok (mirror serves it), :upstream_only (timed out, but the
|
|
94
|
+
# push target serves it: the push is authoritative, mirror just lags),
|
|
95
|
+
# :failed (neither registry serves it by the deadline).
|
|
96
|
+
class Poller
|
|
97
|
+
DEFAULT_TIMEOUT_SECONDS = 20 * 60
|
|
98
|
+
DEFAULT_BASE_INTERVAL_SECONDS = 3
|
|
99
|
+
DEFAULT_MAX_INTERVAL_SECONDS = 30
|
|
100
|
+
|
|
101
|
+
attr_reader :source, :upstream, :timeout
|
|
102
|
+
|
|
103
|
+
def initialize(source:, upstream:, timeout: DEFAULT_TIMEOUT_SECONDS, base_interval: DEFAULT_BASE_INTERVAL_SECONDS,
|
|
104
|
+
max_interval: DEFAULT_MAX_INTERVAL_SECONDS, checker: Checker, clock: -> { Process.clock_gettime(Process::CLOCK_MONOTONIC) })
|
|
105
|
+
@source = source
|
|
106
|
+
@upstream = upstream
|
|
107
|
+
@timeout = timeout
|
|
108
|
+
@base_interval = base_interval
|
|
109
|
+
@max_interval = max_interval
|
|
110
|
+
@checker = checker
|
|
111
|
+
@clock = clock
|
|
112
|
+
@watches = {}
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
def add(gem_name, version)
|
|
116
|
+
key = "#{gem_name}-#{version}"
|
|
117
|
+
@watches[key] ||= Watch.new(gem_name.to_s, version.to_s, now, 0, now, false, nil, nil)
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
def watch(gem_name, version)
|
|
121
|
+
@watches["#{gem_name}-#{version}"]
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
def pending
|
|
125
|
+
@watches.values.reject(&:resolved?)
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
def pending?
|
|
129
|
+
!pending.empty?
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# Seconds until the next watch is due (0 when one is due now), or nil
|
|
133
|
+
# when nothing is pending.
|
|
134
|
+
def seconds_until_due
|
|
135
|
+
due = pending.map(&:next_at).min
|
|
136
|
+
return nil unless due
|
|
137
|
+
|
|
138
|
+
[due - now, 0].max
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Checks every due watch once. Returns the watches that resolved in
|
|
142
|
+
# this pass.
|
|
143
|
+
def poll_once
|
|
144
|
+
resolved = []
|
|
145
|
+
pending.each do |watch|
|
|
146
|
+
next if watch.next_at > now
|
|
147
|
+
|
|
148
|
+
watch.attempts += 1
|
|
149
|
+
if @checker.visible?(watch.gem_name, watch.version, source: @source) == true
|
|
150
|
+
watch.outcome = :ok
|
|
151
|
+
else
|
|
152
|
+
watch.upstream_confirmed ||= (@checker.published?(watch.gem_name, watch.version, source: @upstream) == true)
|
|
153
|
+
if now - watch.started_at >= @timeout
|
|
154
|
+
watch.outcome = watch.upstream_confirmed ? :upstream_only : :failed
|
|
155
|
+
else
|
|
156
|
+
watch.next_at = now + interval(watch.attempts)
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
resolved << watch if watch.resolved?
|
|
160
|
+
end
|
|
161
|
+
resolved
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Grows 1.4x per attempt from the base, capped. A fast mirror passes on
|
|
165
|
+
# attempt 1; a slow one is polled gently, not hammered.
|
|
166
|
+
def interval(attempt)
|
|
167
|
+
[(@base_interval * (1.4**(attempt - 1))).round, @max_interval].min
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
private
|
|
171
|
+
|
|
172
|
+
def now
|
|
173
|
+
@clock.call
|
|
174
|
+
end
|
|
175
|
+
end
|
|
176
|
+
end
|
|
177
|
+
end
|
|
178
|
+
end
|
|
@@ -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
|
|
@@ -2339,7 +2341,89 @@ module Kettle
|
|
|
2339
2341
|
MSG
|
|
2340
2342
|
end
|
|
2341
2343
|
|
|
2344
|
+
# Default "index" mode asks the registry whether the version is
|
|
2345
|
+
# published (compact index + artifact reachability: two small HTTP
|
|
2346
|
+
# requests), via the family's central dispatcher when one is serving and
|
|
2347
|
+
# a local poller otherwise. "install" mode is the legacy probe that
|
|
2348
|
+
# resolves and installs the gem plus its dependency tree into a throwaway
|
|
2349
|
+
# GEM_HOME on every attempt; it is far heavier and kept only as an
|
|
2350
|
+
# explicit fallback (KETTLE_DEV_RELEASE_PROBE_MODE=install).
|
|
2342
2351
|
def run_release_availability_probe(candidate)
|
|
2352
|
+
return run_install_availability_probe(candidate) if release_probe_mode == "install"
|
|
2353
|
+
|
|
2354
|
+
run_index_availability_probe(candidate)
|
|
2355
|
+
end
|
|
2356
|
+
|
|
2357
|
+
def release_probe_mode
|
|
2358
|
+
ENV.fetch("KETTLE_DEV_RELEASE_PROBE_MODE", "index").to_s.strip.downcase
|
|
2359
|
+
end
|
|
2360
|
+
|
|
2361
|
+
def release_probe_timeout_seconds
|
|
2362
|
+
env_positive_integer("KETTLE_DEV_RELEASE_PROBE_TIMEOUT") || Kettle::Dev::RegistryAvailability::Poller::DEFAULT_TIMEOUT_SECONDS
|
|
2363
|
+
end
|
|
2364
|
+
|
|
2365
|
+
def run_index_availability_probe(candidate)
|
|
2366
|
+
timeout = release_probe_timeout_seconds
|
|
2367
|
+
emit_release_probe_event(action: "availability", status: "started", candidate: candidate, attempt: 1, attempts: nil)
|
|
2368
|
+
puts("Validating #{candidate.gem_name} #{candidate.version} from #{RELEASE_VALIDATION_SOURCE} (registry index)")
|
|
2369
|
+
dispatch_dir = Kettle::Dev::ProbeDispatch.dir_from_env
|
|
2370
|
+
outcome = if dispatch_dir
|
|
2371
|
+
answer = Kettle::Dev::ProbeDispatch::Client.await(
|
|
2372
|
+
dir: dispatch_dir, gem_name: candidate.gem_name, version: candidate.version, result_timeout: timeout
|
|
2373
|
+
)
|
|
2374
|
+
answer && {outcome: answer.fetch("outcome").to_sym, attempts: answer["attempts"].to_i, upstream: answer["upstream_confirmed"]}
|
|
2375
|
+
end
|
|
2376
|
+
outcome ||= poll_registry_locally(candidate, timeout)
|
|
2377
|
+
finish_index_availability_probe(candidate, outcome)
|
|
2378
|
+
end
|
|
2379
|
+
|
|
2380
|
+
def poll_registry_locally(candidate, timeout)
|
|
2381
|
+
poller = Kettle::Dev::RegistryAvailability::Poller.new(
|
|
2382
|
+
source: RELEASE_VALIDATION_SOURCE, upstream: RELEASE_UPSTREAM_SOURCE, timeout: timeout
|
|
2383
|
+
)
|
|
2384
|
+
watch = poller.add(candidate.gem_name, candidate.version)
|
|
2385
|
+
loop do
|
|
2386
|
+
poller.poll_once
|
|
2387
|
+
break if watch.resolved?
|
|
2388
|
+
|
|
2389
|
+
if watch.attempts == 1 || (watch.attempts % 5).zero?
|
|
2390
|
+
emit_release_probe_event(
|
|
2391
|
+
action: "availability", status: "retrying", candidate: candidate, attempt: watch.attempts, attempts: nil,
|
|
2392
|
+
reason: "not yet on #{RELEASE_VALIDATION_SOURCE}", upstream: watch.upstream_confirmed ? "confirmed" : "unconfirmed"
|
|
2393
|
+
)
|
|
2394
|
+
end
|
|
2395
|
+
sleep(poller.seconds_until_due.to_f)
|
|
2396
|
+
end
|
|
2397
|
+
{outcome: watch.outcome, attempts: watch.attempts, upstream: watch.upstream_confirmed}
|
|
2398
|
+
end
|
|
2399
|
+
|
|
2400
|
+
def finish_index_availability_probe(candidate, outcome)
|
|
2401
|
+
attempts = outcome.fetch(:attempts)
|
|
2402
|
+
upstream = outcome[:upstream] ? "confirmed" : "unconfirmed"
|
|
2403
|
+
case outcome.fetch(:outcome)
|
|
2404
|
+
when :ok
|
|
2405
|
+
emit_release_probe_event(action: "availability", status: "ok", candidate: candidate, attempt: attempts, attempts: nil, upstream: upstream)
|
|
2406
|
+
puts("Validated #{candidate.gem_name} #{candidate.version} from #{RELEASE_VALIDATION_SOURCE}")
|
|
2407
|
+
true
|
|
2408
|
+
when :upstream_only
|
|
2409
|
+
warn(<<~MSG)
|
|
2410
|
+
WARNING: #{candidate.gem_name} #{candidate.version} is published on #{RELEASE_UPSTREAM_SOURCE}, but #{RELEASE_VALIDATION_SOURCE} has not synced it after #{attempts} check(s).
|
|
2411
|
+
Proceeding because the push target is authoritative for the publish; downstream release steps resolve from #{RELEASE_VALIDATION_SOURCE} and retry on their own.
|
|
2412
|
+
If a later step fails to resolve this gem, wait for #{RELEASE_VALIDATION_SOURCE} to sync and resume that member.
|
|
2413
|
+
MSG
|
|
2414
|
+
emit_release_probe_event(
|
|
2415
|
+
action: "availability", status: "ok", candidate: candidate, attempt: attempts, attempts: nil,
|
|
2416
|
+
reason: "confirmed on #{RELEASE_UPSTREAM_SOURCE}; #{RELEASE_VALIDATION_SOURCE} sync pending", upstream: "confirmed"
|
|
2417
|
+
)
|
|
2418
|
+
true
|
|
2419
|
+
else
|
|
2420
|
+
emit_release_probe_event(action: "availability", status: "failed", candidate: candidate, attempt: attempts, attempts: nil, upstream: upstream)
|
|
2421
|
+
abort("Published gem availability probe failed for #{candidate.gem_name} #{candidate.version} after #{attempts} check(s); " \
|
|
2422
|
+
"the version is not visible on #{RELEASE_UPSTREAM_SOURCE} either, so the push itself may have failed")
|
|
2423
|
+
end
|
|
2424
|
+
end
|
|
2425
|
+
|
|
2426
|
+
def run_install_availability_probe(candidate)
|
|
2343
2427
|
script_path = write_release_availability_probe(candidate)
|
|
2344
2428
|
attempts = release_availability_probe_attempts
|
|
2345
2429
|
last_stderr = nil
|
|
@@ -3276,6 +3360,30 @@ module Kettle
|
|
|
3276
3360
|
puts "Merged #{feature} into #{trunk} and pushed. The PR (if any) should auto-close."
|
|
3277
3361
|
end
|
|
3278
3362
|
|
|
3363
|
+
# Release prep (changelog, README, docs, lockfiles) is committed at step 6,
|
|
3364
|
+
# but the trunk is only synced at step 8. Upstream changes to those files
|
|
3365
|
+
# then conflict with the prep commit mid-rebase. Sync the checkout to its
|
|
3366
|
+
# upstream up front, while it is still clean, so step 8 has nothing to do.
|
|
3367
|
+
#
|
|
3368
|
+
# Skipped when resuming past the first steps (the prep commit may already
|
|
3369
|
+
# exist), for local CI releases, for branch-stack release branches (they
|
|
3370
|
+
# sync their own lanes), and when nested inside an outer command that
|
|
3371
|
+
# already synced (Kettle::Dev::Rebase honors KETTLE_REBASE_NESTED).
|
|
3372
|
+
def sync_upstream_before_release_prep!
|
|
3373
|
+
return if @start_step > 1 || local_ci?
|
|
3374
|
+
return if local_kettle_family_release_target_branches.include?(current_branch)
|
|
3375
|
+
|
|
3376
|
+
result = Kettle::Dev::Rebase.call(root: @root)
|
|
3377
|
+
return if result.status == :skipped_nested
|
|
3378
|
+
|
|
3379
|
+
puts "Upstream sync: #{result.message}"
|
|
3380
|
+
return if result.ok?
|
|
3381
|
+
|
|
3382
|
+
abort("Aborting before release prep: #{result.message}") if result.status == :conflict
|
|
3383
|
+
|
|
3384
|
+
warn("Upstream sync failed (#{result.message}); continuing with local state.")
|
|
3385
|
+
end
|
|
3386
|
+
|
|
3279
3387
|
def branch_stack_release_branch?(branch, trunk = nil)
|
|
3280
3388
|
return false if branch.to_s.empty?
|
|
3281
3389
|
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.37"
|
|
9
9
|
end
|
|
10
10
|
# Current gem version exposed at the traditional constant location.
|
|
11
11
|
VERSION = Version::VERSION # Traditional Constant Location
|
data/lib/kettle/dev.rb
CHANGED
|
@@ -37,6 +37,8 @@ module Kettle
|
|
|
37
37
|
autoload :DvcsCLI, "kettle/dev/dvcs_cli"
|
|
38
38
|
autoload :ExitAdapter, "kettle/dev/exit_adapter"
|
|
39
39
|
autoload :RubyGemsVersions, "kettle/dev/ruby_gems_versions"
|
|
40
|
+
autoload :RegistryAvailability, "kettle/dev/registry_availability"
|
|
41
|
+
autoload :ProbeDispatch, "kettle/dev/probe_dispatch"
|
|
40
42
|
autoload :GemSpecReader, "kettle/dev/gem_spec_reader"
|
|
41
43
|
autoload :GemSourceProbe, "kettle/dev/gem_source_probe"
|
|
42
44
|
autoload :GitAdapter, "kettle/dev/git_adapter"
|
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.37
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Peter H. Boling
|
|
@@ -445,6 +445,7 @@ files:
|
|
|
445
445
|
- lib/kettle/dev/open_collective_config.rb
|
|
446
446
|
- lib/kettle/dev/paths.rb
|
|
447
447
|
- lib/kettle/dev/pre_release_cli.rb
|
|
448
|
+
- lib/kettle/dev/probe_dispatch.rb
|
|
448
449
|
- lib/kettle/dev/rakelib/appraisal.rake
|
|
449
450
|
- lib/kettle/dev/rakelib/bench.rake
|
|
450
451
|
- lib/kettle/dev/rakelib/bundle_audit.rake
|
|
@@ -457,6 +458,7 @@ files:
|
|
|
457
458
|
- lib/kettle/dev/readme_backers.rb
|
|
458
459
|
- lib/kettle/dev/rebase.rb
|
|
459
460
|
- lib/kettle/dev/rebase_cli.rb
|
|
461
|
+
- lib/kettle/dev/registry_availability.rb
|
|
460
462
|
- lib/kettle/dev/release_cli.rb
|
|
461
463
|
- lib/kettle/dev/release_graph_contract.rb
|
|
462
464
|
- lib/kettle/dev/release_notifier.rb
|
|
@@ -477,10 +479,10 @@ licenses:
|
|
|
477
479
|
- AGPL-3.0-only
|
|
478
480
|
metadata:
|
|
479
481
|
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.
|
|
482
|
+
source_code_uri: "https://github.com/kettle-dev/kettle-dev/tree/v3.1.37"
|
|
483
|
+
changelog_uri: "https://github.com/kettle-dev/kettle-dev/blob/v3.1.37/CHANGELOG.md"
|
|
482
484
|
bug_tracker_uri: "https://github.com/kettle-dev/kettle-dev/issues"
|
|
483
|
-
documentation_uri: "https://www.rubydoc.info/gems/kettle-dev/3.1.
|
|
485
|
+
documentation_uri: "https://www.rubydoc.info/gems/kettle-dev/3.1.37"
|
|
484
486
|
funding_uri: "https://github.com/sponsors/pboling"
|
|
485
487
|
wiki_uri: "https://github.com/kettle-dev/kettle-dev/wiki"
|
|
486
488
|
news_uri: "https://www.railsbling.com/tags/kettle-dev"
|
metadata.gz.sig
CHANGED
|
Binary file
|