Skip to content

THRIFT-6395: Fix the Ruby gem release workflow and limit it to release tags - #3982

Merged
Jens-G merged 1 commit into
apache:masterfrom
Jens-G:THRIFT-6395
Oct 1, 2026
Merged

Jens-G merged 1 commit into
apache:masterfrom
Jens-G:THRIFT-6395

Conversation

@Jens-G

@Jens-G Jens-G commented Sep 30, 2026

Copy link
Copy Markdown
Member

THRIFT-6395

The Release Ruby Gem workflow 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-gem runs bundle exec rake release, and the job never installs the bundle, since THRIFT-5965 turned bundler-cache off.

Changes to .github/workflows/release_ruby.yml

  • A step installs the bundle, frozen to Gemfile.lock. It does not use bundler-cache, so the publishing job restores no cache.
  • A step checks that the run is for a vX.Y.Z release tag and that thrift.gemspec has that version, as release_rust.yml does 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 push v0.26.0 and publish 0.26.0.
  • contents: read instead of write, so the job cannot push a tag.
  • Pre-releases are skipped, as in the other publishing workflows.

doc/ReleaseManagement.md gets 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 from Gemfile.lock. Nothing can be published: gem_push=no, and the scratch repository has no remote.

Case master this PR
release, tag v0.26.0 Bundler::GemNotFound check passes, bundle installs, thrift-0.26.0.gem built, "Tag v0.26.0 has already been created."
manual run from master Bundler::GemNotFound stops at the check: not a release tag
tag v0.25.0 on a 0.26.0 tree Bundler::GemNotFound stops at the check: version mismatch

With the install step but without the check, a run from master builds the gem and then runs git push for 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, workflow release_ruby.yml, environment release.

🤖 Generated with Claude Code

…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>
@mergeable mergeable Bot added the github_actions Pull requests that update GitHub Actions code label Sep 30, 2026
@Jens-G
Jens-G merged commit 4de2010 into apache:master Oct 1, 2026
117 of 118 checks passed
@Jens-G
Jens-G deleted the THRIFT-6395 branch October 1, 2026 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant