Changeset 51447 in webkit
- Timestamp:
- Nov 27, 2009 3:34:44 PM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r51446 r51447 1 2009-11-27 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 style-queue should only process each patch once 6 https://bugs.webkit.org/show_bug.cgi?id=31939 7 8 Before processing a patch, the try-queues now ask the web service 9 whether they have already processed the patch. This is an initial cut 10 of this functionality. I expect we're make it richer over time. 11 12 * Scripts/bugzilla-tool: 13 * Scripts/modules/commands/queues.py: 14 * Scripts/modules/patchcollection.py: 15 1 16 2009-11-27 Adam Barth <abarth@webkit.org> 2 17 -
trunk/WebKitTools/Scripts/bugzilla-tool
r51431 r51447 47 47 self.bugs = Bugzilla() 48 48 self.buildbot = BuildBot() 49 self.cached_scm = None 49 self._cached_scm = None 50 self._cached_status = None 50 51 self.steps = BuildSteps() 51 52 … … 57 58 # Lazily initialize SCM to not error-out before command line parsing (or when running non-scm commands). 58 59 original_cwd = os.path.abspath(".") 59 if not self. cached_scm:60 self. cached_scm = detect_scm_system(original_cwd)60 if not self._cached_scm: 61 self._cached_scm = detect_scm_system(original_cwd) 61 62 62 if not self. cached_scm:63 if not self._cached_scm: 63 64 script_directory = os.path.abspath(sys.path[0]) 64 65 webkit_directory = os.path.abspath(os.path.join(script_directory, "../..")) 65 self. cached_scm = detect_scm_system(webkit_directory)66 if self. cached_scm:66 self._cached_scm = detect_scm_system(webkit_directory) 67 if self._cached_scm: 67 68 log("The current directory (%s) is not a WebKit checkout, using %s" % (original_cwd, webkit_directory)) 68 69 else: 69 70 error("FATAL: Failed to determine the SCM system for either %s or %s" % (original_cwd, webkit_directory)) 70 71 71 return self.cached_scm 72 return self._cached_scm 73 74 def status(self): 75 if not self._cached_status: 76 self._cached_status = StatusBot() 77 return self._cached_status 72 78 73 79 def path(self): -
trunk/WebKitTools/Scripts/modules/bugzilla.py
r51277 r51447 325 325 return patches_to_land 326 326 327 def fetch_patches_from_review_queue(self, limit ):327 def fetch_patches_from_review_queue(self, limit=None): 328 328 patches_to_review = [] 329 329 for bug_id in self.fetch_bug_ids_from_review_queue(): 330 if l en(patches_to_review) >= limit:330 if limit and len(patches_to_review) >= limit: 331 331 break 332 332 patches = self.fetch_unreviewed_patches_from_bug(bug_id) -
trunk/WebKitTools/Scripts/modules/commands/queues.py
r51435 r51447 48 48 from modules.logging import error, log, tee 49 49 from modules.multicommandtool import MultiCommandTool, Command 50 from modules.patchcollection import PatchCollection 50 from modules.patchcollection import PatchCollection, PersistentPatchCollection, PersistentPatchCollectionDelegate 51 51 from modules.processutils import run_and_throw_if_fail 52 52 from modules.scm import CommitMessage, detect_scm_system, ScriptError, CheckoutNeedsUpdate … … 140 140 141 141 142 class AbstractTryQueue(AbstractQueue ):142 class AbstractTryQueue(AbstractQueue, PersistentPatchCollectionDelegate): 143 143 def __init__(self, options=[]): 144 144 AbstractQueue.__init__(self, options) 145 145 146 # PersistentPatchCollectionDelegate methods 147 148 def collection_name(self): 149 return self.name 150 151 def fetch_potential_patches(self): 152 return self.tool.bugs.fetch_patches_from_review_queue(limit=3) 153 154 def status_server(self): 155 return self.tool.status() 156 157 # AbstractQueue methods 158 146 159 def status_host(self): 147 160 return None # FIXME: A hack until we come up with a more generic status page. … … 149 162 def begin_work_queue(self): 150 163 AbstractQueue.begin_work_queue(self) 151 self._patches = PatchCollection(self.tool.bugs) 152 self._patches.add_patches(self.tool.bugs.fetch_patches_from_review_queue(limit=10)) 164 self._patches = PersistentPatchCollection(self) 153 165 154 166 def next_work_item(self): 155 self.log_progress(self._patches.patch_ids())156 167 return self._patches.next() 157 168 … … 164 175 def handle_unexpected_error(self, patch, message): 165 176 log(message) 177 self._patches.done(patch) 166 178 167 179 … … 177 189 def process_work_item(self, patch): 178 190 self.run_bugzilla_tool(["check-style", "--force-clean", patch["id"]]) 191 self._patches.done(patch) 179 192 180 193 … … 199 212 def process_work_item(self, patch): 200 213 self.run_bugzilla_tool(["build-attachment", self.port.flag(), "--force-clean", "--quiet", "--no-update", patch["id"]]) 214 self._patches.done(patch) -
trunk/WebKitTools/Scripts/modules/patchcollection.py
r51030 r51447 58 58 def __len__(self): 59 59 return len(self._patches) 60 61 62 class PersistentPatchCollectionDelegate: 63 def collection_name(self): 64 raise NotImplementedError, "subclasses must implement" 65 66 def fetch_potential_patches(self): 67 raise NotImplementedError, "subclasses must implement" 68 69 def status_server(self): 70 raise NotImplementedError, "subclasses must implement" 71 72 73 class PersistentPatchCollection: 74 _initial_status = "Attempted" 75 _terminal_status = "Done" 76 def __init__(self, delegate): 77 self._delegate = delegate 78 self._name = self._delegate.collection_name() 79 self._status = self._delegate.status_server() 80 81 def next(self): 82 patches = self._delegate.fetch_potential_patches() 83 for patch in patches: 84 last_status = self._status.patch_status(self._name, patch["id"]) 85 if not last_status: # FIXME: Add support for "Try again" 86 self._status.update_status(self._name, self._initial_status, patch) 87 return patch 88 89 def done(self, patch): 90 self._status.update_status(self._name, self._terminal_status, patch)
Note: See TracChangeset
for help on using the changeset viewer.