kettle-jem 7.1.44 → 7.1.45

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 (29) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/CHANGELOG.md +90 -7
  4. data/README.md +129 -109
  5. data/lib/kettle/jem/member_workflow_wrappers.rb +204 -0
  6. data/lib/kettle/jem/tasks/install_task.rb +59 -6
  7. data/lib/kettle/jem/templates/.github/workflows/dep-heads.yml.example +5 -1
  8. data/lib/kettle/jem/templates/.github/workflows/framework-ci.yml.example +9 -0
  9. data/lib/kettle/jem/templates/.github/workflows/heads.yml.example +9 -2
  10. data/lib/kettle/jem/templates/.github/workflows/jruby-10.0.yml.example +5 -1
  11. data/lib/kettle/jem/templates/.github/workflows/jruby.yml.example +5 -1
  12. data/lib/kettle/jem/templates/.github/workflows/perf-comment.yml.example +1 -1
  13. data/lib/kettle/jem/templates/.github/workflows/perf.yml.example +2 -2
  14. data/lib/kettle/jem/templates/.github/workflows/truffleruby-22.3.yml.example +5 -1
  15. data/lib/kettle/jem/templates/.github/workflows/truffleruby-23.1.yml.example +5 -1
  16. data/lib/kettle/jem/templates/.idea/.gitignore.example +44 -0
  17. data/lib/kettle/jem/templates/.structuredmerge/kettle-jem.yml.example +24 -29
  18. data/lib/kettle/jem/templates/README.md.example +83 -87
  19. data/lib/kettle/jem/templates/gem.gemspec.example +2 -2
  20. data/lib/kettle/jem/templates/gemfiles/modular/coverage.gemfile.example +1 -1
  21. data/lib/kettle/jem/templates/gemfiles/modular/documentation.gemfile.example +1 -1
  22. data/lib/kettle/jem/templates/gemfiles/modular/templating.gemfile.example +2 -1
  23. data/lib/kettle/jem/templates/shim/Gemfile.example +1 -1
  24. data/lib/kettle/jem/templates/shim/gem.gemspec.example +2 -2
  25. data/lib/kettle/jem/version.rb +1 -1
  26. data/lib/kettle/jem.rb +581 -62
  27. data.tar.gz.sig +0 -0
  28. metadata +12 -10
  29. metadata.gz.sig +0 -0
