Skip to content

Conversation

@exoego
Copy link
Owner

@exoego exoego commented Dec 2, 2025

To prevent issues like #277

@exoego exoego added the chore label Dec 2, 2025
@exoego exoego marked this pull request as ready for review December 2, 2025 12:03
@codecov
Copy link

codecov bot commented Dec 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.46%. Comparing base (5d13866) to head (5cf58ba).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #278   +/-   ##
=======================================
  Coverage   98.46%   98.46%           
=======================================
  Files          20       20           
  Lines         717      717           
  Branches      178      178           
=======================================
  Hits          706      706           
  Misses         11       11           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@exoego exoego requested a review from Copilot December 2, 2025 13:07
Copilot finished reviewing on behalf of exoego December 2, 2025 13:10
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR automates the gem release process for rspec-openapi by introducing a GitHub Actions workflow that handles version bumping, git operations, RubyGems publishing via trusted publishing, and GitHub release creation. This addresses issue #277 by replacing the manual release process with an automated workflow.

Key Changes:

  • Adds new GitHub Actions release workflow triggered manually via workflow_dispatch with version input
  • Updates README documentation to describe the new automated release process

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
.github/workflows/push_gem.yml New workflow that automates version bumping, validation, git commits, RubyGems publishing, and GitHub release creation
README.md Updates release instructions to reference the new automated workflow instead of manual steps

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +49 to +50
unless new_version < current_version
warn "Given version (#{new_version}) must be lower than current version (#{current_version})"
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version comparison logic is inverted. The condition should check if new_version > current_version (using > operator), not <. Currently it requires the new version to be lower than the current version, which prevents version bumps. This will cause all release attempts to fail.

Suggested change
unless new_version < current_version
warn "Given version (#{new_version}) must be lower than current version (#{current_version})"
unless new_version > current_version
warn "Given version (#{new_version}) must be greater than current version (#{current_version})"

Copilot uses AI. Check for mistakes.
Comment on lines +49 to +50
unless new_version < current_version
warn "Given version (#{new_version}) must be lower than current version (#{current_version})"
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message is incorrect. It states "must be lower than" when it should state "must be greater than" to match the intended behavior of a version bump.

Suggested change
unless new_version < current_version
warn "Given version (#{new_version}) must be lower than current version (#{current_version})"
unless new_version > current_version
warn "Given version (#{new_version}) must be greater than current version (#{current_version})"

Copilot uses AI. Check for mistakes.
end
RUBY
ruby -pi -e "sub(/VERSION = .*/, \"VERSION = '$version'\")" lib/rspec/openapi/version.rb
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The string substitution doesn't preserve the quotes around the version string. The regex replacement should be "VERSION = '\\$version'" (with single quotes around $version) to match the existing format in version.rb which uses VERSION = '0.21.2'.

Suggested change
ruby -pi -e "sub(/VERSION = .*/, \"VERSION = '$version'\")" lib/rspec/openapi/version.rb
ruby -pi -e "sub(/VERSION = '.*'/, \"VERSION = '$version'\")" lib/rspec/openapi/version.rb

Copilot uses AI. Check for mistakes.
3. Push tag
1. Ensure RubyGems trusted publishing is configured for this repo and gem ownership (see [Trusted publishing](https://guides.rubygems.org/trusted-publishing/)).
2. In GitHub Actions, run the `release` workflow manually and input the new version (`0.21.x` or `v0.21.x`).
3. The workflow bumps `lib/rspec/openapi/version.rb`, pushes the change to the default branch, publishes to RubyGems via `rubygems/release-gem`, and creates a GitHub release with autogenerated notes.
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change "autogenerated" to "auto-generated" (hyphenated) for proper spelling.

Suggested change
3. The workflow bumps `lib/rspec/openapi/version.rb`, pushes the change to the default branch, publishes to RubyGems via `rubygems/release-gem`, and creates a GitHub release with autogenerated notes.
3. The workflow bumps `lib/rspec/openapi/version.rb`, pushes the change to the default branch, publishes to RubyGems via `rubygems/release-gem`, and creates a GitHub release with auto-generated notes.

Copilot uses AI. Check for mistakes.

permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
contents: write # IMPORTANT: this permission is required for `rake release` to push the release tag
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment references "rake release" but the workflow actually uses rubygems/release-gem@v1 (line 68). Update the comment to match the actual implementation, e.g., "IMPORTANT: this permission is required for pushing commits and creating tags".

Suggested change
contents: write # IMPORTANT: this permission is required for `rake release` to push the release tag
contents: write # IMPORTANT: this permission is required for pushing commits and creating tags

Copilot uses AI. Check for mistakes.
@exoego exoego merged commit c2ee2cd into master Dec 2, 2025
20 checks passed
@exoego exoego deleted the automate-release branch December 2, 2025 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants