Skip to content

Implement draft-release workflow - #59

Merged
IgorDobryn merged 1 commit into
mainfrom
implement-draft-release-workflow-for-ruby-sdks
Jul 2, 2026
Merged

Implement draft-release workflow#59
IgorDobryn merged 1 commit into
mainfrom
implement-draft-release-workflow-for-ruby-sdks

Conversation

@IgorDobryn

@IgorDobryn IgorDobryn commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Motivation

Automate releases

Changes

  • Implement draft release

How to test

  • Trigger draft-release workflow for this branch
  • Assert that new release PR is created with changes similar to manual release
  • Assert draft Github release is created

Summary by CodeRabbit

  • New Features
    • Added a working draft release workflow to automate release preparation.
    • It now calculates the next version, generates release notes, updates the changelog, and creates a draft GitHub release.
    • The workflow also checks for existing release tags and opens a release pull request when needed.

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The placeholder draft-release.yml GitHub Actions workflow is replaced with a functional release pipeline that computes the next semver version, generates release notes, updates the changelog and version file, opens a release PR, and creates a draft GitHub release.

Changes

Draft Release Workflow

Layer / File(s) Summary
Draft release pipeline
.github/workflows/draft-release.yml
Adds concurrency settings and write permissions; checks out main, sets up Ruby, reads current version, computes next semver from bump_type, aborts if tag exists, generates release notes, updates version file and CHANGELOG.md, commits/pushes, opens a release PR, and creates a draft GitHub release, replacing the previous echo-inputs placeholder.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Trigger as workflow_dispatch
  participant CI as GitHub Actions Job
  participant Repo as Git Repository
  participant GitHub as GitHub Release API

  Trigger->>CI: bump_type input
  CI->>Repo: checkout main
  CI->>Repo: read version.rb
  CI->>CI: compute next semver
  CI->>Repo: check if tag exists
  CI->>GitHub: generate release notes from PR history
  CI->>Repo: update version.rb, CHANGELOG.md
  CI->>Repo: commit and push changes
  CI->>GitHub: open release PR
  CI->>GitHub: create draft release
Loading

Possibly related PRs

  • mailtrap/actionmailer-balancer#58: Adds the original placeholder .github/workflows/draft-release.yml with the same workflow_dispatch/bump_type input that this PR fully implements.

Suggested reviewers: DagonWat, mklocek

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: adding a draft-release workflow.
Description check ✅ Passed The description covers the required Motivation, Changes, and How to test sections and is mostly complete.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch implement-draft-release-workflow-for-ruby-sdks

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@IgorDobryn
IgorDobryn marked this pull request as ready for review July 1, 2026 09:44

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
.github/workflows/draft-release.yml (2)

27-30: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low value

No timeout-minutes set on the job.

If any external action (e.g. dependency install, PR creation) hangs, the job could run until the default 6-hour GitHub Actions limit. Consider adding an explicit timeout.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/draft-release.yml around lines 27 - 30, The draft-release
job is missing an explicit timeout, so add a timeout limit to the draft-release
job definition in the workflow. Update the job configuration for draft-release
in the GitHub Actions YAML so long-running or hanging steps are capped, using
the existing job name as the anchor point.

65-78: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Heredoc fully rewrites version.rb rather than substituting the version string.

Hardcoding the entire file template works with the current format, but any future change to comments/structure in lib/actionmailer/balancer/version.rb (outside this workflow) will silently be reverted by this step. A targeted sed substitution of the version string would be more robust.

♻️ Alternative using in-place substitution
-          cat > "./lib/actionmailer/balancer/version.rb" <<EOF
-          # frozen_string_literal: true
-
-          module ActionMailer
-            module Balancer
-              VERSION = '${NEXT}'
-            end
-          end
-          EOF
+          sed -i "s/VERSION = '.*'/VERSION = '${NEXT}'/" "./lib/actionmailer/balancer/version.rb"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/draft-release.yml around lines 65 - 78, The “Update
version in version file” step is overwriting the entire version.rb file with a
heredoc instead of just updating the VERSION value. Replace the full-file
rewrite with a targeted in-place substitution that only changes the version
string in lib/actionmailer/balancer/version.rb, keeping the existing file
structure/comments intact. Use the current workflow step and the VERSION
constant as the main anchors when updating the run script.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/draft-release.yml:
- Around line 49-107: The draft release workflow still references
railsware/github-actions steps from the mutable master ref, which should be
replaced with immutable tags or commit SHAs. Update each affected action in
draft-release.yml, including compute-next-semver, abort-if-tag-exists,
generate-release-notes, prepend-changelog, open-sdk-release-pr, and
create-draft-github-release, so the workflow is pinned to fixed refs and cannot
change unexpectedly.

---

Nitpick comments:
In @.github/workflows/draft-release.yml:
- Around line 27-30: The draft-release job is missing an explicit timeout, so
add a timeout limit to the draft-release job definition in the workflow. Update
the job configuration for draft-release in the GitHub Actions YAML so
long-running or hanging steps are capped, using the existing job name as the
anchor point.
- Around line 65-78: The “Update version in version file” step is overwriting
the entire version.rb file with a heredoc instead of just updating the VERSION
value. Replace the full-file rewrite with a targeted in-place substitution that
only changes the version string in lib/actionmailer/balancer/version.rb, keeping
the existing file structure/comments intact. Use the current workflow step and
the VERSION constant as the main anchors when updating the run script.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 98188bc4-b7a7-4acb-bfa7-27d46905a774

📥 Commits

Reviewing files that changed from the base of the PR and between 79a5e87 and 0c0b572.

📒 Files selected for processing (1)
  • .github/workflows/draft-release.yml

Comment thread .github/workflows/draft-release.yml
@IgorDobryn
IgorDobryn merged commit 59768c7 into main Jul 2, 2026
5 checks passed
@IgorDobryn
IgorDobryn deleted the implement-draft-release-workflow-for-ruby-sdks branch July 2, 2026 12:12
This was referenced Jul 2, 2026
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.

3 participants