kettle-jem 7.1.45 → 8.0.0

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.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/CHANGELOG.md +100 -1
  4. data/LICENSE.md +4 -6
  5. data/README.md +113 -21
  6. data/lib/kettle/jem/maintenance_changelog.rb +49 -9
  7. data/lib/kettle/jem/member_workflow_wrappers.rb +24 -1
  8. data/lib/kettle/jem/tasks/install_task.rb +64 -4
  9. data/lib/kettle/jem/templates/.github/workflows/perf-comment.yml.example +1 -1
  10. data/lib/kettle/jem/templates/.github/workflows/perf.yml.example +2 -2
  11. data/lib/kettle/jem/templates/.github/workflows/platforms.yml.example +87 -0
  12. data/lib/kettle/jem/templates/.structuredmerge/kettle-jem.yml.example +2 -1
  13. data/lib/kettle/jem/templates/AGENTS.md.example +56 -272
  14. data/lib/kettle/jem/templates/CHANGELOG.transfer.md +42 -9
  15. data/lib/kettle/jem/templates/CODE_OF_CONDUCT.md.example +58 -100
  16. data/lib/kettle/jem/templates/CONTRIBUTING.md.example +35 -1
  17. data/lib/kettle/jem/templates/FUNDING.md.example +7 -0
  18. data/lib/kettle/jem/templates/FUNDING.md.no-osc.example +7 -0
  19. data/lib/kettle/jem/templates/README.md.example +23 -19
  20. data/lib/kettle/jem/templates/SECURITY.md.example +3 -3
  21. data/lib/kettle/jem/templates/gem.gemspec.example +3 -3
  22. data/lib/kettle/jem/templates/gemfiles/modular/coverage.gemfile.example +1 -1
  23. data/lib/kettle/jem/templates/gemfiles/modular/coverage_local.gemfile.example +4 -2
  24. data/lib/kettle/jem/templates/gemfiles/modular/documentation_local.gemfile.example +2 -1
  25. data/lib/kettle/jem/templates/gemfiles/modular/duel.gemfile.example +1 -1
  26. data/lib/kettle/jem/templates/gemfiles/modular/style.gemfile.example +1 -1
  27. data/lib/kettle/jem/templates/gemfiles/modular/style_local.gemfile.example +2 -1
  28. data/lib/kettle/jem/templates/gemfiles/modular/templating.gemfile.example +1 -1
  29. data/lib/kettle/jem/templates/gemfiles/modular/templating_local.gemfile.example +4 -2
  30. data/lib/kettle/jem/templates/readme/partials/configuration.md.example +0 -1
  31. data/lib/kettle/jem/templates/shim/Gemfile.example +1 -1
  32. data/lib/kettle/jem/templates/shim/gem.gemspec.example +2 -2
  33. data/lib/kettle/jem/version.rb +1 -1
  34. data/lib/kettle/jem.rb +306 -127
  35. data.tar.gz.sig +0 -0
  36. metadata +48 -184
  37. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c1cc04d284f868bb3ffc2c503c23c252963944b16dbcea57e88f7049e1658183
4
- data.tar.gz: e6b0e286a73d80fe223f3f9dfd67a4cdc251bdd5c2d6293cfe3b73105ec9cd43
3
+ metadata.gz: 75dbfdabb120fc6666126be13cd9ed8c5283115c688394d6f7cb41b213d2e426
4
+ data.tar.gz: aa0f1ba4c6b9a23c89e2448507ef09a5adee9c234c139bddc8e5ea4d368f093a
5
5
  SHA512:
6
- metadata.gz: 3460ced5c26c5c3fc21b38ed88520365698b5d5f94cb457bd1d1ba81f693441c44f3b2c070a6bd27450f8b1fe4df8fa9d76b0a37aa177e0d72c02b2baac1a6e4
7
- data.tar.gz: c42e727149cc5c4da22ae6a01732007a9b01cc4ada97caf68690a3167c0ed26d864f596ed1ec0e2e08abea1a28b9b3a32645006a8b381c1d8872b2c3d6ca7871
6
+ metadata.gz: 68bc490b9770c17ce4973f4c7c9f2855b05c18ed2d04d565f9bf76b03c67a1a41343fb6bc23592d17518eb62d03cd5aaad1fc6950e8dba6249829656cd42454f
7
+ data.tar.gz: 741284d4fab4e8ab9bf709fd1454cc5a08f6cf5646035e6630887f35162f7ba619663afa7a72a31ec97b3a7b2a77d1ab34ce90861928b5173475ba4cf00272b5
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -30,6 +30,103 @@ Please file a bug if you notice a violation of semantic versioning.
30
30
 
31
31
  ### Security
32
32
 
33
+ ## [8.0.0] - 2026-12-04
34
+
35
+ - TAG: [v8.0.0][8.0.0t]
36
+ - COVERAGE: 93.90% -- 12488/13299 lines in 18 files
37
+ - BRANCH COVERAGE: 77.88% -- 5460/7011 branches in 18 files
38
+ - 22.90% documented
39
+
40
+ ### Added
41
+
42
+ - Opt-in Cloudroom referral paragraph in README.md (`## 🤝 Contributing` and the ungated star section, outside the Open Collective blocks, so it renders for every license), both FUNDING.md variants, and CONTRIBUTING.md (`### AI-assisted contributions`); configure tokens.funding.cloudroom_referral or KJ_FUNDING_CLOUDROOM_REFERRAL with the full referral URL; omitted entirely when unset
43
+
44
+ - kettle-jem-template-20261203-001 - Monorepo subgems now include
45
+ `.rubocop`, `.rubocop.yml`, and `.rubocop_rspec.yml` so local linting matches
46
+ `rubocop-lts`.
47
+
48
+ ### Changed
49
+
50
+ - Speed up `git_copyright_lines` on repos with > 64 tracked files by using a single `git log` + `git status` pass instead of spawning one `git blame --porcelain` subprocess per tracked file (~16 min → ~0.4s on the 7,832-file `structuredmerge/ruby` monorepo root).
51
+
52
+ - Opt into `Token::Resolver::Config`'s compiled `:scanner` parser backend for `TEMPLATE_TOKEN_CONFIG` (raising `token-resolver` floor to `>= 2.0.20`), speeding up template token resolution while remaining backward-compatible with older `token-resolver` versions.
53
+
54
+ - README: Corporate Sponsorship moved out of the license-gated FLOSS Funding section into its own un-gated `## 🏢 Corporate Sponsorship` section (sponsor cards slot, sponsor detail block, and company pitch), so non-MIT destinations keep their corporate sponsor badges while FLOSS Funding stays license-gated; destinations with the old nested `### Corporate Sponsorship` layout converge without duplication. The monorepo-subgem thin README projection keep list now includes `corporate sponsorship`, so family templating of monorepo members does not delete the section either.
55
+
56
+ - CONTRIBUTING.md: `## Ruby engine CI branches` is now dynamic based on enabled `engines:` (both JRuby and TruffleRuby, JRuby-only, TruffleRuby-only, or omitted entirely for MRI-only projects), and the manual release steps are collapsed by default inside a `<details>` block.
57
+
58
+ - CODE_OF_CONDUCT.md and README.md badges updated from Contributor Covenant 2.1 to Contributor Covenant 3.0.
59
+
60
+ - AGENTS.md template trimmed from ~10.6k to ~4k characters: removed duplicate `Modular Gemfile Architecture` section, hardcoded local path (`/home/pboling/src/my/prism-merge`), and IDE-specific tool names, pointing to `CONTRIBUTING.md`, `RUBOCOP.md`, and `spec/README.md` for reference tables.
61
+
62
+ - CI workflows: split non-Linux OS lanes (`macos`, `windows`) out of `.github/workflows/current.yml` into `.github/workflows/platforms.yml` (`Current MRI (Platforms)`, `fail-fast: false`, using `Jitujoshi71/soft-fail`) when `linux` is declared, keeping the flagship `Current MRI` workflow and badge Linux-only so macOS runner starvation does not turn it red; Linux-only projects skip and prune `platforms.yml`.
63
+
64
+ - [kc] kettle-jem/template: updated 20 project files since the last release:
65
+ - code and tests (1)
66
+ - dependencies (10)
67
+ - documentation (1)
68
+ - other (6)
69
+ - workflows (2)
70
+
71
+ - Local modular gemfiles and the main Gemfile sibling block pass relative_paths: true to nomono, so Gemfile.lock PATH remotes are identical in every checkout location (requires nomono with relative path support; older nomono ignores the option)
72
+
73
+ - [kc] kettle-jem-deps-floor: Update kettle-jem template dependency floors:
74
+ - appraisal2 (>= 3.2.6 -> >= 3.2.7)
75
+ - appraisal2-rubocop (>= 1.0.5 -> >= 1.0.6)
76
+ - duel (>= 0.3.1 -> >= 0.3.2)
77
+ - kettle-changelog (>= 1.0.23 -> >= 1.0.26)
78
+ - kettle-dev (>= 3.1.36 -> >= 3.1.41)
79
+ - kettle-drift (>= 1.0.21 -> >= 1.0.22)
80
+ - kettle-family (>= 1.3.57 -> >= 1.3.64)
81
+ - kettle-soup-cover (>= 3.0.18 -> >= 3.0.19)
82
+ - kettle-test (>= 2.0.31 -> >= 2.0.32)
83
+ - nomono (>= 1.1.19 -> >= 1.1.22)
84
+
85
+ - [kc] kettle-jem-workflow-pins: Update pinned GitHub Actions in kettle-jem templates:
86
+ - ruby/setup-ruby v1.346.0 (13841a643d859a0b8166ebb0211afbf488121be4) -> v1.348.0 (7eaac3fe3108dfb746bef3a3c1a21344d57923c7)
87
+
88
+ - kettle-jem-template-20261203-002 - Updated `CODE_OF_CONDUCT.md` and README
89
+ badges from Contributor Covenant 2.1 to Contributor Covenant 3.0.
90
+ - kettle-jem-template-20261203-004 - Development Gemfiles now pass
91
+ `relative_paths: true` to `nomono` (`>= 1.1.20`) so sibling `Gemfile.lock`
92
+ PATH remotes stay relative and checkout-independent.
93
+
94
+ ### Removed
95
+
96
+ - Tidelift scrubbed post-Sonar-shutdown: the funding platform is never enabled, so README Tidelift badges, the Enterprise Support Tidelift block, and FUNDING.yml `tidelift:` keys are always cleaned from destinations instead of emitted; SECURITY.md now points at the destination's own GitHub Private Vulnerability Reporting page (`{KJ|README:GH_REPOSITORY_URL}/security/advisories/new`).
97
+
98
+ ### Fixed
99
+
100
+ - Widen `TEMPLATE_MANAGED_DEPENDENCIES` for `kettle-jem` from `["~> 7.1", ">= 7.1.28"]` to `[">= 7.1.28", "< 9"]` so `kettle-jem prepare` in `STRUCTUREDMERGE_DEV` mode does not downgrade `>= 7.1.28, < 9` destination dependencies (like `kettle-jem-appraisals`) back to `< 8.A` and break resolution against `8.0.0` siblings.
101
+
102
+ - Serialize mutating Bundler steps (`bundle install`, `bundle update`, and `bin/setup`) in `Kettle::Jem::Tasks::InstallTask` across parallel processes with the shared XDG `bundle-install-<ruby-abi>.lock` flock (overridable via `KETTLE_DEV_BUNDLE_INSTALL_LOCK`), and classify `Text file busy` / `Text+file+busy` (`Errno::ETXTBSY`) binstub races as transient Bundler errors for backoff retry.
103
+
104
+ - `discover_monorepo_root_facts` now prefers configured `licenses:` in `.structuredmerge/kettle-jem.yml` over existing license `.md` files detected on disk (falling back to detected license files only when `licenses:` is unset or empty), so changing a monorepo root's configured license (e.g., to `MIT`) actually regenerates root `LICENSE.md` and `MIT.md`
105
+
106
+ - Unified `prepare` and `template` maintenance changelog entries under the single `kettle-jem/template` key (stopping duplicate `[kc] kettle-jem/prepare` + `[kc] kettle-jem/template` bullets and double-counted file totals); existing `kettle-jem/prepare` lockfile paths and `[kc] kettle-jem/prepare:` Unreleased entries are automatically folded into `kettle-jem/template` on the next run.
107
+
108
+ - FUNDING.md now defaults to `strategy: accept_template`: the section-level markdown merge dropped new template paragraphs (such as the Cloudroom referral) inside existing sections while still appending their link definitions. Set `strategy: merge` in kettle-jem.yml to keep hand edits.
109
+
110
+ - Monorepo root templating now resolves RubyForum tokens (CONTRIBUTING.md no longer aborts with unresolved `{KJ|RUBYFORUM:*}`) and prunes `.github/FUNDING.yml` (including the retired `tidelift` key) during template source application.
111
+
112
+ - `tokens.funding.open_collective` (where the config template puts it) is now honored for the Open Collective opt-out and org lookup; the legacy top-level `funding.open_collective` still works as a fallback. Previously only the legacy key was read, so `open_collective: false` in the templated config had no effect.
113
+
114
+ - Plugin callbacks no longer crash when they declare only some keywords (e.g. `do |context:|` raised `unknown keywords: :actor, :phase, :phase_stats, :plugin_name`); each callback now receives just the keywords it declares, or all of them with `**`. `PluginContext` also supports Hash-style reads (`context[:project_root]`) for plugins written against a Hash context, such as kettle-family <= 1.3.57.
115
+
116
+ - `files:` template strategies are now always honored: `.simplecov: {strategy: keep_destination}` is no longer silently stripped (in memory and from the config file) as a legacy migration, the implicit SimpleCov bootstrap entries for `.simplecov`/`spec/spec_helper.rb` use the configured strategy instead of a hard-coded `merge`, and flat keys such as `spec/spec_helper.rb:` match as well as nested ones.
117
+
118
+ - Rakefile templating now collapses stacked blank lines on every strategy; an empty whole-line token (`RAKE:TOP_LEVEL_DOCS_TASK` at a monorepo root) no longer leaves two extra blank lines under `accept_template`.
119
+
120
+ - Monorepo member workflow wrappers (`<member>--<workflow>.yml` at the repository root) keep the `# vX.Y.Z` comment beside each SHA-pinned action. They were dropped by the YAML round-trip, so the member pass and the monorepo-root pass rewrote each other's output on every whole-family template run.
121
+
122
+ - Post-template changed files are project-relative in monorepo members (git porcelain paths are repository-relative), so local-path Gemfile.lock restores and internal-path filters apply and rename entries parse correctly; previously recorded repository-relative maintenance changelog paths are re-expressed relative to the project
123
+
124
+ - Monorepo subgem template profiles now include `.rubocop`, `.rubocop.yml`, and `.rubocop_rspec.yml` so post-template `rubocop-gradual` runs use `rubocop-lts` (double quotes) instead of RuboCop's default single-quote style, eliminating the recurring 38-file checksum-protected churn on every template run.
125
+
126
+ - Boilerplate/generated Markdown templates (`AGENTS.md`, `CODE_OF_CONDUCT.md`, `CONTRIBUTING.md`, `FUNDING.md`, `IRP.md`, `LICENSE.md`, `RUBOCOP.md`, `SECURITY.md`, `.github/copilot_instructions.md`, and `spec/README.md`) now default to `strategy: accept_template`, so template updates inside existing sections—such as replacing the retired Tidelift security contact in `SECURITY.md` or updated guidance in `RUBOCOP.md` and `CONTRIBUTING.md`—actually land on already-templated projects instead of being kept untouched by section-level markdown merge. `README.md`, `CHANGELOG.md`, and verbatim SPDX license texts remain on `strategy: merge`; projects that hand-edit any boilerplate file can set `strategy: merge` or `keep_destination` in `kettle-jem.yml`.
127
+
128
+ - Allowlist CI macOS hardening step tokens in EMPTY_TEMPLATE_TOKENS, so MRI-only (or otherwise macOS-less) workflow platform sets no longer abort templating with "unresolved kettle-jem template tokens"
129
+
33
130
  ## [7.1.45] - 2026-12-01
34
131
 
35
132
  - TAG: [v7.1.45][7.1.45t]
@@ -2761,7 +2858,9 @@ Please file a bug if you notice a violation of semantic versioning.
2761
2858
  - Released kettle-jem as part of the initial StructuredMerge Ruby 7.0.0 gem set.
2762
2859
  - Included packaged templates and parser-backed merge support for Ruby gem templating.
2763
2860
 
2764
- [Unreleased]: https://github.com/structuredmerge/structuredmerge-ruby/compare/v7.1.45...HEAD
2861
+ [Unreleased]: https://github.com/structuredmerge/structuredmerge-ruby/compare/v8.0.0...HEAD
2862
+ [8.0.0]: https://github.com/structuredmerge/structuredmerge-ruby/compare/v7.1.45...v8.0.0
2863
+ [8.0.0t]: https://github.com/structuredmerge/structuredmerge-ruby/releases/tag/v8.0.0
2765
2864
  [7.1.45]: https://github.com/structuredmerge/structuredmerge-ruby/compare/v7.1.44...v7.1.45
2766
2865
  [7.1.45t]: https://github.com/structuredmerge/structuredmerge-ruby/releases/tag/v7.1.45
2767
2866
  [7.1.44]: https://github.com/structuredmerge/structuredmerge-ruby/compare/v7.1.43...v7.1.44
data/LICENSE.md CHANGED
@@ -1,13 +1,11 @@
1
1
  # License
2
2
 
3
- This project is made available under the following licenses.
3
+ This project is made available under the following license.
4
4
  Choose the option that best fits your use case:
5
5
 
