Repository navigation
Description
Problem
kettle-release cannot run from a cold bundle state — e.g. after a Ruby version upgrade, when the new Ruby's gem home is empty. It fails deep in the pipeline with a raw Bundler::GemNotFound instead of a clear environment error.
Observed on the kettle-dev 3.1.31 release (first release attempted after the Ruby 4.0.9 → 4.0.10 upgrade): release_changelog died with
bundler: failed to load command: kettle-changelog
Bundler::GemNotFound: Could not find ast-crispr-markdown-markly-7.1.17, ast-crispr-7.1.17,
markdown-merge-7.1.17, markly-merge-7.1.17, ast-merge-7.1.17, tree_haver-7.1.17 in locally installed gems
Root cause
The release installs the bundles it OWNS — the member's Gemfile and Appraisal.root.gemfile are materialized up front (materialize_release_lockfiles_for_release_tasks!) — but it execs two bundles it BORROWS and never installs:
- The changelog tool bundle (
release_changelog_gemfile— e.g. the kettle-changelog checkout'sgemfiles/release.gemfile, used asBUNDLE_GEMFILEforbundle exec kettle-changelog) - The member's coverage bundle (
changelog_coverage_gemfile—gemfiles/coverage.gemfile, exec'd by kettle-changelog's coverage step viaK_CHANGELOG_COVERAGE_GEMFILE)
bundle exec never auto-installs, so both must be ambiently installed. A Ruby upgrade (or any fresh gem home) silently violates that assumption, and the failure surfaces mid-publish with a bare resolver error. Every release after a Ruby upgrade will hit this until fixed.
Note the ordering constraint: the changelog step runs inside step 0 (pre-release checks) and needs the coverage bundle EARLY — appraisal bundle installs happen later and don't cover it.
Proposed fix
In kettle-release, install the borrowed bundles before the changelog step execs them (self-healing at the point of use, so every invocation path — standalone step 0, family-driven phases, resumes — is covered):
- For each of
release_changelog_gemfileandchangelog_coverage_gemfile(when present):bundle installwithBUNDLE_GEMFILEset andBUNDLE_LOCKFILEpointed at a disposable copy undertmp/kettle-release/lockfiles/(existingrelease_task_lockfile_pathpattern), so the install can never dirty the member's or tool repo's canonical lockfile. bundle installis idempotent and fast on a warm machine, so this is safe to run unconditionally when the changelog step runs.
Acceptance criteria
- A release on a fresh gem home (no bundle pre-installed) passes the changelog step without manual
bundle install. - Neither borrowed bundle's canonical lockfile is modified (disposable lockfile used for the install).
- A borrowed bundle with no lockfile at all installs against a tmp lockfile, never creating one in the repo.
- Specs cover: install runs before the changelog command for both bundles, no install when the step is skipped, no dirtying of canonical lockfiles.
Activity