Repository navigation
Add live gh and gh stack end-to-end suite - #41
Merged
tcamise-gpsw merged 12 commits intoOct 15, 2026
Conversation
cam1se
changed the base branch from
main
to
tcamise-gpsw/support-non-stacked-mode-a-single-pr-as-a-one-la
October 14, 2026 04:39
cam1se
force-pushed
the
tcamise-gpsw/end-to-end-validation-of-gh-and-gh-stack-behavio
branch
from
October 14, 2026 04:39
977156d to
c4e1de1
Compare
tcamise-gpsw
marked this pull request as ready for review
October 15, 2026 20:11
Exit 2 from gh stack also means 'not a git repository', so only 'is not part of a stack' maps to LocalTrackingMissing. gh exit 4 (no token) now maps to Auth. gh installs a missing stack extension on first use and exits 0 without running the command, so the adapter retries once after seeing the install message. Classifier tests now use output observed from gh 2.101.0 and gh-stack v0.1.1. Refs: #23
Runs the real binaries against fixture PRs (stacked, merged, unstacked, fork with same head branch, conflict). Opt-in with STACK_STAT_LIVE=1 via make live-test; scripts/live-fixture.sh resets fixture branches to their start tags. Refs: #23
The live workflow runs daily and on dispatch with a serializing concurrency group. CI and commit-lint skip pull requests whose head branch starts with fixture/. Refs: #23
Records the live fixture approach, keeps the PTY rule, and lists coverage gaps. Refs: #23
Matrix of known-good (gh 2.101.0, gh-stack v0.1.1) and latest releases so upstream changes that break stack-stat show up as a latest-only failure. Uses the existing GH_ACCESS_TOKEN secret, opens or updates an issue when a scheduled run fails, and carries a temporary push trigger to exercise the workflow from this branch. Refs: #23
Documents the version matrix, GH_ACCESS_TOKEN usage and failure issue; removes the temporary branch push trigger from the live workflow. Refs: #23
Adds fixtures for a single PR on the default base (s4), a single PR on a non-default base (s5), a pushed branch without a PR (s6), a closed PR (s7) and a merged PR (s8), and replaces the NotInStack expectations with the one-row single-mode view. The reset script restores s5 and s6; s7 and s8 are read-only. Refs: #23
Read-only tests share a lock and mutating tests hold it exclusively, resetting the fixture before and, via Drop, after the test. Verified by forcing a failing assertion after the conflict step: the fixture was clean afterwards. Refs: #23
Fixture PRs stay open: closing and reopening them sends notification emails and the local TUI tests need them open. live-fixture.sh gains check (tags, branches, PR states, fixture and do not merge labels), up (reopen after an accidental close) and rebuild (recreate missing branches from tags and missing s1, s2 and s5 PRs). The live tests run check once per process. Verified by deleting fixture/s6-nopr and rebuilding it. Refs: #23
A failed fixture check opens a 'Live gh fixture broken' issue instead of a drift issue, so fixture damage is not mistaken for a gh change. Refs: #23
tcamise-gpsw
force-pushed
the
tcamise-gpsw/end-to-end-validation-of-gh-and-gh-stack-behavio
branch
from
October 15, 2026 20:26
23d96e8 to
e55d689
Compare
Pushes a no-PR branch with plain git push without local stack tracking and checks a non-fast-forward push is reported as a Git rejection. Refs: #23
tcamise-gpsw
deleted the
tcamise-gpsw/end-to-end-validation-of-gh-and-gh-stack-behavio
branch
October 15, 2026 21:08
3 of 4 tasks
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.
Summary
Stacked on #39 (single-PR and no-PR mode, stack #46): merge #39 first. This PR's live tests expect the one-row single-mode view that #39 introduces.
Adds an end-to-end suite that runs the real
ghandgh stackagainst live fixture PRs (issue #23), and fixes three classifier bugs the real binaries exposed:stackextension on first use and exits 0 without running the command. The adapter now retries once after seeing the install message; before, the action silently did nothing.gh stackexit 2 also means "not a git repository". Push/sync now map toLocalTrackingMissingonly when stderr says the branchis not part of a stack, so a non-repo failure no longer offers to link.ghexit 4 (no token) now maps toAuth; the old text match missed gh's wording.The fixture lives in this repo under
fixture/*(stacks s1 three-PR, s2 conflict, s3 merged, s4 unstacked, plus fork PRs sharing a head branch name), withfixture-start/*reset tags, single-mode fixtures (s4 single PR onmain, s5 single PR on a non-default base, s6 no-PR branch, s7 closed, s8 merged),scripts/live-fixture.sh reset|conflict|status, and rulesets that block deleting fixture branches and updating the tags. CI and commit-lint now skipfixture/*pull requests.make live-testruns the suite; a nightly (06:17 UTC) and dispatch-only workflow runs it in CI against a pinned known-good gh/gh-stack pair and the latest releases, so a latest-only failure signals upstream drift. A failed nightly run opens or updates an issue.Testing
cargo fmt --all -- --check: clean (cargo fmt --allrun).cargo clippy --workspace --all-targets --locked -- -D warnings: clean.cargo test --workspace --locked --no-fail-fast: all pass (live tests skip withoutSTACK_STAT_LIVE=1).Live:
STACK_STAT_LIVE=1 cargo test -p stack-stat-core --test live_ghagainst this repo: 15 passed in ~150-225s, after fixing two failures the run found (exit-4 auth, and a fork test that did not prove owner disambiguation).TUI smoke via
make demo: N/A because dashboard rendering is unchanged; the change is at theghadapter boundary, which the live suite exercises directly.scripts/live-fixture.sh checkpasses;rebuildverified by deletingfixture/s6-noprand rebuilding it. The PR-creation paths ofrebuild(stacks s1/s2, PR s5) are untested.Docs and architecture
cargo doc --workspace --no-deps --locked: builds.Notes for reviewers
GH_ACCESS_TOKENsecret: pinned gh 2.101.0 + gh-stack v0.1.1 and latest gh 2.102.0 + gh-stack v0.2.1, 12/12 live tests each. The nightly schedule and manual dispatch start working once this merges; the failure-issue step only fires on scheduled failures and has not been exercised.fixtureanddo not mergelabels (fixture: a #27-fixture: c #29, fixture: s2 a #31, fixture: s2 b #32, fixture: s4 upstream PR (same branch name as fork PR) #37, fixture: fork PR sharing head branch name with stack s1 top #40, fixture: s5-single (single PR, non-default base) #43 open; fixture: s3 a #34, fixture: s3 b #35, fixture: s8-merged (single PR, non-default base) #45 merged and fixture: s4 fork PR (same branch name as upstream PR) #38, fixture: s7-closed (single PR, non-default base) #44 closed as permanent end states). Closing and reopening them would send notification emails, and the local TUI tests (Agent-led TUI tests of the real dashboard against the live fixture #42) need them open. Muting the threads needs thenotificationstoken scope, which I did not have; mute them from account notification settings.main, sogh stack synccan rebase it whenmainmoves; tests reset before and after.Closes: #23