@@ -0,0 +1,204 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "psych"
4
+
5
+ module Kettle
6
+ module Jem
7
+ # GitHub only registers workflows that sit directly in the repository root's .github/workflows, so a
8
+ # monorepo member's own workflows (gems/<member>/.github/workflows) never run, and cannot have status
9
+ # badges. For members that declare `repository.ci: own`, this derives a root-level wrapper of each
10
+ # CI/workflow: same jobs, but scoped to the member's paths and working directory. The root file is
11
+ # named `<member>--<workflow>.yml`, which is also what the member README's badge URLs point at.
12
+ module MemberWorkflowWrappers
13
+ SEPARATOR = "--"
14
+ WORKFLOW_EXTENSIONS = %w[.yml .yaml].freeze
15
+ # Repository-level workflows (reacting to issues, or reviewing every pull request) make sense once for the
16
+ # whole monorepo, so they come from the monorepo-root template instead of from each member.
17
+ REPOSITORY_WORKFLOWS = %w[auto-assign dependency-review discord-notifier opencollective license-eye].freeze
18
+ PATH_PARAM_KEYS = %w[path file files filename directory].freeze
19
+ PATH_PARAM_ACTIONS = %w[
20
+ actions/cache actions/upload-artifact coverallsapp/github-action qltysh/qlty-action/coverage codecov/codecov-action
21
+ irongut/CodeCoverageSummary marocchino/sticky-pull-request-comment
22
+ ].freeze
23
+ SETUP_RUBY_ACTIONS = %w[appraisal-rb/setup-ruby-flash ruby/setup-ruby].freeze
24
+ KEY_ORDER = %w[name on permissions env defaults concurrency jobs].freeze
25
+ EVENTS_WITH_PATHS = %w[push pull_request pull_request_target].freeze
26
+
27
+ module_function
28
+
29
+ def wrapped_workflow?(basename)
30
+ workflow_file?(basename) && !REPOSITORY_WORKFLOWS.include?(File.basename(basename.to_s, ".*"))
31
+ end
32
+
33
+ def workflow_file?(name)
34
+ name = name.to_s
35
+ !name.include?("/") && WORKFLOW_EXTENSIONS.include?(File.extname(name))
36
+ end
37
+
38
+ def wrapper_name(member, basename)
39
+ "#{member}#{SEPARATOR}#{basename}"
40
+ end
41
+
42
+ # Map of root-relative wrapper path => content for every wrapped workflow of the member.
43
+ def generate(member:, member_dir:, member_root:, prelude: nil)
44
+ workflows = Dir.glob(File.join(member_root, ".github", "workflows", "*.{yml,yaml}")).sort
45
+ workflows.each_with_object({}) do |path, wrappers|
46
+ basename = File.basename(path)
47
+ next unless wrapped_workflow?(basename)
48
+
49
+ name = wrapper_name(member, basename)
50
+ wrappers[File.join(".github", "workflows", name)] = wrap(File.read(path), member: member, member_dir: member_dir, wrapper: name, prelude: prelude_for(prelude, basename))
51
+ end
52
+ end
53
+
54
+ def wrap(content, member:, member_dir:, wrapper:, prelude: nil)
55
+ doc = Psych.safe_load(content, aliases: true) || {}
56
+ doc["name"] = "#{doc["name"] || File.basename(wrapper, ".*")} [#{member}]"
57
+ scope_triggers!(doc, member_dir, wrapper, prelude)
58
+ doc["defaults"] = (doc["defaults"] || {}).merge("run" => ((doc.dig("defaults", "run") || {}).merge("working-directory" => member_dir)))
59
+ rewrite!(doc["jobs"], member_dir)
60
+ rewrite!(doc["env"], member_dir)
61
+ apply_prelude!(doc, prelude) if prelude.is_a?(Hash) && !prelude.empty?
62
+ doc = doc.sort_by { |key, _| [KEY_ORDER.index(key.to_s) || KEY_ORDER.size, key.to_s] }.to_h
63
+ header = "# GENERATED by kettle-jem from #{member_dir}/.github/workflows/#{wrapper.delete_prefix("#{member}#{SEPARATOR}")}.\n" \
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")
66
+ end
67
+
68
+ PRELUDE_JOB = "ci-prelude"
69
+
70
+ # Root files the prelude depends on also re-run the wrapper when they change.
71
+ def prelude_paths(prelude)
72
+ return [] unless prelude.is_a?(Hash)
73
+
74
+ [prelude["job"], prelude["step"] && "#{prelude["step"]}/**"].compact.map { |path| path.to_s.delete_prefix("./") }
75
+ end
76
+
77
+ # `except:` lists workflows (basenames without extension) that must not get the prelude, such as engines the
78
+ # typed core cannot be installed on.
79
+ def prelude_for(prelude, basename)
80
+ return nil unless prelude.is_a?(Hash)
81
+
82
+ Array(prelude["except"]).map(&:to_s).include?(File.basename(basename, ".*")) ? nil : prelude
83
+ end
84
+
85
+ # A member's own workflows assume a standalone checkout. `repository.ci_prelude` adapts them to the monorepo:
86
+ # env: merged into the env of each job that gets the prelude (for example STRUCTUREDMERGE_DEV, the member directory);
87
+ # job: a reusable workflow called once as job `ci-prelude`, which every job that sets up Ruby needs;
88
+ # step: a composite action run right after each job's Ruby setup step (jobs install their own bundle there,
89
+ # so the setup step's `bundler-cache` is turned off).
90
+ # `owner/repo@ref` or `owner/repo/path@ref` => `owner/repo` or `owner/repo/path`.
91
+ def action_name(uses)
92
+ uses.to_s.split("@", 2).first.to_s
93
+ end
94
+
95
+ def apply_prelude!(doc, prelude)
96
+ job_ref = prelude["job"]
97
+ step_ref = prelude["step"]
98
+ used = false
99
+ (doc["jobs"] || {}).each do |job_id, job|
100
+ next unless job.is_a?(Hash) && job["steps"].is_a?(Array)
101
+ # The typed core is a native MRI gem, so JRuby and TruffleRuby jobs run without the prelude.
102
+ next if %w[jruby truffle].any? { |engine| job_id.to_s.downcase.include?(engine) }
103
+
104
+ index = job["steps"].index { |step| step.is_a?(Hash) && SETUP_RUBY_ACTIONS.include?(action_name(step["uses"])) }
105
+ next unless index
106
+
107
+ job["env"] = (job["env"] || {}).merge(prelude.fetch("env", {}))
108
+ job["steps"][index]["with"] = (job["steps"][index]["with"] || {}).merge("bundler-cache" => false)
109
+ job["steps"].insert(index + 1, {"name" => "Monorepo member prelude", "uses" => step_ref}) if step_ref
110
+ job["needs"] = (Array(job["needs"]) + [PRELUDE_JOB]).uniq if job_ref
111
+ used = true
112
+ end
113
+ doc["jobs"][PRELUDE_JOB] = {"uses" => job_ref} if used && job_ref
114
+ end
115
+
116
+ def scope_triggers!(doc, member_dir, wrapper, prelude = nil)
117
+ key = doc.key?("on") ? "on" : true
118
+ triggers = doc[key]
119
+ # `on: pull_request` and `on: [push, pull_request]` are shorthand for a mapping of empty settings.
120
+ triggers = Array(triggers).to_h { |event| [event.to_s, nil] } if triggers.is_a?(String) || triggers.is_a?(Array)
121
+ doc[key] = triggers
122
+ return unless triggers.is_a?(Hash)
123
+
124
+ paths = ["#{member_dir}/**", ".github/workflows/#{wrapper}"] + prelude_paths(prelude)
125
+ EVENTS_WITH_PATHS.each do |event|
126
+ next unless triggers.key?(event)
127
+
128
+ settings = triggers[event].is_a?(Hash) ? triggers[event] : {}
129
+ triggers[event] = settings.merge("paths" => paths.dup)
130
+ end
131
+ doc["on"] = doc.delete(key) unless key == "on"
132
+ end
133
+
134
+ # Walk the YAML structure: prefix workspace-relative values, and point setup-ruby-flash at the member.
135
+ def rewrite!(node, member_dir)
136
+ case node
137
+ when Hash
138
+ if SETUP_RUBY_ACTIONS.include?(action_name(node["uses"]))
139
+ node["with"] = (node["with"] || {}).merge("working-directory" => member_dir) { |_, existing, _| existing }
140
+ end
141
+ if PATH_PARAM_ACTIONS.include?(action_name(node["uses"])) && node["with"].is_a?(Hash)
142
+ PATH_PARAM_KEYS.each do |param|
143
+ node["with"][param] = prefix_paths(node["with"][param], member_dir) if node["with"][param].is_a?(String)
144
+ end
145
+ end
146
+ node.each_key { |key| node[key] = rewrite_string(node[key], member_dir) if node[key].is_a?(String) }
147
+ node.each_value { |value| rewrite!(value, member_dir) }
148
+ when Array
149
+ node.each_with_index { |value, index| value.is_a?(String) ? node[index] = rewrite_string(value, member_dir) : rewrite!(value, member_dir) }
150
+ end
151
+ node
152
+ end
153
+
154
+ # GitHub expressions are not YAML structure, so these two rewrites are textual: the workspace root
155
+ # becomes the member directory, and hashFiles() literals that are not recursive globs gain the prefix.
156
+ def rewrite_string(value, member_dir)
157
+ rewrite_hash_files(value.gsub("${{ github.workspace }}/", "${{ github.workspace }}/#{member_dir}/"), member_dir)
158
+ end
159
+
160
+ # `hashFiles('a', '**/b')` is GitHub's expression language, for which this stack has no parser, so the call is
161
+ # walked as text with plain string operations (no pattern matching): each quoted, non-recursive-glob literal
162
+ # argument gains the member directory.
163
+ def rewrite_hash_files(value, member_dir)
164
+ marker = "hashFiles("
165
+ output = +""
166
+ rest = value
167
+ while (start = rest.index(marker))
168
+ args_start = start + marker.length
169
+ close = rest.index(")", args_start)
170
+ break unless close
171
+
172
+ args = rest[args_start...close].split(",", -1).map { |arg| prefix_hash_files_argument(arg, member_dir) }
173
+ output << rest[0...args_start] << args.join(",") << ")"
174
+ rest = rest[(close + 1)..]
175
+ end
176
+ output << rest
177
+ end
178
+
179
+ def prefix_hash_files_argument(argument, member_dir)
180
+ literal = argument.strip
181
+ return argument unless literal.length > 2 && literal.start_with?("'") && literal.end_with?("'")
182
+
183
+ path = literal[1...-1]
184
+ path.start_with?("*") ? argument : argument.sub(literal, "'#{member_dir}/#{path}'")
185
+ end
186
+
187
+ # Comma- or newline-separated workspace-relative paths; absolute, home, negated and expression paths and
188
+ # paths already under the member directory are kept.
189
+ def prefix_paths(value, member_dir)
190
+ lines = value.lines(chomp: true).map do |line|
191
+ line.split(",", -1).map { |segment| prefix_path_segment(segment, member_dir) }.join(",")
192
+ end
193
+ lines.join("\n") + (value.end_with?("\n") ? "\n" : "")
194
+ end
195
+
196
+ def prefix_path_segment(segment, member_dir)
197
+ path = segment.strip
198
+ return segment if path.empty? || %w[/ ~ ! ${{].any? { |lead| path.start_with?(lead) } || path.include?("#{member_dir}/")
199
+
200
+ segment.sub(path, "#{member_dir}/#{path}")
201
+ end
202
+ end
203
+ end
204
+ end
@@ -28,6 +28,19 @@ module Kettle
28
28
  DEFAULT_COMMIT_PHASE = "install"
29
29
  GIT_OPERATION_LOCK_RETRY_ATTEMPTS = 5
30
30
  GIT_OPERATION_LOCK_RETRY_SLEEP_SECONDS = 0.25
31
+ # Parallel family templating runs Bundler in many processes against the same global git-gem checkouts, and
32
+ # Bundler rewrites a git gem's gemspec in place (not atomically) after install. A `bundler/setup` that reads
33
+ # it mid-write sees no specification and crashes; the read succeeds once the other Bundler process finishes.
34
+ # Any other tool running Bundler against the same gems (an IDE indexing a project, `bundle outdated` in a
35
+ # terminal) can cause the same thing, so these failures wait and retry with exponential backoff, about 46
36
+ # seconds in total, before the step is allowed to fail.
37
+ TRANSIENT_BUNDLER_RETRY_ATTEMPTS = 6
38
+ TRANSIENT_BUNDLER_RETRY_BASE_SECONDS = 2.0
39
+ TRANSIENT_BUNDLER_RETRY_MAX_SECONDS = 16.0
40
+ TRANSIENT_BUNDLER_ERRORS = [
41
+ "isn't a Gem::Specification (NilClass instead)",
42
+ "undefined method 'content_address' for nil"
43
+ ].freeze
31
44
 
32
45
  def run(project_root: Dir.pwd, env: ENV, run_options: {}, command_runner: method(:run_system_command))
33
46
  effective_run_options = install_run_options(env, run_options)
@@ -745,7 +758,7 @@ module Kettle
745
758
  end
746
759
 
747
760
  def curated_binstub_gems_in_bundle(project_root = Dir.pwd, env: ENV)
748
- stdout, _stderr, status = Open3.capture3(env.to_h, "bundle", "list", "--name-only", chdir: project_root.to_s)
761
+ stdout, _stderr, status = capture_with_transient_bundler_retry(env.to_h, "bundle", "list", "--name-only", chdir: project_root.to_s)
749
762
  return CURATED_BINSTUB_GEMS unless status.success?
750
763
 
751
764
  bundled = stdout.lines.map(&:strip).reject(&:empty?)
@@ -753,7 +766,7 @@ module Kettle
753
766
  end
754
767
 
755
768
  def bundle_includes_gem?(project_root, gem_name, env: ENV)
756
- stdout, _stderr, status = Open3.capture3(env.to_h, "bundle", "list", "--name-only", chdir: project_root.to_s)
769
+ stdout, _stderr, status = capture_with_transient_bundler_retry(env.to_h, "bundle", "list", "--name-only", chdir: project_root.to_s)
757
770
  return true unless status.success?
758
771
 
759
772
  stdout.lines.map(&:strip).include?(gem_name.to_s)
@@ -953,7 +966,7 @@ module Kettle
953
966
  end
954
967
 
955
968
  def rake_task_available?(project_root, task_name, env: nil)
956
- stdout, _stderr, status = Open3.capture3((env || {}).to_h, "bin/rake", "--tasks", chdir: project_root.to_s)
969
+ stdout, _stderr, status = capture_with_transient_bundler_retry((env || {}).to_h, "bin/rake", "--tasks", chdir: project_root.to_s)
957
970
  status.success? && stdout.lines.any? { |line| line.include?(task_name.to_s) }
958
971
  rescue Errno::EACCES, Errno::ENOENT
959
972
  false
@@ -2036,7 +2049,7 @@ module Kettle
2036
2049
  end
2037
2050
 
2038
2051
  started_at = Process.clock_gettime(Process::CLOCK_MONOTONIC)
2039
- result = command_runner.call(command, chdir: project_root, env: env, quiet: quiet)
2052
+ result, = call_command_with_transient_bundler_retry(command, chdir: project_root, env: env, quiet: quiet, command_runner: command_runner)
2040
2053
  duration_ms = ((Process.clock_gettime(Process::CLOCK_MONOTONIC) - started_at) * 1000.0).round(3)
2041
2054
  success = result.fetch(:success)
2042
2055
  if success
@@ -2178,19 +2191,21 @@ module Kettle
2178
2191
  def run_ready_step_command(step_name, command, project_root:, env:, quiet:, command_runner:)
2179
2192
  attempts = git_operation_step_name?(step_name) ? GIT_OPERATION_LOCK_RETRY_ATTEMPTS : 1
2180
2193
  attempt = 0
2194
+ calls = 0
2181
2195
  last_result = nil
2182
2196
  last_duration_ms = 0.0
2183
2197
  loop do
2184
2198
  attempt += 1
2185
2199
  started_at = Process.clock_gettime(Process::CLOCK_MONOTONIC)
2186
- last_result = command_runner.call(command, chdir: project_root, env: env, quiet: quiet)
2200
+ last_result, made = call_command_with_transient_bundler_retry(command, chdir: project_root, env: env, quiet: quiet, command_runner: command_runner)
2201
+ calls += made
2187
2202
  last_duration_ms = ((Process.clock_gettime(Process::CLOCK_MONOTONIC) - started_at) * 1000.0).round(3)
2188
2203
  if last_result.fetch(:success)
2189
2204
  return {
2190
2205
  success: true,
2191
2206
  exitstatus: last_result[:exitstatus],
2192
2207
  duration_ms: last_duration_ms,
2193
- attempts: attempt
2208
+ attempts: calls
2194
2209
  }
2195
2210
  end
2196
2211
 
@@ -2202,6 +2217,44 @@ module Kettle
2202
2217
  raise Kettle::Jem::Error, "#{step_name} failed: #{command.join(" ")}\n#{last_result[:stderr]}"
2203
2218
  end
2204
2219
 
2220
+ # Runs the command, repeating it (a bounded number of times, with a growing pause) only while it keeps failing
2221
+ # with a known transient Bundler race. Returns the last result and how many times the command ran.
2222
+ def call_command_with_transient_bundler_retry(command, chdir:, env:, quiet:, command_runner:)
2223
+ calls = 0
2224
+ loop do
2225
+ calls += 1
2226
+ result = command_runner.call(command, chdir: chdir, env: env, quiet: quiet)
2227
+ return [result, calls] if result.fetch(:success) || calls >= TRANSIENT_BUNDLER_RETRY_ATTEMPTS
2228
+ return [result, calls] unless transient_bundler_failure?(result[:stderr])
2229
+
2230
+ sleep(transient_bundler_retry_delay(calls))
2231
+ end
2232
+ end
2233
+
2234
+ # 2, 4, 8, 16, 16 seconds after the first, second, ... failed attempt.
2235
+ def transient_bundler_retry_delay(failed_attempts)
2236
+ [TRANSIENT_BUNDLER_RETRY_BASE_SECONDS * (2**(failed_attempts - 1)), TRANSIENT_BUNDLER_RETRY_MAX_SECONDS].min
2237
+ end
2238
+
2239
+ # Open3.capture3 with the same wait-and-retry for transient Bundler races, for probes whose failure would
2240
+ # otherwise be read as "nothing to do" and silently skip a step.
2241
+ def capture_with_transient_bundler_retry(env, *argv, chdir:)
2242
+ calls = 0
2243
+ loop do
2244
+ calls += 1
2245
+ stdout, stderr, status = Open3.capture3(env, *argv, chdir: chdir)
2246
+ return [stdout, stderr, status] if status.success? || calls >= TRANSIENT_BUNDLER_RETRY_ATTEMPTS
2247
+ return [stdout, stderr, status] unless transient_bundler_failure?(stderr)
2248
+
2249
+ sleep(transient_bundler_retry_delay(calls))
2250
+ end
2251
+ end
2252
+
2253
+ def transient_bundler_failure?(stderr)
2254
+ text = stderr.to_s
2255
+ TRANSIENT_BUNDLER_ERRORS.any? { |signature| text.include?(signature) }
2256
+ end
2257
+
2205
2258
  def git_operation_step_name?(step_name)
2206
2259
  %w[bootstrap_commit git_drivers].include?(step_name.to_s)
2207
2260
  end
@@ -3,6 +3,7 @@ name: Runtime Deps @ HEAD
3
3
 
4
4
  permissions:
5
5
  contents: read
6
+ checks: write
6
7
 
7
8
  env:
8
9
  # Kill stalled test workers instead of hanging until the CI job timeout.
@@ -254,4 +255,7 @@ jobs:
254
255
 
255
256
  - name: Tests for ${{ matrix.ruby }} via ${{ matrix.exec_cmd }}
256
257
  if: ${{ !env.ACT }}
257
- run: bundle exec ${{ matrix.exec_cmd }}
258
+ uses: Jitujoshi71/soft-fail@f7da29a0a0e5919c14e47b11370849a797a327e6 # v1.1.0
259
+ with:
260
+ run: bundle exec ${{ matrix.exec_cmd }}
261
+ check-name: Specs ${{ matrix.ruby }}@${{ matrix.appraisal }} (soft-fail)
@@ -5,6 +5,7 @@ name: Framework CI
5
5
 
6
6
  permissions:
7
7
  contents: read
8
+ checks: write
8
9
 
9
10
  env:
10
11
  # Kill stalled test workers instead of hanging until the CI job timeout.
@@ -80,5 +81,13 @@ jobs:
80
81
  rspec-status-framework-ci-${{matrix.ruby}}-${{matrix.framework_version}}-${{matrix.gemfile}}-${{hashFiles('**/Gemfile.lock','Appraisal.root.gemfile','gemfiles/**/*.gemfile')}}-
81
82
  rspec-status-framework-ci-${{matrix.ruby}}-${{matrix.framework_version}}-${{matrix.gemfile}}-
82
83
 
84
+ - name: Tests for ${{ matrix.ruby }}@${{ matrix.framework_version }} (soft-fail)
85
+ if: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
86
+ uses: Jitujoshi71/soft-fail@f7da29a0a0e5919c14e47b11370849a797a327e6 # v1.1.0
87
+ with:
88
+ run: bundle exec {KJ|CI:EXEC_CMD}
89
+ check-name: Specs ${{ matrix.ruby }}@${{ matrix.framework_version }} (soft-fail)
90
+
83
91
  - name: Tests for ${{ matrix.ruby }}@${{ matrix.framework_version }}
92
+ if: ${{ !(matrix.experimental || endsWith(matrix.ruby, 'head')) }}
84
93
  run: bundle exec {KJ|CI:EXEC_CMD}
@@ -2,6 +2,7 @@ name: Heads
2
2
 
3
3
  permissions:
4
4
  contents: read
5
+ checks: write
5
6
 
6
7
  env:
7
8
  # Kill stalled test workers instead of hanging until the CI job timeout.
@@ -95,7 +96,10 @@ jobs:
95
96
 
96
97
  - name: Tests for ${{ matrix.ruby }} via ${{ matrix.exec_cmd }}
97
98
  if: ${{ !env.ACT }}
98
- run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}
99
+ uses: Jitujoshi71/soft-fail@f7da29a0a0e5919c14e47b11370849a797a327e6 # v1.1.0
100
+ with:
101
+ run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}
102
+ check-name: Specs ${{ matrix.ruby }}@${{ matrix.appraisal }} (soft-fail)
99
103
 
