Skip to content

2026 11 03 tjr spurious with patches - #449

Merged
tomrittervg merged 2 commits into
masterfrom
2026-11-03-tjr-spurious-with-patches
Nov 4, 2026
Merged

tomrittervg merged 2 commits into
masterfrom
2026-11-03-tjr-spurious-with-patches

Conversation

@tomrittervg

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI 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.

🟡 Changes recommended

Repository reset uses hg shelve --cleanup, which deletes all shelves rather than only Updatebot’s shelf, risking loss of unrelated saved changes.

3 open issues
What changed in this PR

This PR updates Updatebot’s vendoring flow to detect spurious updates caused solely by removing and reapplying local patches, before creating a job or filing a bug.

Changes:

  • Reapply patches temporarily and compare changes, excluding the manifest and generated files.
  • Add Mercurial shelving helpers and track files added or deleted by patches.
  • Add real-Mercurial regression coverage and supporting test fixtures and CI setup.
File Description
tests/​vendoring_hg/​fake_mach.py Simulates vendoring, patch application, and post-patch scripts.
tests/​library.py Adds a vendor-directory fixture.
tests/​functionality_vendoring_hg.py Tests vendoring and cleanup with real Mercurial operations.
tests/​functionality_utilities.py Adds command mocks for the spurious-update check.
test.py Registers the new regression suite.
tasktypes/​vendoring.py Detects and skips patch-only spurious updates.
components/​libraryprovider.py Loads vendor-directory and generated-file paths.
components/​hg.py Adds shelving, change detection, and patch-file staging.
.github/​workflows/​ci.yml Installs Mercurial for Linux CI tests.

Review effort: Balanced

Comment thread components/hg.py Resolved
Comment thread tests/functionality_vendoring_hg.py Resolved
Comment thread tests/vendoring_hg/fake_mach.py Resolved
@tomrittervg
tomrittervg force-pushed the 2026-11-03-tjr-spurious-with-patches branch from 9ad5793 to 1d91eef Compare November 3, 2026 21:00
@tomrittervg
tomrittervg requested a balanced review from Copilot November 3, 2026 21:05

Copilot AI 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.

🟡 Changes recommended

The generated-file metadata parsing lacks tests through validate_library for explicit and default vendor directories, leaving checkout-relative paths that control update skipping unverified.

1 open issue
3 resolved since last review

Review effort: Balanced

Comment thread components/libraryprovider.py Resolved
@tomrittervg
tomrittervg force-pushed the 2026-11-03-tjr-spurious-with-patches branch from 1d91eef to 77c3eab Compare November 3, 2026 21:17
@tomrittervg
tomrittervg requested a balanced review from Copilot November 3, 2026 21:17

Copilot AI 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.

🔵 Needs a closer look

The pre-commit shelve/revert/purge flow needs validation against real Gecko manifests/actions and interrupted restoration because the harness substitutes mach and co-locates vendor and YAML directories.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

These run the vendoring flow against a real Mercurial repository, with a fake
mach that behaves like mozbuild's vendoring code, so the hg operations are
tested for real. They cover upstream adding, changing and deleting files and
directories, our patches adding and deleting files, several patches, binary
files and exec bits, post-patch scripts (keeping a source list, generating
files, and failing), patches that no longer apply in various ways, and
spurious updates with and without patches.

Some of them fail until the next commit: updates where our patches are the
only difference aren't recognised as spurious (#425), and files our patches
or post-patch scripts add or delete aren't committed.

Also teach the mocked functionality tests about the spurious-update check
that the next commit adds, run the new tests in CI (with Mercurial
installed), and expect the dav1d test library's vendor-directory.
…our patches add or delete. Fixes #425

Libraries with patches are vendored with --patch-mode none, so mach's
spurious-update check always sees our patches being removed as a change, and
Updatebot filed bugs for updates that, once the patches were reapplied,
changed nothing. Before creating the job, save the working directory, apply
the patches, and treat the update as spurious if nothing but the moz.yaml and
generated files differs. Otherwise put the working directory back exactly as
it was and carry on as before.

`./mach vendor --patch-mode only` also doesn't register files the patches (or post-patch actions) add
or delete, so committing the patches left them out (or failed with "nothing
changed"). Register them first.
@tomrittervg
tomrittervg force-pushed the 2026-11-03-tjr-spurious-with-patches branch from 77c3eab to 6b08581 Compare November 4, 2026 03:02
@tomrittervg
tomrittervg merged commit d9f881d into master Nov 4, 2026
16 checks passed
@tomrittervg
tomrittervg deleted the 2026-11-03-tjr-spurious-with-patches branch November 4, 2026 13:30
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