Repository navigation
v1.94.3.0 fix(ship-preflight): stop when origin's default branch can't be read (#3718 follow-up) - #3913
Merged
Conversation
… guessing the default branch Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…efault-base order; docs name the whole order Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…in/HEAD Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
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.
Carries the two pieces of #3718 that wave #3852 didn't land. #3718 is closed as superseded.
Captain (GSTA-36): "A. Close #3718 as superseded by #3852, with a short note naming the two pieces you're carrying forward. Then open a fresh PR from main with the ship-preflight "restore access first" stop (failing-first test in test/ship-preflight.test.ts) and the two doc lines. It's a bug fix, so no /autoplan. Run it as R65 says: the printed review plan once on the final head, one fix round. Then send READY to me. The unused grant on #3718 lapses. Nothing else is owed."
What changes
gstack-ship-preflightno longer trusts a localorigin/HEADwhen origin can't say its default branch (lib/ship-preflight.ts). On main, preflight fell back to the localorigin/HEADwhenevergit ls-remote --symref origin HEADfailed or named no branch:origin/HEAD, preflight on the default branch merged the given base into it and kept going.origin/HEADnames the feature branch, preflight refused that branch as "on the base branch".Now:
ls-remotestops withgit ls-remote origin HEAD failed: …; restore access firstbefore anything merges.defaultBaseBranch()inlib/default-base.ts, the same order every other base-relative step uses.Docs.
docs/eval-calls.mdanddocs/eval-models.mdnow describe the default--basethe waylib/default-base.tsresolves it: origin/HEAD's branch unless it names the checked-out branch, its upstream or HEAD's commit, then the PR's base, the remote's live HEAD,mainormaster.Proof (failing first)
Two new tests in
test/ship-preflight.test.ts. In each one, agitwrapper on PATH changes only whatls-remotereturns.ls-remotefails while the fetch works. On main this test fails: on the default branch with no localorigin/HEAD,--base releaseexited 0 (Expected: 3, Received: 0). With this PR, both setups stop with the "restore access first" line and print noMERGE:.ls-remoteprints only a sha. With c3b3c37'slib/ship-preflight.ts, this test fails (Expected: 3, Received: 0). With this PR, the default branch stops as the base branch and the feature branch goes on.timeout 300 bun test test/ship-preflight.test.ts: 25 pass, 0 fail at 1ec7fe1.bun run typecheckis clean.Open notes (informational, not fixed: the one fix round is used)
develop), with a server that sends no HEAD symref,defaultBaseBranch()skipsdevelopbecause it is the checked-out branch. Preflight ondevelopwith another--basethen goes on, where main's local-ref fallback stopped. It needs both conditions together; GitHub always sends the symref.Bun.which('git')can resolve to Capy's git guard, which runs the stub again. The two wrapper tests then hit their 60 s timeout there. CI is unaffected.Refs #3718