100
104
  jruby:
101
105
  if: "(github.event_name != 'push' || (!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]'))) && (github.event_name != 'pull_request' || startsWith(github.head_ref, 'engines/') || startsWith(github.head_ref, 'jruby/') || startsWith(github.head_ref, 'feature/release') || startsWith(github.event.pull_request.title, 'Release '))"
@@ -159,4 +163,7 @@ jobs:
159
163
 
160
164
  - name: Tests for ${{ matrix.ruby }} via ${{ matrix.exec_cmd }}
161
165
  if: ${{ !env.ACT }}
162
- run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}
166
+ uses: Jitujoshi71/soft-fail@f7da29a0a0e5919c14e47b11370849a797a327e6 # v1.1.0
167
+ with:
168
+ run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}
169
+ check-name: Specs ${{ matrix.ruby }}@${{ matrix.appraisal }} (soft-fail)
@@ -2,6 +2,7 @@ name: JRuby 10.0
2
2
 
3
3
  permissions:
4
4
  contents: read
5
+ checks: write
5
6
 
6
7
  env:
7
8
  # Kill stalled test workers instead of hanging until the CI job timeout.
@@ -101,4 +102,7 @@ jobs:
101
102
 
102
103
  - name: Tests for ${{ matrix.ruby }} via ${{ matrix.exec_cmd }}
