Skip to content

GitSCM: raise PatchConflict from get_diff_from_patches and handle in LandingWorker (bug 2000268)#742

Closed
shtrom wants to merge 5 commits intomainfrom
bug2001532/get_diff_from_patches_PatchConflict
Closed

GitSCM: raise PatchConflict from get_diff_from_patches and handle in LandingWorker (bug 2000268)#742
shtrom wants to merge 5 commits intomainfrom
bug2001532/get_diff_from_patches_PatchConflict

Conversation

@shtrom
Copy link
Member

@shtrom shtrom commented Dec 4, 2025

Includes the following changes:

  • GitSCM: add @detect_patch_conflict to transform SCMExceptions as needed
  • GitSCM: raise PatchConflict as needed in get_diff_from_patches
  • BaseWorker: allow handle_new_commit_failures to return something
  • landing_worker: handle PatchConflict from scm.get_diff_from_patches

@github-actions
Copy link

github-actions bot commented Dec 4, 2025

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

@shtrom shtrom marked this pull request as ready for review December 4, 2025 07:06
@shtrom shtrom requested a review from zzzeid December 4, 2025 07:18
@shtrom shtrom marked this pull request as draft December 4, 2025 07:18
@shtrom shtrom marked this pull request as ready for review December 4, 2025 07:20
zzzeid
zzzeid previously approved these changes Dec 4, 2025
Copy link
Contributor

@zzzeid zzzeid left a comment

Choose a reason for hiding this comment

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

I think it would be better to handle this in the same way we handle other apply failures if possible (e.g., handle_new_commit_failures). I won't block the PR on this though and it would only apply to the portion of the code in the landing_worker.

@shtrom shtrom dismissed zzzeid’s stale review December 5, 2025 01:11

Will refactor

@shtrom shtrom requested a review from zzzeid December 5, 2025 01:13
@shtrom
Copy link
Member Author

shtrom commented Dec 5, 2025

I added a decorator to deduplicate the PatchConflict detection logic, and rejigged handle_new_commit_failures so it can be used with scm.get_diff_from_patches, too.

@shtrom shtrom changed the title GitSCM: raise PatchConflict as needed in get_diff_from_patches (bug 2001532) GitSCM: raise PatchConflict from get_diff_from_patches and handle in LandingWorker (bug 2001532) Dec 5, 2025
@shtrom shtrom changed the title GitSCM: raise PatchConflict from get_diff_from_patches and handle in LandingWorker (bug 2001532) GitSCM: raise PatchConflict from get_diff_from_patches and handle in LandingWorker (bug 2000268) Dec 5, 2025
Copy link
Contributor

@zzzeid zzzeid left a comment

Choose a reason for hiding this comment

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

lgtm, maybe add a comment describing the changes to handle_new_commit_failures.

@lando-prod-mozilla
Copy link

Pull request closed by commit d09e7a8

lando-prod-mozilla bot pushed a commit that referenced this pull request Dec 10, 2025
…LandingWorker (bug 2000268) r=zeid

Includes the following changes:
 * GitSCM: add @detect_patch_conflict to transform SCMExceptions as needed
 * GitSCM: raise PatchConflict as needed in get_diff_from_patches
 * BaseWorker: allow handle_new_commit_failures to return something
 * landing_worker: handle PatchConflict from scm.get_diff_from_patches

Pull request: #742
@shtrom shtrom deleted the bug2001532/get_diff_from_patches_PatchConflict branch January 22, 2026 05:46
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.

2 participants