Repository navigation
refactor(server): extract the change-request step - #20752
Draft
THEjacob1000 wants to merge 4 commits into
Draft
THEjacob1000 wants to merge 4 commits into
THEjacob1000 wants to merge 4 commits into
Conversation
This was referenced Oct 17, 2026
This was referenced Oct 17, 2026
THEjacob1000
force-pushed
the
refactor/change-request-step
branch
4 times, most recently
from
October 17, 2026 22:25
511d0c5 to
d99604c
Compare
|
Behavior looks neutral for git apart from trace span names and The problem is the rebase. Main has #20412 (fork detection needs Also: ~14 new exports have no user anywhere in the stack. The step lives in the 3.3k-line |
THEjacob1000
force-pushed
the
refactor/change-request-step
branch
2 times, most recently
from
October 19, 2026 18:00
02e40df to
fe50bb6
Compare
Co-authored-by: Лев Федорец <152093961+knocking4thcylinder@users.noreply.github.com>
Co-authored-by: Лев Федорец <152093961+knocking4thcylinder@users.noreply.github.com> Co-authored-by: Omar Shaarawi <16183117+omarshaarawi@users.noreply.github.com>
…vcs kind Co-authored-by: Лев Федорец <152093961+knocking4thcylinder@users.noreply.github.com>
THEjacob1000
force-pushed
the
refactor/change-request-step
branch
from
October 19, 2026 20:12
fe50bb6 to
503cd4e
Compare
This branch has not been deployed
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.
Problem
PR creation lives inside GitManager's stacked action, along with Git-specific reads. Wiring jj into it directly would duplicate provider selection, PR reuse and generated text. This extracts that policy without changing Git behavior.
Change
The change-request step moves to
sourceControl/ChangeRequestStep.tsbehindChangeRequestVcsReads, so jj doesn't import the GitManager module to get it. It owns provider lookup, existing-PR detection, fork-aware head/base selection, template and history context, generated title/body and progress reporting. Git supplies the same reads as before and #20753 supplies jj ones.@omarshaarawi pointed out a mechanical rebase would silently drop #20412 or #19605, so this was re-extracted from main's current bodies instead, and both are in: fork detection with
HostProcess.Environmentandgh-resolved, andincludePatchinprepareCommitContext. The unused exports and the mock-only test are gone. The only Git-visible deltas are trace span names. No Git commands change.Scope and approval
Approval is pending in #18468. Commits 1 to 6 are dormant on their own, #20756 is the one that turns jj on, and #20755 (idle workspace cleanup) sits on top so it can wait until the rest lands. Tracks #1126, the originals #11373, #11382, #11383, #11384, and ports #13816, #16380. @gergesh's port was a reference.
GitHub can't create stacked PRs from a fork, so the diff carries the PRs below. Review the top commit only.
Verification
Old and new PR steps were replayed side by side with real Git, a local bare remote and a fake
gh: creation, existing-PR reuse, failure cleanup and dirty worktrees matched, and #20412's routing matched across seven remote setups. This PR has no UI of its own, so there are no screenshots.