103
104
  if: ${{ !env.ACT }}
104
- run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}
105
+ uses: Jitujoshi71/soft-fail@f7da29a0a0e5919c14e47b11370849a797a327e6 # v1.1.0
106
+ with:
107
+ run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}
108
+ check-name: Specs ${{ matrix.ruby }}@${{ matrix.appraisal }} (soft-fail)
@@ -2,6 +2,7 @@ name: Current JRuby
2
2
 
3
3
  permissions:
4
4
  contents: read
5
+ checks: write
5
6
 
6
7
  env:
7
8
  # Kill stalled test workers instead of hanging until the CI job timeout.
@@ -101,4 +102,7 @@ jobs:
101
102
 
102
103
  - name: Tests for ${{ matrix.ruby }} via ${{ matrix.exec_cmd }}
103
104
  if: ${{ !env.ACT }}
104
- run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}
105
+ uses: Jitujoshi71/soft-fail@f7da29a0a0e5919c14e47b11370849a797a327e6 # v1.1.0
106
+ with:
107
+ run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}
108
+ check-name: Specs ${{ matrix.ruby }}@${{ matrix.appraisal }} (soft-fail)
@@ -49,7 +49,7 @@ jobs:
49
49
  path: ${{ runner.temp }}/report
50
50
  run-id: ${{ github.event.workflow_run.id }}
