Merge lp:~fgiff/linaro-android-bot-review/870803 into lp:linaro-android-bot-review

Proposed by Frans Gifford
Status: Merged
Approved by: Frans Gifford
Approved revision: 39
Merged at revision: 75
Proposed branch: lp:~fgiff/linaro-android-bot-review/870803
Merge into: lp:linaro-android-bot-review
Diff against target: 92 lines (+34/-27)
2 files modified
androidbotreview.py (+16/-12)
tests/testandroidbotreview.py (+18/-15)
To merge this branch: bzr merge lp:~fgiff/linaro-android-bot-review/870803
Reviewer Review Type Date Requested Status
Frans Gifford (community) Approve
Review via email: mp+79533@code.launchpad.net

Description of the change

Added fix for the following bugs, though it appears to be obsolete due to the newer POST_CHECKOUT_HOOK, so I commented it out and suggest inserting it anyway for reference.
#870801 Bot can't tell if given change applicable to current build at all
#870803 Bot doesn't understand difference between project and repo checkout path

To post a comment you must log in.
39. By Frans Gifford

Catch-up merge.

Revision history for this message
Frans Gifford (fgiff) wrote :

Doesn't affect anything in deployment.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'androidbotreview.py'
2--- androidbotreview.py 2011-10-17 21:14:56 +0000
3+++ androidbotreview.py 2011-10-18 09:19:25 +0000
4@@ -105,7 +105,7 @@
5 extra_config += "CONFIGURATION='%s && %s && %s && %s && %s && %s && %s'" % (
6 "cd .repo/manifests",
7 "git reset --hard",
8- "git fetch http://%s/p/%s %s" % (
9+ "git fetch git://%s/%s %s" % (
10 self.gc.review_host,
11 rev["project"],
12 rev["currentPatchSet"]["ref"]),
13@@ -114,17 +114,21 @@
14 "repo init -u .repo/manifests -b build",
15 "repo sync -ld")
16 else:
17- # repo download doesn't work from android-build. Use a workaround.
18- # It's probably something to do with the mirroring we do.
19- #extra_config = "repo download %s %s/%s" % (
20- # rev["project"],
21- # rev["number"],
22- # rev["currentPatchSet"]["number"])
23-# extra_config += "CONFIGURATION='%s && %s && %s && %s'" % (
24-# "cd %s" % (rev["project"]),
25-# "git fetch http://%s/p/%s %s" % (self.gc.review_host,
26-# rev["project"],
27-# rev["currentPatchSet"]["ref"]),
28+ # If the change is in a git in our manifest, then fetch it.
29+ # Otherwise do nothing.
30+ # repo download doesn't work as the mirroring means that:
31+ # * The project lines in the manifest are wrong.
32+ # * None of the remotes from the real manifest exist.
33+ # We use a workaround to pull from the right git.
34+# extra_config += "CONFIGURATION='%s && %s && %s && %s && %s && %s && %s && %s'" % (
35+# "cp out/source-manifest.xml .repo/manifest.xml",
36+# "if ! (repo list %s); then exit 0; fi" %(rev["project"]),
37+# 'PROJ_DIR=`expr "\`repo list %s\`" : "\(^\w*\)"`' % (rev["project"]),
38+# "cp .repo/mirror-manifest.xml .repo/manifest.xml",
39+# "cd $PROJ_DIR",
40+# "git fetch git://%s/%s %s" % (self.gc.review_host,
41+# rev["project"],
42+# rev["currentPatchSet"]["ref"]),
43 # "git checkout FETCH_HEAD",
44 # "cd -")
45 extra_config += 'POST_CHECKOUT_HOOK="apply-gerrit-change %s %s %s"' % (
46
47=== modified file 'tests/testandroidbotreview.py'
48--- tests/testandroidbotreview.py 2011-09-30 08:31:25 +0000
49+++ tests/testandroidbotreview.py 2011-10-18 09:19:25 +0000
50@@ -45,24 +45,27 @@
51
52
53 def testGet_extra_config(self):
54- extra_config = self.i.get_extra_config({"project": "a",
55+ extra_config = self.i.get_extra_config({"project": "a1/a2",
56 "currentPatchSet": {"ref": "b"}})
57- self.assertEquals("CONFIGURATION='%s && %s && %s && %s'" % (
58- "cd a",
59- "git fetch http://%s/p/%s %s" % (self.i.gc.review_host, "a", "b"),
60- "git checkout FETCH_HEAD",
61- "cd -"), extra_config)
62+ self.assert_(0 < extra_config.find(
63+ "CONFIGURATION='%s && %s && %s && %s'" % (
64+ "cd $(repo list | sed '/a1\/a2/ ! d; s/^\(\w*\).*/\1/')",
65+ "git fetch http://%s/p/%s %s" % (
66+ self.i.gc.review_host, "a1/a2", "b"),
67+ "git checkout FETCH_HEAD",
68+ "cd -")))
69 extra_config = self.i.get_extra_config({"project": "platform/manifest",
70 "currentPatchSet": {"ref": "b"}})
71- self.assertEquals("CONFIGURATION='%s && %s && %s && %s && %s && %s && %s'" % (
72- "cd .repo/manifests",
73- "git reset --hard",
74- "git fetch http://%s/p/%s %s" % (self.i.gc.review_host,
75- "platform/manifest", "b"),
76- "git checkout -b build FETCH_HEAD",
77- "cd -",
78- "repo init -u .repo/manifests -b build",
79- "repo sync -ld"), extra_config)
80+ self.assert_(0 < extra_config.find(
81+ "CONFIGURATION='%s && %s && %s && %s && %s && %s && %s'" % (
82+ "cd .repo/manifests",
83+ "git reset --hard",
84+ "git fetch http://%s/p/%s %s" % (self.i.gc.review_host,
85+ "platform/manifest", "b"),
86+ "git checkout -b build FETCH_HEAD",
87+ "cd -",
88+ "repo init -u .repo/manifests -b build",
89+ "repo sync -ld")))
90
91
92 def xtestBuild_jobs(self):

Subscribers

People subscribed via source and target branches

to all changes: