Skip to content

Conversation

@ymc9
Copy link
Member

@ymc9 ymc9 commented Dec 28, 2025

Summary

This PR separates the single bump-version command 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)

  • Added workflow_dispatch input parameter version_type with choices "patch" or "minor"
  • Updated the bump version step to pass the input to the script

Bump Version Script (scripts/bump-version.ts)

  • Modified incrementVersion() function to accept a type parameter ('patch' | 'minor')
  • Added command-line argument parsing to get the version type
  • Added validation for the version type argument

Package.json (package.json)

  • Removed: "bump-version"
  • Added: "bump-patch" - triggers workflow with version_type=patch
  • Added: "bump-minor" - triggers workflow with version_type=minor

Usage

# To bump patch version (3.0.5 → 3.0.6)
pnpm run bump-patch

# To bump minor version (3.0.5 → 3.1.0)
pnpm run bump-minor

Both commands trigger the GitHub Actions workflow which creates a PR with the version changes.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated version bumping workflow to support both patch and minor version increments with selectable options.
    • Split version bump scripts for streamlined version management.

✏️ Tip: You can customize this high-level summary in your review settings.

- 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]>
Copilot AI review requested due to automatic review settings December 28, 2025 04:06
@coderabbitai
Copy link

coderabbitai bot commented Dec 28, 2025

📝 Walkthrough

Walkthrough

The pull request enhances version management by introducing parameterized version bumping. A new version_type workflow input enables selection between patch and minor version increments. The incrementVersion() function is extended with an optional type parameter, supporting both bump types with semantic version validation. Package.json scripts are split into separate bump-patch and bump-minor commands.

Changes

Cohort / File(s) Summary
Version Bump Type Parameterization
.github/workflows/bump-version.yml, package.json, scripts/bump-version.ts
Adds version_type workflow input enabling patch/minor selection; splits npm scripts into bump-patch and bump-minor; extends incrementVersion() function with optional type parameter ('patch' | 'minor' = 'patch'), semantic version validation, and conditional logic to reset patch version on minor bumps

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Possibly related PRs

Poem

🐰 A rabbit hops with glee,
Patches and minors dance free,
Version bumps now have a choice,
Minor or patch—let's rejoice!
Flexibility in every release,
Our semantic versions find peace! 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: splitting a single bump-version command into two separate commands (bump-patch and bump-minor).
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/separate-bump-commands

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 and usage tips.

@claude
Copy link

claude bot commented Dec 28, 2025

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

  • Read and analyze the GitHub workflow changes
  • Review the bump-version script modifications
  • Check package.json command updates
  • Assess code quality and best practices
  • Look for potential bugs or edge cases
  • Evaluate security considerations
  • Check test coverage implications
  • Provide comprehensive feedback

Review Feedback

Code Quality & Best Practices

The implementation is well-structured with clean separation of concerns:

  • Proper TypeScript typing with explicit 'patch' | 'minor' union types
  • Good error handling and input validation in scripts/bump-version.ts:53-55
  • Clear command-line argument parsing and type checking
  • Maintains existing code style and patterns

GitHub Workflow Changes

The workflow changes in .github/workflows/bump-version.yml:6-12 are properly implemented:

  • Uses workflow_dispatch with proper input validation
  • Restricts version_type to only valid choices (patch/minor)
  • Correctly passes input to the script in scripts/bump-version.ts:45

Script Logic

The incrementVersion() function in scripts/bump-version.ts:35-49 correctly implements semver logic:

  • Patch: 3.0.5 → 3.0.6 (increments patch only)
  • Minor: 3.0.5 → 3.1.0 (increments minor, resets patch to 0)
  • Proper validation for version format (exactly 3 parts)
  • Good error messages for invalid versions

⚠️ Potential Issues

  1. Missing Test Coverage: No unit tests found for the bump-version script. Consider adding tests for:

    • incrementVersion() function with various inputs
    • Edge cases like invalid version formats
    • Command-line argument parsing
  2. Minor Code Improvement: The version parsing in scripts/bump-version.ts:39 could be more robust:

    // Current
    const [major, minor, patch] = parts.map(p => parseInt(p, 10));
    
    // Could validate each part individually for better error messages
  3. Documentation: Consider updating README or docs to reflect the new commands, though this may not be necessary if the old bump-version command wasn't documented.

Security Considerations

  • No security concerns identified
  • Input validation properly restricts version types
  • No exposure of sensitive data or injection vulnerabilities

Performance Considerations

  • Minimal performance impact
  • File operations are already optimized
  • Command-line argument parsing is efficient

📝 Minor Suggestions

  1. Default fallback: The script defaults to 'patch' when no argument is provided (scripts/bump-version.ts:66), which is sensible but could be made more explicit in error messaging.

  2. Workflow naming: Consider if the workflow name "Bump Version" should be updated to reflect it now handles both patch and minor bumps.

Overall Assessment

This is a solid, well-implemented change that improves the version management workflow. The code is clean, follows good practices, and maintains backward compatibility in terms of workflow behavior. The separation into distinct commands provides better clarity and control over version bumping.

The main gap is test coverage, but given this is a build/deployment script rather than core application logic, the thorough input validation and simple logic provide reasonable confidence.

Recommendation: ✅ Approve - This change improves the development workflow with clean, well-validated implementation.

Copy link
Contributor

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 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-patch command to increment patch versions (e.g., 3.0.5 → 3.0.6)
  • Introduces bump-minor command 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.

Copy link

@coderabbitai coderabbitai bot left a 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 since incrementVersion already defaults to 'patch'. You could simplify to incrementVersion(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

📥 Commits

Reviewing files that changed from the base of the PR and between b83ed8d and bc84289.

📒 Files selected for processing (3)
  • .github/workflows/bump-version.yml
  • package.json
  • scripts/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_type input is correctly defined with appropriate constraints. The choice type provides a user-friendly dropdown in the GitHub Actions UI, and the required: true flag 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_type values. The -f flag is the correct option for passing workflow inputs to gh workflow run (documented as -f, --raw-field key=value). The separation into bump-patch and bump-minor provides clear, self-documenting commands.

@ymc9 ymc9 merged commit 67bb5ab into dev Dec 28, 2025
12 of 14 checks passed
@ymc9 ymc9 deleted the feat/separate-bump-commands branch December 28, 2025 04:19
This was referenced Dec 29, 2025
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