51
51
  github-token: ${{ github.token }}
52
- - uses: ruby/setup-ruby@145243922b4465b78e04dd66294782c7de45901f # v1.345.0
52
+ - uses: ruby/setup-ruby@13841a643d859a0b8166ebb0211afbf488121be4 # v1.346.0
53
53
  if: steps.report.outcome == 'success'
54
54
  with:
55
55
  ruby-version: ruby
@@ -144,7 +144,7 @@ jobs:
144
144
  - name: Setup the baseline's Ruby
145
145
  id: baseline-ruby
146
146
  if: steps.baseline.outputs.ruby != ''
147
- uses: ruby/setup-ruby@145243922b4465b78e04dd66294782c7de45901f # v1.345.0
147
+ uses: ruby/setup-ruby@13841a643d859a0b8166ebb0211afbf488121be4 # v1.346.0
148
148
  with:
149
149
  ruby-version: ${{ steps.baseline.outputs.ruby }}
150
150
  # The bundle for this Ruby too, which the baseline's workers load.
@@ -161,7 +161,7 @@ jobs:
161
161
 
162
162
  # The candidate's Ruby, from its version file (the same one Duel reads)
163
163
  - name: Setup Ruby & RubyGems
164
- uses: ruby/setup-ruby@145243922b4465b78e04dd66294782c7de45901f # v1.345.0
164
+ uses: ruby/setup-ruby@13841a643d859a0b8166ebb0211afbf488121be4 # v1.346.0
165
165
  with:
