Skip to content

fix: add fail-fast probe for base branch in ship step 12#1332

Closed
Jasperc2024 wants to merge 1 commit intogarrytan:mainfrom
Jasperc2024:fix-ship-version-fallback
Closed

fix: add fail-fast probe for base branch in ship step 12#1332
Jasperc2024 wants to merge 1 commit intogarrytan:mainfrom
Jasperc2024:fix-ship-version-fallback

Conversation

@Jasperc2024
Copy link
Copy Markdown
Contributor

@Jasperc2024 Jasperc2024 commented May 5, 2026

/ship Step 12 currently computes BASE_VERSION with:

BASE_VERSION=$(git show origin/<base>:VERSION ... || echo "0.0.0.0")

If origin/ is missing/unfetched/unresolvable (offline, detached HEAD, misconfigured remotes, etc.), the command fails and /ship silently falls back to 0.0.0.0, which can produce an incorrect version bump baseline.

What changed

Added a fail-fast guard before reading origin/:VERSION:
git rev-parse --verify origin/ must succeed, otherwise /ship prints a clear error and exits.
Left the existing parsing/trimming logic intact for the happy path.
Regenerated skill docs after updating the .tmpl file.

Why this is better

Avoids silently selecting an invalid baseline (0.0.0.0) that can cause version drift.
Produces an actionable error message that tells the user how to fix it (git fetch origin / verify base branch).

Testing

bun test
bun run gen:skill-docs --host all

This addresses the TODO item: “/ship Step 12 BASE_VERSION silent fallback to 0.0.0.0 when git show fails”.


View in Codesmith
Need help on this PR? Tag @codesmith with what you need.

  • Let Codesmith autofix CI failures and bot reviews

Copilot AI review requested due to automatic review settings May 5, 2026 21:27
Copy link
Copy Markdown

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 updates the /ship Step 12 version-bump instructions to fail fast when the expected base ref (origin/<base>) can’t be resolved, preventing a silent fallback to 0.0.0.0 that could lead to an incorrect version baseline.

Changes:

  • Added a guard (git rev-parse --verify origin/<base>) that errors and exits if the base ref is missing/unresolvable.
  • Regenerated the rendered skill documentation after updating the template.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
ship/SKILL.md.tmpl Adds a fail-fast base-ref resolution check before computing BASE_VERSION in Step 12.
ship/SKILL.md Regenerated rendered docs reflecting the Step 12 fail-fast check.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@garrytan
Copy link
Copy Markdown
Owner

Thanks @Jasperc2024 — your fix shipped in v1.30.0.0 (#1391) with credit in the CHANGELOG. Closing since it's already on main. Appreciate the contribution.

@garrytan garrytan closed this May 10, 2026
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.

3 participants