| β¦ | β¦ | @@ -242,77 +216,30 @@ export const runGitHubStackAction = Effect.fn("runGitHubStackAction")(function* | |
| 220 | + | // copy of every lower layer into the one above it. The cascade moves each layer's own commits. | |
| 221 | + | yield* cascadeRebaseStack({ | |
| 222 | + | host: input.host, | |
| 223 | + | repository: input.repository, | |
π High pullRequest/githubStackActions.ts:223
cascadeRebaseStack always operates on input.repository, so an open PR whose head is in a permitted fork fails when that fork's headBranch is fetched; if the base repository has a same-named ref at headSha, the force push instead rewrites the base ref. Pass each layer's actual head repository/remote to the cascade (or retain the API mutation path) so rebasing and lease checks target the PR's head branch.
π Reply "fix it for me" or copy this AI Prompt for your agent:
| 1 | In file @apps/server/src/pullRequest/githubStackActions.ts around line 223: |
| 2 | |
| 3 | `cascadeRebaseStack` always operates on `input.repository`, so an open PR whose head is in a permitted fork fails when that fork's `headBranch` is fetched; if the base repository has a same-named ref at `headSha`, the force push instead rewrites the base ref. Pass each layer's actual head repository/remote to the cascade (or retain the API mutation path) so rebasing and lease checks target the PR's head branch. |
| β¦ | β¦ | @@ -0,0 +1,155 @@ | |
| 129 | + | yield* git(["checkout", "--quiet", "--detach", layer.headSha]).pipe( | |
| 130 | + | Effect.mapError(failed("checking out", layer.number, index)), | |
| 131 | + | ); | |
| 132 | + | const rebase = yield* git(["rebase", "--quiet", "--onto", parentNew, upstream], true).pipe( | |
π High pullRequest/githubStackRebase.ts:132
A layer containing a merge commit is rebased and force-pushed with that merge commit omitted, so its topology and any manual conflict-resolution changes unique to the merge are silently lost. Because git rebase --onto defaults to linearizing history, preserve merge commits with --rebase-merges or reject such layers before pushing.
| 1 | const rebase = yield* git(["rebase", "--quiet", "--rebase-merges", "--onto", parentNew, upstream], true).pipe( |
π Reply "fix it for me" or copy this AI Prompt for your agent:
| 1 | In file @apps/server/src/pullRequest/githubStackRebase.ts around line 132: |
| 2 | |
| 3 | A layer containing a merge commit is rebased and force-pushed with that merge commit omitted, so its topology and any manual conflict-resolution changes unique to the merge are silently lost. Because `git rebase --onto` defaults to linearizing history, preserve merge commits with `--rebase-merges` or reject such layers before pushing. |