166
166
  bundler-cache: true
167
167
 
@@ -2,6 +2,7 @@ name: TruffleRuby 22.3
2
2
 
3
3
  permissions:
4
4
  contents: read
5
+ checks: write
5
6
 
6
7
  env:
7
8
  K_SOUP_COV_DO: false
@@ -84,4 +85,7 @@ jobs:
84
85
 
85
86
  - name: Tests for ${{ matrix.ruby }} via ${{ matrix.exec_cmd }}
86
87
  if: ${{ !env.ACT }}
87
- run: bundle exec ${{ matrix.exec_cmd }}
88
+ uses: Jitujoshi71/soft-fail@f7da29a0a0e5919c14e47b11370849a797a327e6 # v1.1.0
89
+ with:
90
+ run: bundle exec ${{ matrix.exec_cmd }}
91
+ check-name: Specs ${{ matrix.ruby }}@${{ matrix.appraisal }} (soft-fail)
@@ -2,6 +2,7 @@ name: TruffleRuby 23.1
2
2
 
3
3
  permissions:
4
4
  contents: read
5
+ checks: write
5
6
 
6
7
  env:
7
8
  K_SOUP_COV_DO: false
@@ -83,4 +84,7 @@ jobs:
83
84
 
84
85
  - name: Tests for ${{ matrix.ruby }} via ${{ matrix.exec_cmd }}
