Skip to content

kettle-release is not cold-start safe: borrowed bundles (changelog tool, coverage) are never installed #67

Closed

Description

@pboling

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:

  1. The changelog tool bundle (release_changelog_gemfile — e.g. the kettle-changelog checkout's gemfiles/release.gemfile, used as BUNDLE_GEMFILE for bundle exec kettle-changelog)
  2. The member's coverage bundle (changelog_coverage_gemfile — gemfiles/coverage.gemfile, exec'd by kettle-changelog's coverage step via K_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_gemfile and changelog_coverage_gemfile (when present): bundle install with BUNDLE_GEMFILE set and BUNDLE_LOCKFILE pointed at a disposable copy under tmp/kettle-release/lockfiles/ (existing release_task_lockfile_path pattern), so the install can never dirty the member's or tool repo's canonical lockfile.
  • bundle install is 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions