Implement draft-release workflow - #59
Conversation
📝 WalkthroughWalkthroughThe placeholder ChangesDraft Release Workflow
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
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
.github/workflows/draft-release.yml (2)
27-30: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low valueNo
timeout-minutesset 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 valueHeredoc fully rewrites
version.rbrather 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 targetedsedsubstitution 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
📒 Files selected for processing (1)
.github/workflows/draft-release.yml
Motivation
Automate releases
Changes
How to test
Summary by CodeRabbit