85
86
  if: ${{ !env.ACT }}
86
- run: bundle exec ${{ matrix.exec_cmd }}
87
+ uses: Jitujoshi71/soft-fail@f7da29a0a0e5919c14e47b11370849a797a327e6 # v1.1.0
88
+ with:
89
+ run: bundle exec ${{ matrix.exec_cmd }}
90
+ check-name: Specs ${{ matrix.ruby }}@${{ matrix.appraisal }} (soft-fail)
@@ -0,0 +1,44 @@
1
+ # Default ignored files
2
+ /shelf/
3
+ /workspace.xml
4
+ # Editor-based HTTP Client requests
5
+ /httpRequests/
6
+ # Datasource local storage ignored files
7
+ /dataSources/
8
+ /dataSources.local.xml
9
+
10
+ # Zencoder local files
11
+ /zencoder/chats
12
+ /zencoder-chat-index.xml
13
+ /zencoder-chats-dedicated.xml
14
+ # Local project config
15
+ *.iml
16
+
17
+ # Added: Ignore plugin state artifacts (machine-specific)
18
+ /copilot*.xml
19
+ /GitLink.xml
20
+
21
+ # Added: Ignore task & usage statistics (contain local timestamps / paths)
22
+ /tasks.xml
23
+ /usage.statistics.xml
24
+
25
+ # Added: Local inspection profiles (developer-specific customizations)
26
+ /inspectionProfiles/
27
+
28
+ # Added: Library & index caches (regenerated per machine)
29
+ /libraries/
30
+ /indexLayout.xml
31
+ /indexes/
32
+
33
+ # Added: Terminal, SSH, and other per-user runtime config
34
+ /terminal/
35
+ /sshConfigs/
36
+
37
+ # Added: RubyMine misc SDK version drift (optional). Comment to share SDK config.
38
+ # /misc.xml
39
+
40
+ # Commit: VCS local mappings can be regenerated (optional). Comment to share settings.
41
+ # /vcs.xml
42
+
43
+ # Commit: Dictionary files (local spellcheck customizations)
44
+ # /dictionaries/
@@ -119,6 +119,14 @@ dependency_conflicts:
119
119
  modular: gemfiles/modular/runtime_heads.gemfile
