FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(stack): publish ahead parents safely and support older gh by kitlangton · Pull Request #45 · kitlangton/stack · GitHub

fix(stack): publish ahead parents safely and support older gh - #45

Merged
kitlangton merged 1 commit into
mainfrom
fix/sync-parent-publication
Aug 28, 2026
Merged

fix(stack): publish ahead parents safely and support older gh#45
kitlangton merged 1 commit into
mainfrom
fix/sync-parent-publication

Conversation

Copy link
Copy Markdown
Owner

Why

After editing a stack parent locally, stack sync --apply can repair and publish its child while leaving the remote parent at the old commit. Separately, older GitHub CLI versions omit headRepository.nameWithOwner, causing sync to reject valid PR JSON.

What Changes

Scenario Before After
Parent has an unpublished commit but needs no rebase Child is repaired and pushed; remote parent stays stale Publish the parent first, then repair the child
Undo that publication No remote-only snapshot exists Restore each remote's old tip while keeping the parent's pre-existing local commits
Older gh lacks a repository field PR details fail to decode Read details through gh api, using the same REST repository identity as PR lists

Bare sync remains a non-mutating preview. Publication is scoped to the selected stack, includes parents with remote-only children, and refuses diverged or unknown remote tips. Explicit expected-tip leases guard new parent-publication pushes; these pushes do not implicitly publish tags.

Undo Boundaries

A remote-only publication must not be undone by resetting the local parent. The journal therefore records each destination's before/after tips separately from local branch backups. For example, a parent that started at local A2 / remote A1 returns to that exact split after undo.

Checkpoints precede publication and retain earlier stacks' recovery data during keep-going runs. Undo handles partial publication and partial rollback, but refuses unexpected remote tips. Journals containing remote updates use version 2 so older CLIs reject rather than ignore them; version 1 journals remain readable.

Scope

Independent fixes for the behaviors reported in #21 and #41, with regression tests, documentation, and patch changesets. Request-concurrency work in #43 and CI repository settings are not changed.

Verification

GIT_CONFIG_GLOBAL=/dev/null GIT_CONFIG_SYSTEM=/dev/null bun run test
bun run typecheck
bun run format:check
bun run lint
bun run package:smoke
bun run changeset:status --since origin/main
bun src/cli.ts --help
bun src/cli.ts sync --help
bun src/cli.ts undo --help
git diff --check

163 tests pass, with no skipped or expected-failure regressions. Real-Git fixtures cover fork/origin tips, missing refs, stale leases, scoped previews, checkpoint failures, partial publication/undo, keep-going recovery, and tag suppression. The GitHub detail adapter was also smoke-tested with a read-only lookup of #41.

Journal remote-only parent publications independently from local branch backups, use explicit push leases, and retain cumulative recovery checkpoints across keep-going stacks.

Read GitHub PR details through REST rather than version-dependent gh pr view fields. Add real-Git regression coverage and patch changesets.
kitlangton merged commit f56b930 into main Aug 28, 2026
1 check passed
kitlangton deleted the fix/sync-parent-publication branch August 28, 2026 02:06
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL