fix: add fail-fast probe for base branch in ship step 12#1332
Closed
Jasperc2024 wants to merge 1 commit intogarrytan:mainfrom
Closed
fix: add fail-fast probe for base branch in ship step 12#1332Jasperc2024 wants to merge 1 commit intogarrytan:mainfrom
Jasperc2024 wants to merge 1 commit intogarrytan:mainfrom
Conversation
There was a problem hiding this comment.
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.
Merged
7 tasks
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
/ship Step 12 currently computes
BASE_VERSIONwith: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”.
Need help on this PR? Tag
@codesmithwith what you need.