Repository navigation
Fix release: bundler frozen mode and silent rake docs:build failure - #2696
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #2694. The last release workflow run 32759987499 reported success, but the resulting release PR (#2695) has stale docs because
rake docs:buildsilently failed:Root cause
ruby/setup-rubywithbundler-cache: trueenables Bundler's frozen mode. Afterscript/releasebumps the gemspec version,bundle(install) refuses to rewriteGemfile.lock, leaving the lockfile pointing at the old version.bundle exec rake docs:buildthen 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=falseandexport BUNDLE_DEPLOYMENT=falseat the top of the script so every bundler invocation can rewrite the lockfile after the version bump.update_gemfilesfrombundle(install) tobundle lock, matching what the appraisal loop already does — gems are already installed bysetup-ruby; we only need to refresh the lockfile.script/sync_contributors.rborrake docs:buildreturns non-zero, so a broken release can never be pushed again.I skipped
set -euo pipefailbecause the existing script relies on pipelines that intentionally return non-zero (e.g.grep "PRE = " ... | grep -o "\"[^\"]*\""whenPRE = nil); explicit checks on the failing step are safer than blanket strict mode here.