Skip to content

fix(ship): accept case-insensitive --bump levels in gstack-next-version (#2770) - #2785

Open
loulanyue wants to merge 1 commit into
garrytan:mainfrom
loulanyue:fix/2770-gstack-next-version-case-insensitive-bump
Open

fix(ship): accept case-insensitive --bump levels in gstack-next-version (#2770)#2785
loulanyue wants to merge 1 commit into
garrytan:mainfrom
loulanyue:fix/2770-gstack-next-version-case-insensitive-bump

Conversation

@loulanyue

Copy link
Copy Markdown
Contributor

Summary of Changes

In /ship, Step 12 records bump levels in uppercase (e.g., MICRO, PATCH, MINOR, MAJOR) as defined in ship/SKILL.md. However, bin/gstack-next-version strictly validated against lowercase strings, exiting with code 2. Because stderr was silenced with 2>/dev/null || echo '{"offline":true}', this caused queue-aware shipping to falsely report that the queue was offline and fall back to local arithmetic on every ship.

Solution

  1. Normalize to lowercase: In bin/gstack-next-version:parseArgs, normalize bump.toLowerCase() before validating against ["major", "minor", "patch", "micro"].
  2. Export parseArgs: Exported parseArgs for unit testing.
  3. Unit Tests: Added regression tests in test/gstack-next-version.test.ts verifying uppercase and mixed-case bump levels (MICRO, PATCH, Minor, MAJOR). All 57 tests pass.

Fixes #2770

@trunk-io

trunk-io Bot commented Sep 3, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

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.

/ship always reports the version queue offline: Step 12 sends uppercase BUMP_LEVEL to a lowercase-only util, with stderr suppressed

1 participant