Skip to content

Fix release: bundler frozen mode and silent rake docs:build failure - #2696

Merged
joelhawksley merged 1 commit into
mainfrom
joelhawksley-redesigned-sniffle
Aug 24, 2026
Merged

joelhawksley merged 1 commit into
mainfrom
joelhawksley-redesigned-sniffle

Conversation

@joelhawksley

Copy link
Copy Markdown
Member

Follow-up to #2694. The last release workflow run 32759987499 reported success, but the resulting release PR (#2695) has stale docs because rake docs:build silently failed:

bundler: failed to load command: rake
The gemspecs for path gems changed, but the lockfile can't be updated
because frozen mode is set (Bundler::ProductionError)

Root cause

ruby/setup-ruby with bundler-cache: true enables Bundler's frozen mode. After script/release bumps the gemspec version, bundle (install) refuses to rewrite Gemfile.lock, leaving the lockfile pointing at the old version. bundle exec rake docs:build then aborts on the gemspec/lockfile mismatch. The script had no exit-code check on that step, so the release continued and pushed a PR with un-rebuilt docs.

Fix

  • export BUNDLE_FROZEN=false and export BUNDLE_DEPLOYMENT=false at the top of the script so every bundler invocation can rewrite the lockfile after the version bump.
  • Switch update_gemfiles from bundle (install) to bundle lock, matching what the appraisal loop already does — gems are already installed by setup-ruby; we only need to refresh the lockfile.
  • Fail hard if script/sync_contributors.rb or rake docs:build returns non-zero, so a broken release can never be pushed again.

I skipped set -euo pipefail because the existing script relies on pipelines that intentionally return non-zero (e.g. grep "PRE = " ... | grep -o "\"[^\"]*\"" when PRE = nil); explicit checks on the failing step are safer than blanket strict mode here.

setup-ruby's `bundler-cache: true` sets frozen mode, which prevents
`bundle install` from updating Gemfile.lock after script/release
bumps the gemspec version. The stale lockfile then makes
`bundle exec rake docs:build` fail with:

  The gemspecs for path gems changed, but the lockfile can't be updated
  because frozen mode is set

Because the script had no error handling on that command, the failure
was silently ignored and the release PR was pushed with unbuilt docs.

Fix both problems:

- Export BUNDLE_FROZEN=false and BUNDLE_DEPLOYMENT=false at the top of
  the script so every bundler invocation can rewrite the lockfile.
- Switch `update_gemfiles` from `bundle` (install) to `bundle lock`,
  matching the appraisal loop — we only need the lockfile refreshed,
  gems are already installed by setup-ruby.
- Fail the script when `sync_contributors.rb` or `rake docs:build`
  returns non-zero, so a broken release cannot be pushed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 217f0a0d-a9f2-4607-9643-5fcb3e34f20f
@joelhawksley
joelhawksley merged commit 690a9cf into main Aug 24, 2026
22 of 24 checks passed
@joelhawksley
joelhawksley deleted the joelhawksley-redesigned-sniffle branch August 24, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant