Skip to content

landing: apply patches at their base and rebase for a 3-way merge (Bug 2047605)#1253

Closed
cgsheeh wants to merge 16 commits into
mozilla-conduit:mainfrom
cgsheeh:3way-merge
Closed

landing: apply patches at their base and rebase for a 3-way merge (Bug 2047605)#1253
cgsheeh wants to merge 16 commits into
mozilla-conduit:mainfrom
cgsheeh:3way-merge

Conversation

@cgsheeh

@cgsheeh cgsheeh commented Jun 15, 2026

Copy link
Copy Markdown
Member

Lando applied patches with a 2-way git apply, which fails when the surrounding
context shifted even from an unrelated edit. Track the diff's base revision from
Phabricator's differential.diff.search and, when that commit exists in the
target repo, apply the stack onto it and rebase onto the target branch for a true
3-way merge. Fall back to applying at the tip when the base is unavailable, and
skip rebasing entirely when target_commit_hash pins the target.

Post-rebase commit hashes are recorded on each revision, and rebase conflicts are
captured and surfaced through the existing merge-conflict error breakdown.

…g 2047605)

Lando applied patches with a 2-way `git apply`, which fails when the surrounding
context shifted even from an unrelated edit. Track the diff's base revision from
Phabricator's `differential.diff.search` and, when that commit exists in the
target repo, apply the stack onto it and rebase onto the target branch for a true
3-way merge. Fall back to applying at the tip when the base is unavailable, and
skip rebasing entirely when `target_commit_hash` pins the target.

Post-rebase commit hashes are recorded on each revision, and rebase conflicts are
captured and surfaced through the existing merge-conflict error breakdown.
@cgsheeh cgsheeh requested a review from a team as a code owner June 15, 2026 13:43
@github-actions

Copy link
Copy Markdown

View this pull request in Lando to land it once approved.

@shtrom shtrom left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. Mainly some suggestions and discussion to clarify.

Comment thread src/lando/main/scm/abstract_scm.py
Comment thread src/lando/api/legacy/workers/landing_worker.py
Comment thread src/lando/api/legacy/workers/landing_worker.py Outdated
Comment thread src/lando/api/legacy/workers/landing_worker.py
Comment thread src/lando/api/legacy/workers/landing_worker.py Outdated
Comment thread src/lando/main/scm/git.py Outdated
Comment thread src/lando/main/tests/test_git.py Outdated
Comment thread src/lando/main/tests/test_git.py Outdated
Comment thread src/lando/main/tests/test_git.py Outdated
Comment thread src/lando/main/tests/test_git.py

@Magnolia-Liu Magnolia-Liu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, just some clarifying questions.

Comment thread src/lando/api/legacy/workers/landing_worker.py
Comment thread src/lando/api/legacy/workers/landing_worker.py Outdated
@cgsheeh cgsheeh requested review from Magnolia-Liu and shtrom June 18, 2026 02:55

@shtrom shtrom left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

lando-worker Bot pushed a commit that referenced this pull request Jun 18, 2026
…g 2047605) r=shtrom

Lando applied patches with a 2-way `git apply`, which fails when the surrounding
context shifted even from an unrelated edit. Track the diff's base revision from
Phabricator's `differential.diff.search` and, when that commit exists in the
target repo, apply the stack onto it and rebase onto the target branch for a true
3-way merge. Fall back to applying at the tip when the base is unavailable, and
skip rebasing entirely when `target_commit_hash` pins the target.

Post-rebase commit hashes are recorded on each revision, and rebase conflicts are
captured and surfaced through the existing merge-conflict error breakdown.

Pull request: #1253
@lando-worker

lando-worker Bot commented Jun 18, 2026

Copy link
Copy Markdown

Pull request closed by commit c75ed29

@lando-worker lando-worker Bot closed this Jun 18, 2026
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.

3 participants