Closed Bug 1007435 Opened 10 years ago Closed 10 years ago

Bugzilla form submission did something weird IGNORE THIS BUG.

Categories

(Release Engineering :: General, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1007437

People

(Reporter: jhford, Unassigned)

Details

Attachments

(1 file)

Right now, gaia-try is testing against the tip of the contributors branch.  This is neat, but it isn't exactly what we need.  Github does internal merges to determine whether the PR is able to be merged.  The result of that merge is what we want to test against.

That merge commit is available to the try server hook I wrote, so sending it to Gaia-try is simple.  The reason for filing this bug is that a default clone of gaia will not have the commits for the pull requests.


Example: PR#18853

The API (https://api.github.com/repos/mozilla-b2g/gaia/pulls/18853) gives use the following important commits:

mozilla-b2g:master's sha: d62f9f37ed325df7726dd999f0d49f80be16c18b
RickyChien:new-mocha's sha: 70c4c6204768d7db8d7cefef52d54ac77db1583b
merge_commit_sha: 1ffc5fa424179b46ab14ff0124fc59f4782c3784

There are two methods for getting access to pull request heads.  One is to follow https://help.github.com/articles/checking-out-pull-requests-locally, but that's inefficient as we have nearly 20k pull requests.

Below is what's needed to fetch the reference and required objects as well as checking out a working copy.

$ git fetch origin +refs/pull/18853/merge:pr18853
From https://github.com/mozilla-b2g/gaia
 * [new ref]         refs/pull/18853/merge -> pr18853
$ git show pr18853
commit 1ffc5fa424179b46ab14ff0124fc59f4782c3784
Merge: 03cf633 70c4c62
Author: RickyChien <ricky060709@gmail.com>
Date:   Wed May 7 22:20:03 2014 +0000

    Merge 70c4c6204768d7db8d7cefef52d54ac77db1583b into 03cf6332a410f5b8cda3bc6edbdc56a8d14166af

$ git branch
  master
  pr18853
$ git checkout pr18853

I'm going to start including the pull request number in the 'git' key of the gaia.json file, such that we have:

{
  "git": {
    "git_revision": "abc123",
    "remote": "remote_url",
    "github_pr_number": 11111
  }
}

I've attached a patch that I can't test.


A further optimization that could be made, since we only care about a single reference and are clobbering, is to do a shallow fetch of just that one reference.

That can be done with something like:
mkdir dest && cd dest && git init && git fetch --depth 1 $remote +refs/pull/$pr_num/merge:local && git checkout $revision
double submitted this somehow
No longer blocks: 914632, 989131
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
Summary: We need to pull in merge commit refs for gaia-try runs → Bugzilla form submission did something weird IGNORE THIS BUG.
Component: General Automation → General
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: