Revision: 21996
Author: [email protected]
Date: Wed Jun 25 08:17:45 2014 UTC
Log: Add clusterfuzz check to v8 auto-roll script and use CQ.
This adds a check step that makes sure there are no new issues when rolling
into chromium.
It also checks the cq bit on roll upload.
BUG=
[email protected]
Review URL: https://codereview.chromium.org/315133003
http://code.google.com/p/v8/source/detail?r=21996
Modified:
/branches/bleeding_edge/tools/push-to-trunk/auto_roll.py
/branches/bleeding_edge/tools/push-to-trunk/chromium_roll.py
/branches/bleeding_edge/tools/push-to-trunk/common_includes.py
/branches/bleeding_edge/tools/push-to-trunk/git_recipes.py
/branches/bleeding_edge/tools/push-to-trunk/test_scripts.py
=======================================
--- /branches/bleeding_edge/tools/push-to-trunk/auto_roll.py Tue Apr 8
12:07:49 2014 UTC
+++ /branches/bleeding_edge/tools/push-to-trunk/auto_roll.py Wed Jun 25
08:17:45 2014 UTC
@@ -12,8 +12,11 @@
from common_includes import *
import chromium_roll
+CLUSTERFUZZ_API_KEY_FILE = "CLUSTERFUZZ_API_KEY_FILE"
+
CONFIG = {
PERSISTFILE_BASENAME: "/tmp/v8-auto-roll-tempfile",
+ CLUSTERFUZZ_API_KEY_FILE: ".cf_api_key",
}
CR_DEPS_URL = 'http://src.chromium.org/svn/trunk/src/DEPS'
@@ -65,6 +68,24 @@
return True
+class CheckClusterFuzz(Step):
+ MESSAGE = "Check ClusterFuzz api for new problems."
+
+ def RunStep(self):
+ if not os.path.exists(self.Config(CLUSTERFUZZ_API_KEY_FILE)):
+ print "Skipping ClusterFuzz check. No api key file found."
+ return False
+ api_key = FileToText(self.Config(CLUSTERFUZZ_API_KEY_FILE))
+ # Check for open, reproducible issues that have no associated bug.
+ result = self._side_effect_handler.ReadClusterFuzzAPI(
+ api_key, job_type="linux_asan_d8_dbg", reproducible="True",
+ open="True", bug_information="",
+ revision_greater_or_equal=self["last_push"])
+ if result:
+ print "Stop due to pending ClusterFuzz issues."
+ return True
+
+
class RollChromium(Step):
MESSAGE = "Roll V8 into Chromium."
@@ -75,6 +96,7 @@
"--reviewer", self._options.reviewer,
"--chromium", self._options.chromium,
"--force",
+ "--use-commit-queue",
]
if self._options.sheriff:
args.extend([
@@ -108,6 +130,7 @@
CheckActiveRoll,
DetectLastPush,
DetectLastRoll,
+ CheckClusterFuzz,
RollChromium,
]
=======================================
--- /branches/bleeding_edge/tools/push-to-trunk/chromium_roll.py Tue Apr 8
12:07:49 2014 UTC
+++ /branches/bleeding_edge/tools/push-to-trunk/chromium_roll.py Wed Jun 25
08:17:45 2014 UTC
@@ -105,7 +105,8 @@
% self["sheriff"])
self.GitCommit("%s%s\n\nTBR=%s" % (commit_title, sheriff, rev))
self.GitUpload(author=self._options.author,
- force=self._options.force_upload)
+ force=self._options.force_upload,
+ cq=self._options.use_commit_queue)
print "CL uploaded."
@@ -143,6 +144,9 @@
"directory to automate the V8 roll."))
parser.add_argument("-l", "--last-push",
help="The git commit ID of the last push to
trunk.")
+ parser.add_argument("--use-commit-queue",
+ help="Check the CQ bit on upload.",
+ default=False, action="store_true")
def _ProcessOptions(self, options): # pragma: no cover
if not options.manual and not options.reviewer:
=======================================
--- /branches/bleeding_edge/tools/push-to-trunk/common_includes.py Mon May
5 15:16:26 2014 UTC
+++ /branches/bleeding_edge/tools/push-to-trunk/common_includes.py Wed Jun
25 08:17:45 2014 UTC
@@ -28,6 +28,7 @@
import argparse
import datetime
+import httplib
import imp
import json
import os
@@ -207,6 +208,25 @@
finally:
url_fh.close()
+ def ReadClusterFuzzAPI(self, api_key, **params):
+ params["api_key"] = api_key
+ params = urllib.urlencode(params)
+
+ headers = {"Content-type": "application/x-www-form-urlencoded"}
+
+ conn = httplib.HTTPSConnection("backend-dot-cluster-fuzz.appspot.com")
+ conn.request("POST", "/_api/", params, headers)
+
+ response = conn.getresponse()
+ data = response.read()
+
+ try:
+ return json.loads(data)
+ except:
+ print data
+ print "ERROR: Could not read response. Is your key valid?"
+ raise
+
def Sleep(self, seconds):
time.sleep(seconds)
=======================================
--- /branches/bleeding_edge/tools/push-to-trunk/git_recipes.py Wed Apr 9
14:30:02 2014 UTC
+++ /branches/bleeding_edge/tools/push-to-trunk/git_recipes.py Wed Jun 25
08:17:45 2014 UTC
@@ -144,7 +144,7 @@
args.append(Quoted(patch_file))
self.Git(MakeArgs(args))
- def GitUpload(self, reviewer="", author="", force=False):
+ def GitUpload(self, reviewer="", author="", force=False, cq=False):
args = ["cl upload --send-mail"]
if author:
args += ["--email", Quoted(author)]
@@ -152,6 +152,8 @@
args += ["-r", Quoted(reviewer)]
if force:
args.append("-f")
+ if cq:
+ args.append("--use-commit-queue")
# TODO(machenbach): Check output in forced mode. Verify that all
required
# base files were uploaded, if not retry.
self.Git(MakeArgs(args), pipe=False)
=======================================
--- /branches/bleeding_edge/tools/push-to-trunk/test_scripts.py Mon May 5
15:16:26 2014 UTC
+++ /branches/bleeding_edge/tools/push-to-trunk/test_scripts.py Wed Jun 25
08:17:45 2014 UTC
@@ -35,6 +35,7 @@
from auto_push import CheckLastPush
from auto_push import SETTINGS_LOCATION
import auto_roll
+from auto_roll import CLUSTERFUZZ_API_KEY_FILE
import common_includes
from common_includes import *
import merge_to_branch
@@ -66,6 +67,7 @@
"/tmp/test-merge-to-branch-tempfile-already-merging",
COMMIT_HASHES_FILE: "/tmp/test-merge-to-branch-tempfile-PATCH_COMMIT_HASHES",
TEMPORARY_PATCH_FILE: "/tmp/test-merge-to-branch-tempfile-temporary-patch",
+ CLUSTERFUZZ_API_KEY_FILE: "/tmp/test-fake-cf-api-key",
}
@@ -384,6 +386,11 @@
else:
return self._url_mock.Call("readurl", url)
+ def ReadClusterFuzzAPI(self, api_key, **params):
+ # TODO(machenbach): Use a mock for this and add a test that stops
rolling
+ # due to clustefuzz results.
+ return []
+
def Sleep(self, seconds):
pass
@@ -996,6 +1003,8 @@
self.assertEquals(1, result)
def testAutoRoll(self):
+ TEST_CONFIG[CLUSTERFUZZ_API_KEY_FILE] = self.MakeEmptyTempFile()
+ TextToFile("fake key", TEST_CONFIG[CLUSTERFUZZ_API_KEY_FILE])
self.ExpectReadURL([
URL("https://codereview.chromium.org/search",
"owner=author%40chromium.org&limit=30&closed=3&format=json",
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.