-
-
Notifications
You must be signed in to change notification settings - Fork 17
feat: split bump-version into bump-patch and bump-minor commands #538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Updated GitHub Actions workflow to accept version_type input (patch/minor) - Modified bump-version.ts script to support both patch and minor version increments - Patch: increments patch version (e.g., 3.0.5 → 3.0.6) - Minor: increments minor version and resets patch to 0 (e.g., 3.0.5 → 3.1.0) - Replaced single bump-version command with two separate commands: - bump-patch: triggers workflow with version_type=patch - bump-minor: triggers workflow with version_type=minor 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
📝 WalkthroughWalkthroughThe pull request enhances version management by introducing parameterized version bumping. A new Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 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 |
|
Claude finished @ymc9's task —— View job PR Review Complete ✅I've reviewed this PR that splits bump-version into separate bump-patch and bump-minor commands. Todo List
Review Feedback✅ Code Quality & Best PracticesThe implementation is well-structured with clean separation of concerns:
✅ GitHub Workflow ChangesThe workflow changes in
✅ Script LogicThe
|
There was a problem hiding this 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 refactors version management by splitting the single bump-version command into two separate commands (bump-patch and bump-minor) to provide more granular control over semantic versioning.
- Introduces
bump-patchcommand to increment patch versions (e.g., 3.0.5 → 3.0.6) - Introduces
bump-minorcommand to increment minor versions and reset patch to 0 (e.g., 3.0.5 → 3.1.0) - Updates the bump-version script to accept a version type parameter with proper validation
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| .github/workflows/bump-version.yml | Added workflow_dispatch input parameter version_type with dropdown choices (patch/minor) and updated the script invocation to pass this parameter |
| scripts/bump-version.ts | Modified incrementVersion() to accept and handle 'patch' or 'minor' type parameter; added command-line argument parsing and validation |
| package.json | Replaced bump-version command with two new commands bump-patch and bump-minor that trigger the workflow with appropriate version_type input |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
scripts/bump-version.ts (1)
66-66: Optional: Simplify by leveraging the default parameter.The
|| 'patch'fallback is redundant sinceincrementVersionalready defaults to'patch'. You could simplify toincrementVersion(rootVersion, versionType)for cleaner code, though the current approach is more explicit.🔎 Proposed simplification
-const newVersion = incrementVersion(rootVersion, versionType || 'patch'); +const newVersion = incrementVersion(rootVersion, versionType);
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/bump-version.ymlpackage.jsonscripts/bump-version.ts
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Use Turbo for build orchestration and run `pnpm build`, `pnpm watch`, `pnpm lint`, and `pnpm test` for development tasks
Applied to files:
package.json
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to ide/vscode/**/{package.json,version.ts} : The VSCode IDE extension package should maintain a different version from other packages to comply with VSCode Marketplace requirements
Applied to files:
scripts/bump-version.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: build-test (22.x, postgresql)
- GitHub Check: build-test (22.x, sqlite)
🔇 Additional comments (5)
scripts/bump-version.ts (2)
35-49: LGTM! Well-implemented version bumping logic.The function correctly handles both patch and minor version bumps with comprehensive validation. The semantic version format check and numeric component validation ensure robustness, and the increment logic is mathematically sound.
51-55: LGTM! Appropriate CLI argument handling.The command-line argument parsing correctly reads the version type and validates it with a clear error message for invalid inputs.
.github/workflows/bump-version.yml (2)
5-12: LGTM! Well-structured workflow input.The
version_typeinput is correctly defined with appropriate constraints. Thechoicetype provides a user-friendly dropdown in the GitHub Actions UI, and therequired: trueflag ensures the workflow always receives a valid value.
45-45: LGTM! Correct input propagation.The workflow input is correctly passed to the bump-version script as a command-line argument, completing the integration between the workflow and the script.
package.json (1)
19-20: LGTM! Clean separation of bump commands.The new scripts correctly invoke the workflow with the appropriate
version_typevalues. The-fflag is the correct option for passing workflow inputs togh workflow run(documented as-f, --raw-field key=value). The separation intobump-patchandbump-minorprovides clear, self-documenting commands.
Summary
This PR separates the single
bump-versioncommand into two distinct commands for better version control:bump-patch: Increments the patch version (e.g., 3.0.5 → 3.0.6)bump-minor: Increments the minor version and resets patch to 0 (e.g., 3.0.5 → 3.1.0)Changes
GitHub Actions Workflow (.github/workflows/bump-version.yml)
workflow_dispatchinput parameterversion_typewith choices "patch" or "minor"Bump Version Script (scripts/bump-version.ts)
incrementVersion()function to accept atypeparameter ('patch' | 'minor')Package.json (package.json)
"bump-version""bump-patch"- triggers workflow withversion_type=patch"bump-minor"- triggers workflow withversion_type=minorUsage
Both commands trigger the GitHub Actions workflow which creates a PR with the version changes.
🤖 Generated with Claude Code
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.