Closed Bug 1869733 Opened 2 years ago Closed 2 years ago

`--push-to-lando` only considers one official looking remote on Git

Categories

(Developer Infrastructure :: Try, defect)

defect

Tracking

(firefox124 fixed)

RESOLVED FIXED
Tracking Status
firefox124 --- fixed

People

(Reporter: standard8, Assigned: sheehan)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

From my local git-cinnabar repository, I pushed to try using ./mach try auto --push-to-lando. The resulting try push was based on a 2-week old version of the repository (see parent commit here).

It should have been based on this revision from yesterday.

Looking at bug 1866395, I'm guessing this might be something to do with my git setup, I'm happy to provide more details as necessary.

We tracked this down to my repository setup. My remotes:

% git remote -v
autoland	hg::https://hg.mozilla.org/integration/autoland/ (fetch)
autoland	hg::https://hg.mozilla.org/integration/autoland/ (push)
beta	hg::https://hg.mozilla.org/releases/mozilla-beta (fetch)
beta	hg::https://hg.mozilla.org/releases/mozilla-beta (push)
central	hg::https://hg.mozilla.org/mozilla-central (fetch)
central	hg::https://hg.mozilla.org/mozilla-central (push)
try	hg::https://hg.mozilla.org/try (fetch)
try	hg::ssh://hg.mozilla.org/try (push)

A try push that I tried gave logs of:

Using 9a6773b9d9d5c41ecf4866f844019ff312ae0c3d as the hg base commit.
Submitting stack of 311 nodes and the try commit.
Patches gathered for submission.
Submitting patches to Lando.
Lando try submission success, took 34.57 seconds. Landing job id: 74898.

This failed to apply on Lando because the commits I had pushed were against mozilla-central. The id 9a6773b9d9d5c41ecf4866f844019ff312ae0c3d was equivalent to the autoland tip. Hence it had found autoland rather than central as the base commit.

Summary: `--push-to-try` created a push based on a 2-week old revision (git-cinnabar?) → `--push-to-lando` only considers one official looking remote on Git
Assignee: nobody → sheehan

A previous patch added parsing git remote -v, preferring
mozilla-unified as the official upstream remote and falling
back to the first official-looking remote if unified was not
found. We assumed that a developer is either using mozilla-unified,
or is using a single-headed repo like central. This overlooks
the fact that it is possible to clone from central, and then
pull other repos in, creating a repo with multiple official
remotes.

Update the get_upstream_remote function to find all official
looking remotes instead of a single official remote, and change
the get_remote_arg function to return a list of --remotes
arguments to be passed to various Git commands. This allows
Git to take all official remotes into consideration and more
precisely find the commits which are not present on any official
upsteams.

Add a test for get_mozilla_remote_args while we are here.

Pushed by cosheehan@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/22739418710d consider all official remotes when finding base ref and patches r=zeid
Component: Lando → Try
Product: Conduit → Developer Infrastructure
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: