Closed Bug 1866395 Opened 2 years ago Closed 2 years ago

`--push-to-lando` on a Git repo with a non-Mozilla remote will not find the correct base revision

Categories

(Developer Infrastructure :: Try, defect)

defect

Tracking

(firefox122 fixed)

RESOLVED FIXED
Tracking Status
firefox122 --- fixed

People

(Reporter: sheehan, Assigned: sheehan)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

When using --push-to-lando on Git, mach try will try and find the base commit using git rev-list HEAD --topo-order --boundary --not --remotes, essentially returning the first descendant commit from HEAD that is found on a remote branch. This means if a user has a non-Mozilla Git remote branch in their repo (for example a fork on Github or some other machine they push to) Git will find that remote branch and consider it to be the base revision to apply the patch to. Lando will then fail with a "revision not found" error while trying to apply the patch.

The --remotes flag accepts an optional pattern argument which can be used to limit the remotes that are considered when finding the base revision. We should add some simple parsing of git remote to find which remote is the actual Firefox repo and only consider that remote when determining the base commit.

Assignee: nobody → sheehan
Severity: -- → S3

Add a get_mozilla_upstream_remote method for GitRepository that
scans the output of git remote -v for an official Mozilla URL. Use
this URL in base_ref to limit the remotes considered for remote
branches, defaulting to --remotes without an argument if one can't
be found.

Attachment #9365850 - Attachment description: Bug 1866395: add `get_mozilla_upstream_remote` and use it to find base ref r?ahochheiden → Bug 1866395: add `get_mozilla_upstream_remote` and use it to find Git base ref r?ahochheiden
Pushed by cosheehan@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/447b98a84286 add `get_mozilla_upstream_remote` and use it to find Git base ref r=ahochheiden
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Blocks: 1864468
See Also: → 1869733
Blocks: 1856590
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: