Repository navigation
THRIFT-6395: Fix the Ruby gem release workflow and limit it to release tags - #3982
Merged
Merged
Conversation
…e tags Client: rb The workflow has never published a gem. Its release-gem step runs "bundle exec rake release", but the job does not install the bundle, since THRIFT-5965 turned bundler-cache off. Replayed in ruby:4.0 with Bundler 2.2.34, it fails with Bundler::GemNotFound. A step now installs the bundle, frozen to Gemfile.lock. It does not go through bundler-cache, because a job that publishes should not restore a cache. With the bundle installed, Bundler's release task would create and push the version tag if it does not exist yet, and then publish. The workflow can be started by hand from any branch, so a run from master would push a v0.26.0 tag and publish 0.26.0. The job now checks that it runs for a release tag matching the gemspec version, as release_rust.yml does for the crate, and it gets contents: read, so it cannot push a tag at all. Pre-releases are skipped, as in the other publishing workflows. doc/ReleaseManagement.md gets an entry for the workflow. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
THRIFT-6395
The
Release Ruby Gemworkflow has never published a gem. The runs for 0.24.0 and 0.25.0 stopped at the trusted publishing step, and both gems were pushed by hand. With a trusted publisher on RubyGems.org it would still fail one step later:rubygems/release-gemrunsbundle exec rake release, and the job never installs the bundle, since THRIFT-5965 turnedbundler-cacheoff.Changes to
.github/workflows/release_ruby.ymlGemfile.lock. It does not usebundler-cache, so the publishing job restores no cache.vX.Y.Zrelease tag and thatthrift.gemspechas that version, asrelease_rust.ymldoes for the crate. Bundler's release task pushes the version tag if it does not exist yet, so without the check a manual run from master would pushv0.26.0and publish 0.26.0.contents: readinstead ofwrite, so the job cannot push a tag.doc/ReleaseManagement.mdgets a[ruby]entry.Verification
A script replays the job's steps from the workflow file in
ruby:4.0, with Bundler 2.2.34, the version setup-ruby installs fromGemfile.lock. Nothing can be published:gem_push=no, and the scratch repository has no remote.v0.26.0Bundler::GemNotFoundthrift-0.26.0.gembuilt, "Tag v0.26.0 has already been created."masterBundler::GemNotFoundv0.25.0on a 0.26.0 treeBundler::GemNotFoundWith the install step but without the check, a run from
masterbuilds the gem and then runsgit pushfor the new tag, which fails in the replay only because there is no remote.actionlint and zizmor (
--persona regular, with a token) report nothing.After this is merged, RubyGems.org still needs a trusted publisher for
apache/thrift, workflowrelease_ruby.yml, environmentrelease.🤖 Generated with Claude Code