6
- - [AGPL-3.0-only](https://github.com/structuredmerge/structuredmerge-ruby/blob/main/AGPL-3.0-only.md)
7
- - [PolyForm-Small-Business-1.0.0](https://github.com/structuredmerge/structuredmerge-ruby/blob/main/PolyForm-Small-Business-1.0.0.md)
8
-
9
- If none of the above licenses fit your use case, please [contact us](mailto:floss@galtzo.com) to discuss a custom commercial license.
6
+ - [MIT](https://github.com/structuredmerge/structuredmerge-ruby/blob/main/MIT.md)
10
7
 
11
8
  ## Copyright Notice
12
9
 
13
- - Required Notice: Copyright (c) 2026 Peter H. Boling
10
+ - Copyright (c) 2026 Erik Berlin
11
+ - Copyright (c) 2026 Peter H. Boling
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # 🔮 Kettle::Jem
4
4
 
5
- [![Version][👽versioni]][👽version] [![Ruby Users Forum][✉️ruby-forum-top-img]][✉️ruby-forum] [![GitHub tag (latest SemVer)][⛳️tag-img]][⛳️tag] [![License: AGPL-3.0-only OR PolyForm-Small-Business-1.0.0][📄license-img]][📄license] [![Total downloads][👽dl-ranki]][👽dl-rank] [![CodeCov Test Coverage][🏀codecovi]][🏀codecov] [![Coveralls Test Coverage][🏀coveralls-img]][🏀coveralls] [![QLTY Test Coverage][🏀qlty-covi]][🏀qlty-cov] [![QLTY Maintainability][🏀qlty-mnti]][🏀qlty-mnt] [![CI Heads][🚎3-hd-wfi]][🚎3-hd-wf] [![CI Runtime Dependencies @ HEAD][🚎12-crh-wfi]][🚎12-crh-wf] [![CI Current][🚎11-c-wfi]][🚎11-c-wf] [![Deps Locked][🚎13-🔒️-wfi]][🚎13-🔒️-wf] [![Deps Unlocked][🚎14-🔓️-wfi]][🚎14-🔓️-wf] [![CI Test Coverage][🚎2-cov-wfi]][🚎2-cov-wf] [![CI Style][🚎5-st-wfi]][🚎5-st-wf]
5
+ [![Version][👽versioni]][👽version] [![Ruby Users Forum][✉️ruby-forum-top-img]][✉️ruby-forum] [![GitHub tag (latest SemVer)][⛳️tag-img]][⛳️tag] [![License: MIT][📄license-img]][📄license] [![Total downloads][👽dl-ranki]][👽dl-rank] [![CodeCov Test Coverage][🏀codecovi]][🏀codecov] [![Coveralls Test Coverage][🏀coveralls-img]][🏀coveralls] [![QLTY Test Coverage][🏀qlty-covi]][🏀qlty-cov] [![QLTY Maintainability][🏀qlty-mnti]][🏀qlty-mnt] [![CI Heads][🚎3-hd-wfi]][🚎3-hd-wf] [![CI Runtime Dependencies @ HEAD][🚎12-crh-wfi]][🚎12-crh-wf] [![CI Current][🚎11-c-wfi]][🚎11-c-wf] [![Deps Locked][🚎13-🔒️-wfi]][🚎13-🔒️-wf] [![Deps Unlocked][🚎14-🔓️-wfi]][🚎14-🔓️-wf] [![CI Test Coverage][🚎2-cov-wfi]][🚎2-cov-wf] [![CI Style][🚎5-st-wfi]][🚎5-st-wf] [![Duel][⚔️duel-img]][⚔️duel]
6
6
 
7
7
  `if ci_badges.map(&:color).detect { it != "green"}` ☝️ [let me know on Discord][✉️discord-invite] or [RubyForum][✉️ruby-forum], as I may have missed the notification.
8
8
 
@@ -11,6 +11,7 @@
11
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]
12
12
 
13
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>
14
15
  <!-- kettle-sponsors:shields:end -->
15
16
 
16
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>
@@ -140,6 +141,7 @@ tokens:
140
141
  paypal: "username" # ENV override: KJ_FUNDING_PAYPAL
141
142
  buymeacoffee: "username" # ENV override: KJ_FUNDING_BUYMEACOFFEE
142
143
  liberapay: "username" # ENV override: KJ_FUNDING_LIBERAPAY
144
+ cloudroom_referral: "https://go.cloudroom.dev/..." # ENV override: KJ_FUNDING_CLOUDROOM_REFERRAL (opt-in; omitted when empty)
143
145
  social:
144
146
  mastodon: "username" # ENV override: KJ_SOCIAL_MASTODON
145
147
  bluesky: "user.bsky.social" # ENV override: KJ_SOCIAL_BLUESKY
@@ -587,6 +589,7 @@ fill missing keys during config sync, and act as runtime overrides.
587
589
  | `KJ_FUNDING_PAYPAL` | PayPal handle for FUNDING.yml |
588
590
  | `KJ_FUNDING_BUYMEACOFFEE` | Buy Me a Coffee handle for funding links |
589
591
  | `KJ_FUNDING_LIBERAPAY` | Liberapay handle for funding links |
592
+ | `KJ_FUNDING_CLOUDROOM_REFERRAL` | Full Cloudroom referral URL; when set, README.md and FUNDING.md add a referral paragraph (omitted when empty) |
590
593
  | `KJ_SOCIAL_MASTODON` | Mastodon handle for social/profile links |
591
594
  | `KJ_SOCIAL_BLUESKY` | Bluesky handle for social/profile links |
592
595
  | `KJ_SOCIAL_LINKTREE` | Linktree handle for social/profile links |
@@ -642,6 +645,93 @@ derive its pessimistic requirement from `Kettle::Jem::Version.major` and
642
645
  `.minor`, and use the running full version as the minimum. This makes a major
643
646
  release emit the matching major requirement without a second version to update.
644
647
 
648
+ ### Transferable Changelogs (`CHANGELOG.transfer.md`)
649
+
650
+ Template changes that affect downstream gems (behavior, configuration,
651
+ compatibility, packaging, documentation, or developer workflow) are recorded as
652
+ destination release notes in
653
+ `lib/kettle/jem/templates/CHANGELOG.transfer.md`.
654
+
655
+ - **Replay:** When `kettle-jem` templates a destination project, any new
656
+ applicable entries after the destination's recorded `changelog_replay`
657
+ watermark in `.structuredmerge/kettle-jem.lock` are inserted into the
658
+ destination's `CHANGELOG.md` under `## [Unreleased]` (stripped of their
659
+ `[if ...]` applicability filter).
660
+ - **Format:** Under `## Added`, `## Changed`, `## Deprecated`, `## Removed`,
661
+ `## Fixed`, or `## Security`:
662
+ `- kettle-jem-template-YYYYMMDD-NNN [if <filter>] - <release note>`
663
+ - **Applicability filters:** Optional `[if field=value & ...]` guards restrict
664
+ an entry to matching projects (`profile`, `topology`, `version_gem.mode`,
665
+ `ruby.min`, `engine.*`, `feature.*`, `workflow.*`). See the header of
666
+ `CHANGELOG.transfer.md` for the full list of allowed fields and values.
667
+ - **Scope:** Add entries only for genuine downstream impact; internal template
668
+ refactors and merge-engine fixes belong only in `kettle-jem`'s own
669
+ `CHANGELOG.md`.
670
+
671
+ ## 🦷 FLOSS Funding
672
+
673
+ While structuredmerge tools are free software and will always be, the project would benefit immensely from some funding.
674
+ Raising a monthly budget of... "dollars" would make the project more sustainable.
675
+
676
+ We welcome both individual and corporate sponsors! We also offer a
677
+ wide array of funding channels to account for your preferences.
678
+ Currently, [Open Collective][🖇osc] is our preferred funding platform.
679
+
680
+ ### Individual Support
681
+
682
+ You can support the development of structuredmerge tools via
683
+ [GitHub Sponsors][🖇sponsor],
684
+ [Liberapay][⛳liberapay],
685
+ [Open Collective][🖇osc],
686
+ and [PayPal][🖇paypal].
687
+
688
+ ### Open Collective for Individuals
689
+
690
+ Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/kettle-dev#backer)]
691
+
692
+ NOTE: [kettle-readme-backers][kettle-readme-backers] updates this list every day, automatically.
693
+
694
+ <!-- OPENCOLLECTIVE-INDIVIDUALS:START -->
695
+ No backers yet. Be the first!
696
+ <!-- OPENCOLLECTIVE-INDIVIDUALS:END -->
697
+
698
+ ### Open Collective for Organizations
699
+
700
+ Become a sponsor and get your logo on our README on GitHub with a link to your site. [[Become a sponsor](https://opencollective.com/kettle-dev#sponsor)]
701
+
702
+ NOTE: [kettle-readme-backers][kettle-readme-backers] updates this list every day, automatically.
703
+
704
+ <!-- OPENCOLLECTIVE-ORGANIZATIONS:START -->
705
+ No sponsors yet. Be the first!
706
+ <!-- OPENCOLLECTIVE-ORGANIZATIONS:END -->
707
+
708
+ [kettle-readme-backers]: https://github.com/structuredmerge/structuredmerge-ruby/blob/main/bin/kettle-readme-backers
709
+
710
+ ### Another way to support open-source
711
+
712
+ I’m driven by a passion to foster a thriving open-source community – a space where people can tackle complex problems, no matter how small. Revitalizing libraries that have fallen into disrepair, and building new libraries focused on solving real-world challenges, are my passions. Maintainers have teeth and need to pay their dentists; after getting laid off in an RIF, I began spending most of my time building open source tools full-time. Your support significantly aids my efforts to provide for my family (including health insurance) and my farm (11 🐔 chickens, 2 🐶 dogs, 3 🐰 rabbits, 8 🐈‍ cats).
713
+
714
+ If you work at a company that uses my work, please encourage them to support me as a corporate sponsor. My work on gems you use might show up in `bundle fund`.
715
+
716
+ I’m developing a new library, [floss_funding][🖇floss-funding-gem], designed to empower open-source developers like myself to get paid for the work we do, in a sustainable way. Please give it a look.
717
+
718
+ **[Floss-Funding.dev][🖇floss-funding.dev]: 👉️ No network calls. 👉️ No tracking. 👉️ No oversight. 👉️ Minimal crypto hashing. 💡 Easily disabled nags**
719
+
720
+ To join the community or get help, use the RubyForum or Discord. You can send support with the sponsor buttons at the end of this README.
721
+
722
+ [![Ruby Users Forum][✉️ruby-forum-img]][✉️ruby-forum] [![Live Chat on Discord][✉️discord-invite-img-ftb]][✉️discord-invite]
723
+
724
+ ## 🏢 Corporate Sponsorship
725
+
726
+ <!-- kettle-sponsors:cards:start -->
727
+ <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 =&gt; @pboling (maintainer)"></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>
728
+
729
+ <sub>Create sponsorship badges for your project with [kettle-sponsors](https://github.com/kettle-dev/kettle-sponsors).</sub>
730
+ <!-- kettle-sponsors:cards:end -->
731
+
732
+ **If you're working in a company that's making significant use of structuredmerge tools we'd
733
+ appreciate it if you suggest to your company to become a structuredmerge sponsor.**
734
+
645
735
  ## 💡 Info you can shake a stick at
646
736
 
647
737
  | Tokens to Remember | [![Gem name][⛳️name-img]][⛳️gem-name] [![Gem namespace][⛳️namespace-img]][⛳️gem-namespace] |
@@ -650,7 +740,7 @@ release emit the matching major requirement without a second version to update.
650
740
  | 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] |
651
741
  | 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] |
652
742
  | 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] |
653
- | Compliance | [![License: AGPL-3.0-only OR PolyForm-Small-Business-1.0.0][📄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] |
743
+ | Compliance | [![License: MIT][📄license-img]][📄license] [![Apache license compatibility: Category A][📄license-compat-img]][📄license-compat] [![📄ilo-declaration-img]][📄ilo-declaration] [![Security Policy][🔐security-img]][🔐security] [![Contributor Covenant 3.0][🪇conduct-img]][🪇conduct] [![SemVer 2.0.0][📌semver-img]][📌semver] |
654
744
  | 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] |
655
745
  | 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] |
656
746
  | `...` 💖 | [![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] |
@@ -721,10 +811,6 @@ I've summarized my thoughts in [this blog post](https://dev.to/galtzo/hostile-ta
721
811
 
722
812
  ### Enterprise Support
723
813
 
724
- [![Lifted through Tidelift](https://tidelift.com/badges/package/rubygems/kettle-jem)][🏙️entsup-tidelift-sonar]
725
-
726
- Lifted through Tidelift, part of [Sonar][🏙️entsup-tidelift-sonar].
727
-
728
814
  For enterprise support from the maintainer, use [Upwork][👨🏼‍🏫expsup-upwork] or [CodeMentor][👨🏼‍🏫expsup-codementor].
729
815
 
730
816
  Other support channels:
@@ -745,6 +831,8 @@ We [![Keep A Changelog][📗keep-changelog-img]][📗keep-changelog] so if you m
745
831
 
746
832
  See [CONTRIBUTING.md][🤝contributing] for more detailed instructions.
747
833
 
834
+ Want to contribute with AI coding agents? This project is developed with [Cloudroom][🖇cloudroom] and ships an `AGENTS.md` with repo conventions so agents can jump straight in. Signing up with [my referral link][🖇cloudroom] also supports ongoing maintenance at no extra cost to you.
835
+
748
836
  ### 🚀 Release Instructions
749
837
 
750
838
  See [CONTRIBUTING.md][🤝contributing].
@@ -765,7 +853,7 @@ See [CONTRIBUTING.md][🤝contributing].
765
853
  ### 🪇 Code of Conduct
766
854
 
767
855
  Everyone interacting with this project's codebases, issue trackers,
768
- chat rooms and mailing lists agrees to follow the [![Contributor Covenant 2.1][🪇conduct-img]][🪇conduct].
856
+ chat rooms and mailing lists agrees to follow the [![Contributor Covenant 3.0][🪇conduct-img]][🪇conduct].
769
857
 
770
858
  ## 🌈 Contributors
771
859
 
@@ -803,10 +891,8 @@ See [CHANGELOG.md][📌changelog] for a list of releases.
803
891
 
804
892
  ## 📄 License
805
893
 
806
- The gem is available under the following licenses: [AGPL-3.0-only](https://github.com/structuredmerge/structuredmerge-ruby/blob/main/AGPL-3.0-only.md), [PolyForm-Small-Business-1.0.0](https://github.com/structuredmerge/structuredmerge-ruby/blob/main/PolyForm-Small-Business-1.0.0.md).
807
- See [LICENSE.md][📄license] for details.
808
-
809
- If none of the available licenses suit your use case, please [contact us](mailto:floss@galtzo.com) to discuss a custom commercial license.
894
+ The gem is available as open source under the terms of
895
+ the [MIT](https://github.com/structuredmerge/structuredmerge-ruby/blob/main/MIT.md) [![License: MIT][📄license-img]][📄license-ref].
810
896
 
811
897
  ### © Copyright
812
898
 
@@ -815,8 +901,8 @@ See [LICENSE.md][📄license] for the official copyright notice.
815
901
  <details markdown="1">
816
902
  <summary>Copyright holders</summary>
817
903
 
818
- - Required Notice: Copyright (c) 2026 Erik Berlin
819
- - Required Notice: Copyright (c) 2026 Peter H. Boling
904
+ - Copyright (c) 2026 Erik Berlin
905
+ - Copyright (c) 2026 Peter H. Boling
820
906
 
821
907
  </details>
822
908
 
@@ -828,6 +914,11 @@ If this project helps you, please consider supporting the maintainer. This is no
828
914
 
829
915
  [![Sponsor kettle-dev/kettle-jem 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]
830
916
 
917
+ 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."
918
+ 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.
919
+
920
+ [🖇cloudroom]: https://go.cloudroom.dev/u9f53f181a
921
+
831
922
  Thanks for RTFM. ☺️
832
923
 
833
924
  [⛳liberapay-img]: https://img.shields.io/liberapay/goal/pboling.svg?logo=liberapay&color=a51611&style=flat
@@ -896,7 +987,6 @@ Thanks for RTFM. ☺️
896
987
  [💖🐙hub]: https://github.org/pboling
897
988
  [💖🛖hut]: https://sr.ht/~galtzo/
898
989
  [💖🧪lab]: https://gitlab.com/pboling
899
- [🏙️entsup-tidelift-sonar]: https://blog.tidelift.com/tidelift-joins-sonar
900
990
  [👨🏼‍🏫expsup-upwork]: https://www.upwork.com/freelancers/~014942e9b056abdf86?mp_source=share
901
991
  [👨🏼‍🏫expsup-upwork-img]: https://img.shields.io/badge/UpWork-13544E?style=for-the-badge&logo=Upwork&logoColor=white
902
992
  [👨🏼‍🏫expsup-codementor]: https://www.codementor.io/peterboling?utm_source=github&utm_medium=button&utm_term=peterboling&utm_campaign=github
@@ -957,7 +1047,7 @@ Thanks for RTFM. ☺️
957
1047
  [🖐contributors-img]: https://contrib.rocks/image?repo=structuredmerge/structuredmerge-ruby
958
1048
  [🚎contributors-gl]: https://gitlab.com/structuredmerge/structuredmerge-ruby/-/graphs/main
959
1049
  [🪇conduct]: https://github.com/structuredmerge/structuredmerge-ruby/blob/main/CODE_OF_CONDUCT.md
960
- [🪇conduct-img]: https://img.shields.io/badge/Contributor_Covenant-2.1-259D6C.svg
1050
+ [🪇conduct-img]: https://img.shields.io/badge/Contributor_Covenant-3.0-259D6C.svg
961
1051
  [📌pvc]: http://guides.rubygems.org/patterns/#pessimistic-version-constraint
962
1052
  [📌semver]: https://semver.org/spec/v2.0.0.html
963
1053
  [📌semver-img]: https://img.shields.io/badge/semver-2.0.0-259D6C.svg?style=flat
@@ -969,16 +1059,18 @@ Thanks for RTFM. ☺️
969
1059
  [📌gitmoji]: https://gitmoji.dev
970
1060
  [📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
971
1061
  [🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
972
- [🧮kloc-img]: https://img.shields.io/badge/KLOC-13.158-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
1062
+ [🧮kloc-img]: https://img.shields.io/badge/KLOC-13.299-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
973
1063
  [🔐security]: https://github.com/structuredmerge/structuredmerge-ruby/blob/main/SECURITY.md
974
1064
  [🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
975
1065
  [📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
976
1066
  [📄license]: LICENSE.md
977
- [📄license-ref]: LICENSE.md
978
- [📄license-img]: https://img.shields.io/badge/License-AGPL--3.0--only_OR_PolyForm--Small--Business--1.0.0-259D6C.svg
979
- [📄license-compat]: https://www.apache.org/legal/resolved.html#category-x
980
- [📄license-compat-img]: https://img.shields.io/badge/Apache_Incompatible:_Category_X-%E2%9C%97-C0392B.svg?style=flat&logo=Apache
1067
+ [📄license-ref]: https://github.com/structuredmerge/structuredmerge-ruby/blob/main/MIT.md
1068
+ [📄license-img]: https://img.shields.io/badge/License-MIT-259D6C.svg
1069
+ [📄license-compat]: https://www.apache.org/legal/resolved.html#category-a
1070
+ [📄license-compat-img]: https://img.shields.io/badge/Apache_Compatible:_Category_A-%E2%9C%93-259D6C.svg?style=flat&logo=Apache
981
1071
 
1072
+ [⚔️duel]: https://github.com/sferik/duel-ruby
1073
+ [⚔️duel-img]: https://raw.githubusercontent.com/sferik/duel-ruby/main/assets/badge.svg
982
1074
  [📄ilo-declaration]: https://www.ilo.org/declaration/lang--en/index.htm
983
1075
  [📄ilo-declaration-img]: https://img.shields.io/badge/ILO_Fundamental_Principles-✓-259D6C.svg?style=flat
984
1076
  [🚎yard-current]: http://rubydoc.info/gems/kettle-jem
@@ -998,6 +1090,6 @@ Thanks for RTFM. ☺️
998
1090
  | Description | 🔮 Kettle::Jem provides gem scaffolding, templating, and setup automation using the *-merge gem family for AST-based file merging and token-resolver for template token resolution. Includes MergerConfig presets, YAML recipes, and a complete gem template scaffold. |
999
1091
  | Homepage | https://github.com/structuredmerge/structuredmerge-ruby |
1000
1092
  | Source | https://github.com/structuredmerge/structuredmerge-ruby |
1001
- | License | `AGPL-3.0-only` OR `PolyForm-Small-Business-1.0.0` |
1093
+ | License | `MIT` |
1002
1094
  | Funding | https://github.com/sponsors/pboling, https://ko-fi.com/pboling, https://liberapay.com/pboling/donate, https://opencollective.com/kettle-dev, https://thanks.dev/u/gh/pboling, https://www.buymeacoffee.com/pboling |
1003
1095
  <!-- kettle-jem:metadata:end -->
@@ -23,9 +23,11 @@ module Kettle
23
23
  configuration: ->(path) { path.start_with?(".structuredmerge/") || %w[.gitattributes .gitignore mise.toml].include?(path) },
24
24
  code_and_tests: ->(path) { path.start_with?("lib/", "spec/", "test/", "bin/") || path == "Rakefile" }
25
25
  }.freeze
26
+ TEMPLATE_CHANGELOG_KEY = "kettle-jem/template"
27
+ LEGACY_TEMPLATE_CHANGELOG_KEYS = %w[kettle-jem/prepare].freeze
26
28
  TEMPLATE_CHANGELOG_KEYS = {
27
- "Apply kettle-jem templates" => "kettle-jem/template",
28
- "Prepare project for kettle-jem templates" => "kettle-jem/prepare"
29
+ "Apply kettle-jem templates" => TEMPLATE_CHANGELOG_KEY,
30
+ "Prepare project for kettle-jem templates" => TEMPLATE_CHANGELOG_KEY
29
31
  }.freeze
30
32
  BUNDLER_ENVIRONMENT = %w[
31
33
  BUNDLE_BIN_PATH
@@ -74,19 +76,31 @@ module Kettle
74
76
  raise "kettle-changelog executable is not installed: #{error.message}"
75
77
  end
76
78
 
77
- def upsert_unreleased_entry(project_root:, section:, key:, entry:, legacy_prefixes: [])
79
+ def upsert_unreleased_entry(project_root:, section:, key:, entry:, legacy_prefixes: [], merge_legacy: false)
78
80
  result = with_project_changelog_path(project_root) do
79
- Kettle::Changelog::KeyedEntryUpserter.new(
81
+ options = {
80
82
  root: project_root,
81
83
  section: section,
82
84
  key: key,
83
85
  entry: entry,
84
86
  legacy_prefixes: legacy_prefixes
85
- ).run
87
+ }
88
+ if merge_legacy
89
+ if key_upserter_supports_merge_legacy?
90
+ options[:merge_legacy] = true
91
+ else
92
+ options[:legacy_prefixes] = []
93
+ end
94
+ end
95
+ Kettle::Changelog::KeyedEntryUpserter.new(**options).run
86
96
  end
87
97
  result.merge(status: result.fetch(:changed) ? "updated" : "unchanged")
88
98
  end
89
99
 
100
+ def key_upserter_supports_merge_legacy?
101
+ Kettle::Changelog::KeyedEntryUpserter.instance_method(:initialize).parameters.any? { |_kind, name| name == :merge_legacy }
102
+ end
103
+
90
104
  def record_template_run(project_root:, report:, run_options: {}, label: "Apply kettle-jem templates")
91
105
  report = report.to_h
92
106
  if template_changelog_disabled?(run_options) || bootstrap_only_report?(report)
@@ -103,18 +117,33 @@ module Kettle
103
117
  return report.merge(changelog: {status: "skipped", reason: "missing_changelog"})
104
118
  end
105
119
 
106
- key = TEMPLATE_CHANGELOG_KEYS.fetch(label, "kettle-jem/template")
120
+ key = TEMPLATE_CHANGELOG_KEYS.fetch(label, TEMPLATE_CHANGELOG_KEY)
121
+ legacy_keys = (key == TEMPLATE_CHANGELOG_KEY) ? LEGACY_TEMPLATE_CHANGELOG_KEYS : []
122
+ legacy_prefixes = legacy_keys.map { |legacy_key| "[kc] #{legacy_key}:" }
107
123
  tracked_paths = nil
108
124
  entry = lambda do |matches|
109
- existing_paths = matches.empty? ? [] : TemplateLock.maintenance_changelog_paths(project_root: project_root, key: key).to_a
125
+ existing_paths = if matches.empty?
126
+ []
127
+ else
128
+ raw_paths = ([key] + legacy_keys).flat_map do |tracked_key|
129
+ TemplateLock.maintenance_changelog_paths(project_root: project_root, key: tracked_key).to_a
130
+ end
131
+ template_changed_files(project_relative_paths(project_root, raw_paths))
132
+ end
110
133
  tracked_paths = (existing_paths + changed_files).uniq.sort
111
134
  template_run_entry(tracked_paths)
112
135
  end
113
- result = upsert_unreleased_entry(project_root: project_root, section: "Changed", key: key, entry: entry)
136
+ upsert_options = {project_root: project_root, section: "Changed", key: key, entry: entry}
137
+ unless legacy_prefixes.empty?
138
+ upsert_options[:legacy_prefixes] = legacy_prefixes
139
+ upsert_options[:merge_legacy] = true
140
+ end
141
+ result = upsert_unreleased_entry(**upsert_options)
114
142
  state_changed = TemplateLock.update_maintenance_changelog_paths(
115
143
  project_root: project_root,
116
144
  key: key,
117
- paths: tracked_paths || changed_files
145
+ paths: tracked_paths || changed_files,
146
+ remove_keys: legacy_keys
118
147
  )
119
148
  changelog = result.merge(changed_files: changed_files, tracked_paths: tracked_paths, entry: result.fetch(:entry))
120
149
  changed_files_with_changelog = if result.fetch(:status) == "updated"
@@ -126,6 +155,17 @@ module Kettle
126
155
  report.merge(changelog: changelog, changed_files: changed_files_with_changelog)
127
156
  end
128
157
 
158
+ # Older runs recorded repository-relative paths for monorepo members
159
+ # (`gems/<member>/Gemfile.lock`); re-express them relative to the project
160
+ # so they dedupe and the internal-path filter applies.
161
+ def project_relative_paths(project_root, paths)
162
+ stdout, _stderr, status = Open3.capture3("git", "-C", project_root.to_s, "rev-parse", "--show-prefix")
163
+ prefix = status.success? ? stdout.strip : ""
164
+ return paths if prefix.empty?
165
+
166
+ paths.map { |path| path.delete_prefix(prefix) }
167
+ end
168
+
129
169
  def template_changed_files(changed_files)
130
170
  Array(changed_files).map(&:to_s).uniq.sort.reject do |path|
131
171
  TEMPLATE_CHANGELOG_INTERNAL_PATHS.include?(path)
@@ -62,7 +62,30 @@ module Kettle
62
62
  doc = doc.sort_by { |key, _| [KEY_ORDER.index(key.to_s) || KEY_ORDER.size, key.to_s] }.to_h
63
63
  header = "# GENERATED by kettle-jem from #{member_dir}/.github/workflows/#{wrapper.delete_prefix("#{member}#{SEPARATOR}")}.\n" \
64
64
  "# GitHub only runs workflows from the repository root, so this wraps the member's workflow.\n# Do not edit; re-template the member.\n"
65
- header + Psych.dump(doc).delete_prefix("---\n")
65
+ header + restore_action_pin_comments(Psych.dump(doc).delete_prefix("---\n"), content)
66
+ end
67
+
68
+ # Psych drops comments, including the `# vX.Y.Z` version comment that pin
69
+ # tooling keeps beside each SHA-pinned action, so the wrapper and the
70
+ # monorepo-root pass (which re-annotates root workflows) would rewrite
71
+ # each other on every run. Psych exposes no comment nodes, so recover
72
+ # them from the source text: a `uses: owner/repo@ref # comment` line maps
73
+ # ref => comment, which is reattached to the same ref in the dump. A ref
74
+ # pinned twice with different comments keeps the first; harmless, since
75
+ # identical refs name the same release.
76
+ ACTION_PIN_COMMENT = /^\s*(?:-\s+)?uses:\s*(\S+@\S+)\s+(#.*?)\s*$/
77
+
78
+ def restore_action_pin_comments(dumped, source)
79
+ comments = source.to_s.each_line.each_with_object({}) do |line, memo|
80
+ match = ACTION_PIN_COMMENT.match(line)
81
+ memo[match[1]] ||= match[2] if match
82
+ end
83
+ return dumped if comments.empty?
84
+
85
+ dumped.each_line.map do |line|
86
+ match = /^(\s*(?:-\s+)?uses:\s*)(\S+@\S+)\s*$/.match(line)
87
+ (match && comments.key?(match[2])) ? "#{line.chomp} #{comments.fetch(match[2])}\n" : line
88
+ end.join
66
89
  end
67
90
 
68
91
  PRELUDE_JOB = "ci-prelude"