Skip to content

Implement draft-release workflow#112

Open
IgorDobryn wants to merge 2 commits into
mainfrom
implement-draft-release-workflow-for-ruby-sdks
Open

Implement draft-release workflow#112
IgorDobryn wants to merge 2 commits into
mainfrom
implement-draft-release-workflow-for-ruby-sdks

Conversation

@IgorDobryn

@IgorDobryn IgorDobryn commented Jun 30, 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 automated draft release creation with version bump selection, release notes generation, changelog updates, and a draft GitHub release.
  • Chores
    • Added safeguards to prevent duplicate release tags and to keep release runs from overlapping.

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The placeholder draft-release GitHub Actions workflow is replaced with an end-to-end release automation job. It computes the next semver version, updates the gem version file and changelog, generates release notes from merged PRs, opens a release PR, and creates a draft GitHub release, with added concurrency settings and explicit permissions.

Changes

Draft Release Workflow

Layer / File(s) Summary
Workflow header, concurrency, and permissions
.github/workflows/draft-release.yml
Updates the descriptive header comments and adds concurrency grouping plus explicit contents: write and pull-requests: write permissions.
Release automation job logic
.github/workflows/draft-release.yml
Implements checkout, version reading, next-tag computation, tag-existence check, release notes generation, conditional version file and changelog updates, release PR creation, and draft release creation.

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

Sequence Diagram(s)

sequenceDiagram
  participant Trigger as workflow_dispatch
  participant Job as draft-release job
  participant Repo as Repository (lib/mailtrap/version.rb, CHANGELOG.md)
  participant GitHub as GitHub API

  Trigger->>Job: bump_type input
  Job->>Repo: checkout main
  Job->>Repo: read current version
  Job->>Job: compute next semver tag
  Job->>GitHub: check if tag exists
  GitHub-->>Job: tag status
  Job->>GitHub: generate release notes from merged PRs
  Job->>Repo: update lib/mailtrap/version.rb
  Job->>Repo: prepend CHANGELOG.md
  Job->>GitHub: open release PR to main
  Job->>GitHub: create draft release
Loading

Suggested labels: ci, release, automation

Suggested reviewers: mailtrap maintainers familiar with the release process

Poem:
A rabbit hops through YAML lines,
Bumping versions, drafting signs,
Changelog stacked, a PR born,
A draft release before the morn,
Hop, hop—release day nears! 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding the draft-release workflow.
Description check ✅ Passed The description covers Motivation, Changes, and How to test; only the optional Images and GIFs section is missing.
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.

Base automatically changed from MT-22783-add-draft-release-workflow-placeholder-for-sdk-repos to main July 1, 2026 06:24
@IgorDobryn IgorDobryn force-pushed the implement-draft-release-workflow-for-ruby-sdks branch from fe68971 to c706cee Compare July 1, 2026 06:31
@IgorDobryn IgorDobryn force-pushed the implement-draft-release-workflow-for-ruby-sdks branch from c706cee to 8be3224 Compare July 1, 2026 06:50
@IgorDobryn IgorDobryn marked this pull request as ready for review July 1, 2026 07:58

@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

🤖 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 31-34: The workflow still uses mutable action refs and keeps
checkout credentials available, so harden the release job by updating the
`actions/checkout` step to disable persisted credentials and pinning every
`railsware/github-actions/*` usage in the release workflow to an immutable SHA
instead of `@master`. Review the release job steps around `actions/checkout` and
the `railsware/github-actions` invocations, add `persist-credentials: false` to
checkout, and pass an explicit token only to the PR-opening step if it truly
needs write access.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7b8afa4d-b9da-4e82-80b1-2943fc2aa552

📥 Commits

Reviewing files that changed from the base of the PR and between 0243225 and 8be3224.

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

Comment thread .github/workflows/draft-release.yml
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could we use v4 already?

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.

2 participants