Skip to content

GitSCM: detect patch conflicts on apply_patch_git (bug 2030211)#1065

Closed
shtrom wants to merge 4 commits intomainfrom
bug2030211/apply-patch-conflict-reporting
Closed

GitSCM: detect patch conflicts on apply_patch_git (bug 2030211)#1065
shtrom wants to merge 4 commits intomainfrom
bug2030211/apply-patch-conflict-reporting

Conversation

@shtrom
Copy link
Copy Markdown
Member

@shtrom shtrom commented Apr 8, 2026

  • GitSCM: detect patch conflicts on apply_patch_git (bug 2030211)
  • tests: replace _monkeypatch_scm with identical active_mock fixture
  • tests: add tests for GitSCM.detect_patch_conflict

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

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

@shtrom shtrom marked this pull request as ready for review April 8, 2026 01:36
@shtrom shtrom requested a review from a team as a code owner April 8, 2026 01:36
Copy link
Copy Markdown
Member

@cgsheeh cgsheeh left a comment

Choose a reason for hiding this comment

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

Ideally we would add a test so this doesn't regress again in the future.

@shtrom
Copy link
Copy Markdown
Member Author

shtrom commented Apr 8, 2026

Ideally we would add a test so this doesn't regress again in the future.

“I know”, he said, “it'll be a simple one-line change”, he said. 😆

Ok, test added. I made it parametrised, so it should be relatively easy to add new methods for coverage if we need to.

@shtrom shtrom requested a review from cgsheeh April 8, 2026 06:48
@shtrom shtrom force-pushed the bug2030211/apply-patch-conflict-reporting branch from c7fc20d to bf6b0e9 Compare April 8, 2026 06:52
""").strip(),
)

with pytest.raises(PatchConflict):
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.

Nit: could we do with pytest.raises(PatchConflict) as exc_info:, and then we can check appropriate fields on exc_info outside the with (ie did we parse values into the exception correctly).

@lando-worker
Copy link
Copy Markdown

lando-worker bot commented Apr 9, 2026

Pull request closed by commit 0ebb8ff

lando-worker bot pushed a commit that referenced this pull request Apr 9, 2026
…ehan

 * GitSCM: detect patch conflicts on apply_patch_git (bug 2030211)
 * tests: replace _monkeypatch_scm with identical active_mock fixture
 * tests: add tests for GitSCM.detect_patch_conflict

Pull request: #1065
@lando-worker lando-worker bot closed this Apr 9, 2026
@shtrom shtrom deleted the bug2030211/apply-patch-conflict-reporting branch April 9, 2026 01:02
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