120
120
  action: keep_both
121
121
  reason: "The gemspec declares the released runtime contract while runtime_heads intentionally tests version_gem from main."
122
+ # Destinations templated while kettle-drift briefly appeared in the
123
+ # gemspec template may carry the direct declaration; it is externalized
124
+ # (modular-owned) and the direct declaration is always a stale duplicate.
125
+ - gem: kettle-drift
126
+ direct: "{KJ|GEMSPEC_PATH}"
127
+ modular: gemfiles/modular/templating.gemfile
128
+ action: remove_direct_gem
129
+ reason: "kettle-drift is externalized: dependency ownership belongs to gemfiles/modular/templating.gemfile; a direct gemspec declaration is a stale duplicate."
122
130
 
123
131
  # This project's identifying emoji.
124
132
  # Used as the leading emoji in the README H1 heading and in the gemspec
@@ -205,6 +213,9 @@ rubygems:
205
213
  # monorepo-subproject - project URLs point at a subdirectory in the repository root
206
214
  #
207
215
  # ENV override: KJ_REPOSITORY_TOPOLOGY
216
+ #
217
+ # `ci: own` (monorepo-subproject only): this member runs its own workflows, so README CI and coverage
218
+ # badges are taken from its own .github instead of the monorepo root's. Default: root.
208
219
  repository:
209
220
  topology: standalone
210
221
 
@@ -276,6 +287,15 @@ workflows:
276
287
  # off, kettle-jem neither writes nor removes .duel.rb, perf.yml, perf-comment.yml, or
277
288
  # duel.gemfile, so a project's own copies stay as they are.
278
289
  # duel: true
290
+ # Soft-fail dependency-drift workflows: their test step reports a neutral
291
+ # check run (via Jitujoshi71/soft-fail, with the tail of the test output)
292
+ # instead of failing the workflow, so upstream gem breakage warns visibly
293
+ # without turning unrelated PRs red. Accepts a list of workflow names;
294
+ # supported: dep-heads (ruby & truffleruby jobs; the jruby job is always
295
+ # soft-fail) and unlocked_deps.
296
+ # soft_fail:
297
+ # - dep-heads
298
+ # - unlocked_deps
279
299
  # preset: framework
280
300
  # framework_matrix:
281
301
  # dimension: activerecord
@@ -350,35 +370,9 @@ workflows:
350
370
  readme:
351
371
  top_logos: org
352
372
  h2_synopsis_logos: related-org,ruby
353
- # Optional corporate sponsor logos shown near the top of the generated README.
354
- # These entries are template-managed and render a compact logo row that links
355
- # down to the generated FLOSS Funding section. Configure project-specific
356
- # sponsors here; configure family-wide sponsors in kettle-family's config.
357
- #
358
- # corporate_sponsors:
359
- # - name: Example Corp
360
- # target_href: https://example.com
361
- # image_src: https://example.com/logo.svg
362
- # # Legacy aliases remain accepted: url and img_src.
363
- # # Optional sponsorship window (ISO 8601 dates).
364
- # # `since` is the first day shown; `until` is the last day shown.
365
- # # Omit either bound for an open-ended period.
366
- # # since: 2026-01-01
367
- # # until: 2026-12-31
368
- # An umbrella sponsor (an organization that itself is funded by companies,
369
- # e.g. Alpha-Omega) may list its backers as members. The umbrella renders in
370
- # the top logo row; members render as linked names in a "backed by" caption
371
- # in the FLOSS Funding detail block. Members require name and target_href
372
- # (legacy url is accepted), accept the same optional since/until window,
373
- # and cannot themselves have members.
374
- #
375
- # corporate_sponsors:
376
- # - name: Alpha-Omega
377
- # target_href: https://alpha-omega.dev
378
- # image_src: https://alpha-omega.dev/logo.svg
379
- # members:
380
- # - name: Example Corp
381
- # target_href: https://example.com
373
+ # Corporate sponsor badges are managed independently in `.kettle/sponsors.yml`
374
+ # via the `kettle-sponsors` plugin (listed under `plugins:` below by default). Legacy `corporate_sponsors` entries left here are migrated once into
375
+ # `.kettle/sponsors.yml` and pruned automatically by `kettle-sponsors`.
382
376
  # Optional package-family README block.
383
377
  # Supported values: structuredmerge
384
378
  # Leave unset for standalone kettle-rb gems and most projects.
@@ -552,6 +546,7 @@ git_drivers: semantic-diff
552
546
  # - `duplicate_check` runs last, after all template writes are complete.
553
547
  plugins:
554
548
  - kettle-drift
549
+ - kettle-sponsors
555
550
 
556
551
  # Default merge options
557
552
  defaults: