| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2014 the V8 project authors. All rights reserved. | 2 # Copyright 2014 the V8 project authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import argparse | 6 import argparse |
| 7 import json | 7 import json |
| 8 import os | 8 import os |
| 9 import sys | 9 import sys |
| 10 import urllib | 10 import urllib |
| 11 | 11 |
| 12 from common_includes import * | 12 from common_includes import * |
| 13 import chromium_roll | 13 import chromium_roll |
| 14 | 14 |
| 15 CLUSTERFUZZ_API_KEY_FILE = "CLUSTERFUZZ_API_KEY_FILE" |
| 16 |
| 15 CONFIG = { | 17 CONFIG = { |
| 16 PERSISTFILE_BASENAME: "/tmp/v8-auto-roll-tempfile", | 18 PERSISTFILE_BASENAME: "/tmp/v8-auto-roll-tempfile", |
| 19 CLUSTERFUZZ_API_KEY_FILE: ".cf_api_key", |
| 17 } | 20 } |
| 18 | 21 |
| 19 CR_DEPS_URL = 'http://src.chromium.org/svn/trunk/src/DEPS' | 22 CR_DEPS_URL = 'http://src.chromium.org/svn/trunk/src/DEPS' |
| 20 | 23 |
| 21 class CheckActiveRoll(Step): | 24 class CheckActiveRoll(Step): |
| 22 MESSAGE = "Check active roll." | 25 MESSAGE = "Check active roll." |
| 23 | 26 |
| 24 @staticmethod | 27 @staticmethod |
| 25 def ContainsChromiumRoll(changes): | 28 def ContainsChromiumRoll(changes): |
| 26 for change in changes: | 29 for change in changes: |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 # Interpret the DEPS file to retrieve the v8 revision. | 61 # Interpret the DEPS file to retrieve the v8 revision. |
| 59 Var = lambda var: '%s' | 62 Var = lambda var: '%s' |
| 60 exec(self.ReadURL(CR_DEPS_URL)) | 63 exec(self.ReadURL(CR_DEPS_URL)) |
| 61 last_roll = vars['v8_revision'] | 64 last_roll = vars['v8_revision'] |
| 62 if last_roll >= self["last_push"]: | 65 if last_roll >= self["last_push"]: |
| 63 print("There is no newer v8 revision than the one in Chromium (%s)." | 66 print("There is no newer v8 revision than the one in Chromium (%s)." |
| 64 % last_roll) | 67 % last_roll) |
| 65 return True | 68 return True |
| 66 | 69 |
| 67 | 70 |
| 71 class CheckClusterFuzz(Step): |
| 72 MESSAGE = "Check ClusterFuzz api for new problems." |
| 73 |
| 74 def RunStep(self): |
| 75 if not os.path.exists(self.Config(CLUSTERFUZZ_API_KEY_FILE)): |
| 76 print "Skipping ClusterFuzz check. No api key file found." |
| 77 return False |
| 78 api_key = FileToText(self.Config(CLUSTERFUZZ_API_KEY_FILE)) |
| 79 # Check for open, reproducible issues that have no associated bug. |
| 80 result = self._side_effect_handler.ReadClusterFuzzAPI( |
| 81 api_key, job_type="linux_asan_d8_dbg", reproducible="True", |
| 82 open="True", bug_information="", |
| 83 revision_greater_or_equal=self["last_push"]) |
| 84 if result: |
| 85 print "Stop due to pending ClusterFuzz issues." |
| 86 return True |
| 87 |
| 88 |
| 68 class RollChromium(Step): | 89 class RollChromium(Step): |
| 69 MESSAGE = "Roll V8 into Chromium." | 90 MESSAGE = "Roll V8 into Chromium." |
| 70 | 91 |
| 71 def RunStep(self): | 92 def RunStep(self): |
| 72 if self._options.roll: | 93 if self._options.roll: |
| 73 args = [ | 94 args = [ |
| 74 "--author", self._options.author, | 95 "--author", self._options.author, |
| 75 "--reviewer", self._options.reviewer, | 96 "--reviewer", self._options.reviewer, |
| 76 "--chromium", self._options.chromium, | 97 "--chromium", self._options.chromium, |
| 77 "--force", | 98 "--force", |
| 99 "--use-commit-queue", |
| 78 ] | 100 ] |
| 79 if self._options.sheriff: | 101 if self._options.sheriff: |
| 80 args.extend([ | 102 args.extend([ |
| 81 "--sheriff", "--googlers-mapping", self._options.googlers_mapping]) | 103 "--sheriff", "--googlers-mapping", self._options.googlers_mapping]) |
| 82 R = chromium_roll.ChromiumRoll | 104 R = chromium_roll.ChromiumRoll |
| 83 self._side_effect_handler.Call( | 105 self._side_effect_handler.Call( |
| 84 R(chromium_roll.CONFIG, self._side_effect_handler).Run, | 106 R(chromium_roll.CONFIG, self._side_effect_handler).Run, |
| 85 args) | 107 args) |
| 86 | 108 |
| 87 | 109 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 101 if not options.author: | 123 if not options.author: |
| 102 print "An author (-a) is required." | 124 print "An author (-a) is required." |
| 103 return False | 125 return False |
| 104 return True | 126 return True |
| 105 | 127 |
| 106 def _Steps(self): | 128 def _Steps(self): |
| 107 return [ | 129 return [ |
| 108 CheckActiveRoll, | 130 CheckActiveRoll, |
| 109 DetectLastPush, | 131 DetectLastPush, |
| 110 DetectLastRoll, | 132 DetectLastRoll, |
| 133 CheckClusterFuzz, |
| 111 RollChromium, | 134 RollChromium, |
| 112 ] | 135 ] |
| 113 | 136 |
| 114 | 137 |
| 115 if __name__ == "__main__": # pragma: no cover | 138 if __name__ == "__main__": # pragma: no cover |
| 116 sys.exit(AutoRoll(CONFIG).Run()) | 139 sys.exit(AutoRoll(CONFIG).Run()) |
| OLD | NEW |