Repository navigation
Conversation
A local origin/HEAD naming the pushed feature branch makes both sides read from that head, hiding committed changes as PR_SHOTS_IDENTICAL. Reuse the shared default-base, ref-resolution and merge-base helpers instead of maintaining a separate origin/HEAD fallback loop. Cover main and non-main defaults, moved bases, stale local branches, local-only repositories and unresolved self-referential defaults in the existing owner suite. Preserve explicit --base and update the CLI help. Fixes: garrytan#3733 Co-Authored-By: Claude Code <[email protected]>
|
Merging to
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 |
Keep missing or unrelated remote HEAD targets from preventing the shared default-base resolver from reaching a usable fallback. Cover both cases with existing-owner pr-shots regressions. Co-Authored-By: Claude Code <[email protected]>
d883966 made lib/default-base.ts skip a dangling or unrelated remote HEAD. The push guard relies on the shared selector naming that ref so it refuses, and test/ship-release.test.ts caught it guessing origin/main instead. Restore the shared resolver and fall back to main, then master, only in pr-shots' defaultBase. Co-Authored-By: Claude Code <[email protected]>
|
Thanks for picking up #3733. This is on the crew's pick-up list: a crew lane will rebuild it on current main and credit you as co-author when it lands, then close this PR. |
|
Thank you for this. We're picking up the idea. A maintainer agent working through a batch of fixes (our tracking thread GSTA-802) will first reproduce the problem on current main. If it reproduces, the agent rebuilds the fix on main with you credited as co-author, because we don't merge outside branches directly, and we'll close this PR with a link when it lands. If it no longer reproduces, we'll close this and say what changed. |
|
Thank you, @szsunyuan. This was rebuilt on current main and landed in #4681 (merged as b3323f4), with credit in the changelog. |
Why (in your own words)
A clone whose local
origin/HEADnames the pushed feature branch makesgstack-pr-shots --pathread that feature head as its own before-image. Committed PR changes then disappear from the comparison: with no extra uncommitted edit, both sides are identical and generation refuses withPR_SHOTS_IDENTICAL.Use the real resolved base branch and its merge base with HEAD, so the comparison includes the committed PR changes.
Fixes #3733. The shared default-base work from #3718/#3795 landed earlier, but #3718 explicitly deferred this pr-shots consumer. This does not duplicate that completed resolver work.
Why this shape
The existing
gate-diff/githelpers already implement the common default-base policy, remote-tracking precedence and merge-base calculation. Reusing them removes the separate raworigin/HEADloop without introducing another resolver or a production test seam.The shared selector deliberately keeps naming a stale remote HEAD (a missing branch, or history HEAD does not share), so the gates refuse instead of guessing a base;
test/ship-release.test.tspins that for the push guard. pr-shots only renders a before/after image, so when the shared default is unusable it falls back tomainas its old loop did, thenmaster. That fallback lives inlib/pr-shots.ts, not in the shared resolver.CONTRIBUTING's wave process prefers the smaller change when two PRs solve the same thing. This is four files: one pr-shots production fix, existing-owner regressions, a CLI help correction and a changelog fragment. Fine to absorb into a wave.
What it does
origin/HEADincorrectly points at the feature branch, including a non-main default.main(as pr-shots did before), thenmaster, when localorigin/HEADnames a missing branch or unrelated history.--base, local-only repository behavior and structured missing-base refusal.test/pr-shots.test.ts, not a new standalone test file.What it deliberately does not do
lib/default-base.tsresolver, so the gates keep refusing a staleorigin/HEAD. No new remote writes, fetch/merge policy or competing base resolver. The existing resolver's bounded PR-base/remote-HEAD metadata reads remain its own behavior.VERSION, package-version, releasedCHANGELOG.md, README or ETHOS edits. Release documentation is one entry-text-only branch fragment./shipworkflow changes or manual release stamp; the repository's merge/release process assigns the version.Live evidence
Bun 1.4.2 on Linux. The reproductions use existing local Git-fixture helpers, a local bare origin and the real
defaultBase,pathSidesandbuildPagefunctions. The remote's real default remains main; only the working clone's local origin/HEAD is changed. No browser, live model or GitHub service is needed by the fixtures.Feature-branch
origin/HEAD(the reported bug)Before the production edit, the diagnostic fixture printed:
Those fields are the recorded fixture result with ephemeral SHAs omitted. The original production module was unchanged between the initial base and refreshed
5f9b7ef20.The new owner-test cases also failed before the production edit:
After the fix, the same mispointed-HEAD production-function scenario returned:
{ "localRemoteHead": "origin/feature", "choseRealBase": true, "choseFeatureHead": false, "before": "before\n", "after": "feature\n", "result": "comparison generated" }The branch was then fast-forwarded to current main at
5f9b7ef20, with the patch verified byte-identical before and after the refresh.Stale
origin/HEAD(found in review)Review of the first commit found a second case: when local
origin/HEADnames a missing branch or unrelated history, the shared selector still names it, so pr-shots refused where its old loop fell back toorigin/main. The two new cases failed before the fallback:The first attempt at that fix,
d883966ec, changed the shared resolver instead. CI caught that the push guard relies on the resolver to refuse a danglingorigin/HEAD; the same failure reproduces locally:daa6a2400restoreslib/default-base.tsbyte-for-byte and keeps the fallback in pr-shots. The whole push-guard file passes again:Scope
mainat5f9b7ef20:lib/pr-shots.ts,test/pr-shots.test.ts, the existing CLI's help line, andchangelog.d/fix-3733-pr-shots-default-base.md. No VERSION, released CHANGELOG or generated-file changes. Three commits: the second (d883966ec) fails the push-guard test on its own, and the third reverts its shared-resolver change, so the series is meant to be squashed.daa6a2400(29 passed, 14 skipped); 96 focused tests on the final head; strict product typecheck; test-type ratchet (812 known diagnostics, none new); CLI help; changelog prose lint;git diff --check; exact staged-diff redaction scans with zero findings./shipreview/verification run. The one filtered real-browser capture case was not run locally. No browser sandbox override or global tool change was used.Focused checks on the final head, under Bun 1.4.2 with
umask 022,LC_ALL=Cand isolatedHOME,GSTACK_HOMEandTMPDIR:test/ship-release.test.ts, including the dangling-origin/HEADpush-guard refusaltest/default-base.test.ts,test/gate-diff-cli.test.tsThe commands were:
The paid selector is intentionally reported, not reduced: the shared pr-shots references reach 252 registered cases. For this four-file diff, the PR profile selects 108 paid behaviors, no dedicated quality judges, and defers 144 broad behaviors to scheduled/release coverage. None of those unrun cases receives pass credit.
Liveness proof (required for external contributors)
Checklist
GSTACK PRtyped live into a real surface).Test plan
origin/HEADfalling back tomain, with the shared resolver unchanged so the push guard still refuses that case.5f9b7ef20while preserving the patch byte-for-byte.daa6a2400: 29 passed, 14 skipped).Fork PRs do not receive upstream eval secrets. Skipped paid CI jobs are not passes; a maintainer must run the required paid coverage on an upstream branch before merge. Broad-profile deferrals remain scheduled/release coverage, not PR passes.
Fixes #3733.