Skip to content

Handle the AI removing every mozilla patch when resolving conflicts. … - #431

Merged
tomrittervg merged 2 commits into
masterfrom
2026-10-15-tjr-ai-removed-all-patches
Oct 19, 2026
Merged

tomrittervg merged 2 commits into
masterfrom
2026-10-15-tjr-ai-removed-all-patches

Conversation

@tomrittervg

Copy link
Copy Markdown
Collaborator

…Fixes #430

If the AI resolves a patch conflict by dropping every patch (e.g. they were all upstreamed), the library no longer has patches, but we decided what to do next from the moz.yaml as it was at the start of the run. The re-apply then failed with "there are no vendored patches defined", and had it got past that, committing the (empty) patches and the phabricator revision count would have failed too. This happened to libsrtp on the dev instance.

Re-read the moz.yaml after the AI succeeds; if no patches remain, skip the re-apply and the patches commit and submit one fewer revision.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Manifest reread errors bypass failure handling and leave jobs in CREATED status.

1 open finding
What changed in this PR

Handles vendoring when AI conflict resolution removes all local patches, addressing #430.

Changes:

  • Re-read patch metadata after AI resolution.
  • Skip patch application and committing when none remain, adjusting revision counts.
  • Add regression coverage for this workflow.
File Description
tests/​mock_libraryprovider.py Simulates patch removal after AI resolution.
tests/​functionality_all_platforms.py Tests successful vendoring with all patches removed.
tasktypes/​vendoring.py Adjusts patch processing and revision submission.
components/​libraryprovider.py Reads current patch state from moz.yaml.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tasktypes/vendoring.py Outdated
…ixes #430

If the AI resolves a patch conflict by dropping every patch (e.g. they were
all upstreamed), the library no longer has patches, but we decided what to do
next from the moz.yaml as it was at the start of the run. The re-apply then
failed with "there are no vendored patches defined", and had it got past that,
committing the (empty) patches and the phabricator revision count would have
failed too. This happened to libsrtp on the dev instance.

Re-read the moz.yaml after the AI succeeds; if no patches remain, skip the
re-apply and the patches commit and submit one fewer revision.
Re-reading the moz.yaml happened outside the error handling for re-applying
the patches, so if the AI left it missing or malformed the exception escaped,
the job stayed in CREATED, and the maintainer wasn't told. Before re-reading
was added, the same problem surfaced in the re-apply and was handled. Move it
inside that handler.

Also treat a moz.yaml without a vendoring section as broken rather than as
having no patches.
@tomrittervg
tomrittervg force-pushed the 2026-10-15-tjr-ai-removed-all-patches branch from b78aa35 to 83fa3ae Compare October 19, 2026 16:42
@tomrittervg
tomrittervg requested a balanced review from Copilot October 19, 2026 16:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The control flow consistently handles patch removal and metadata errors, with regression coverage and no identified blocking issues.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@tomrittervg
tomrittervg merged commit 272321b into master Oct 19, 2026
17 checks passed
@tomrittervg
tomrittervg deleted the 2026-10-15-tjr-ai-removed-all-patches branch October 19, 2026 18:43
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.

Handle the case where AI removes all local patches

2 participants