Changeset 85727 in webkit
- Timestamp:
- May 4, 2011 3:44:18 AM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r85723 r85727 1 2011-05-04 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 Fix circular dependency in webkitpy 6 https://bugs.webkit.org/show_bug.cgi?id=60075 7 8 These functions don't belong in bugzilla.py. They only exist there 9 because they are old. Really, these functions shouldn't be free 10 functions at all, but that's a patch for another day. 11 12 * Scripts/webkitpy/common/checkout/changelog.py: 13 * Scripts/webkitpy/common/checkout/changelog_unittest.py: 14 * Scripts/webkitpy/common/checkout/checkout.py: 15 * Scripts/webkitpy/common/config/urls.py: 16 * Scripts/webkitpy/common/net/bugzilla/__init__.py: 17 * Scripts/webkitpy/common/net/bugzilla/bugzilla.py: 18 * Scripts/webkitpy/common/net/bugzilla/bugzilla_unittest.py: 19 * Scripts/webkitpy/style/checkers/changelog.py: 20 * Scripts/webkitpy/tool/bot/irc_command.py: 21 * Scripts/webkitpy/tool/bot/sheriff.py: 22 * Scripts/webkitpy/tool/commands/upload.py: 23 1 24 2011-05-03 Pratik Solanki <psolanki@apple.com> 2 25 -
trunk/Tools/Scripts/webkitpy/common/checkout/changelog.py
r85065 r85727 35 35 import textwrap 36 36 37 from webkitpy.common.config.committers import CommitterList 38 import webkitpy.common.config.urls as config_urls 37 39 from webkitpy.common.system.deprecated_logging import log 38 from webkitpy.common.config.committers import CommitterList 39 from webkitpy.common.net.bugzilla import parse_bug_id_from_changelog 40 41 42 # FIXME: parse_bug_id should not be a free function. 43 # FIXME: Where should this function live in the dependency graph? 44 def parse_bug_id(message): 45 if not message: 46 return None 47 match = re.search(config_urls.bug_url_short, message) 48 if match: 49 return int(match.group('bug_id')) 50 match = re.search(config_urls.bug_url_long, message) 51 if match: 52 return int(match.group('bug_id')) 53 return None 54 55 56 # FIXME: parse_bug_id_from_changelog should not be a free function. 57 # Parse the bug ID out of a Changelog message based on the format that is 58 # used by prepare-ChangeLog 59 def parse_bug_id_from_changelog(message): 60 if not message: 61 return None 62 match = re.search("^\s*" + config_urls.bug_url_short + "$", message, re.MULTILINE) 63 if match: 64 return int(match.group('bug_id')) 65 match = re.search("^\s*" + config_urls.bug_url_long + "$", message, re.MULTILINE) 66 if match: 67 return int(match.group('bug_id')) 68 # We weren't able to find a bug URL in the format used by prepare-ChangeLog. Fall back to the 69 # first bug URL found anywhere in the message. 70 return parse_bug_id(message) 40 71 41 72 -
trunk/Tools/Scripts/webkitpy/common/checkout/changelog_unittest.py
r78777 r85727 92 92 """ 93 93 94 def test_parse_bug_id_from_changelog(self): 95 commit_text = ''' 96 2011-03-23 Ojan Vafai <ojan@chromium.org> 97 98 Add failing result for WebKit2. All tests that require 99 focus fail on WebKit2. See https://bugs.webkit.org/show_bug.cgi?id=56988. 100 101 * platform/mac-wk2/fast/css/pseudo-any-expected.txt: Added. 102 103 ''' 104 105 self.assertEquals(56988, parse_bug_id_from_changelog(commit_text)) 106 107 commit_text = ''' 108 2011-03-23 Ojan Vafai <ojan@chromium.org> 109 110 Add failing result for WebKit2. All tests that require 111 focus fail on WebKit2. See https://bugs.webkit.org/show_bug.cgi?id=56988. 112 https://bugs.webkit.org/show_bug.cgi?id=12345 113 114 * platform/mac-wk2/fast/css/pseudo-any-expected.txt: Added. 115 116 ''' 117 118 self.assertEquals(12345, parse_bug_id_from_changelog(commit_text)) 119 120 commit_text = ''' 121 2011-03-31 Adam Roben <aroben@apple.com> 122 123 Quote the executable path we pass to ::CreateProcessW 124 125 This will ensure that spaces in the path will be interpreted correctly. 126 127 Fixes <http://webkit.org/b/57569> Web process sometimes fails to launch when there are 128 spaces in its path 129 130 Reviewed by Steve Falkenburg. 131 132 * UIProcess/Launcher/win/ProcessLauncherWin.cpp: 133 (WebKit::ProcessLauncher::launchProcess): Surround the executable path in quotes. 134 135 ''' 136 137 self.assertEquals(57569, parse_bug_id_from_changelog(commit_text)) 138 94 139 def test_latest_entry_parse(self): 95 140 changelog_contents = u"%s\n%s" % (self._example_entry, self._example_changelog) -
trunk/Tools/Scripts/webkitpy/common/checkout/checkout.py
r85452 r85727 31 31 32 32 from webkitpy.common.config import urls 33 from webkitpy.common.checkout.changelog import ChangeLog 33 from webkitpy.common.checkout.changelog import ChangeLog, parse_bug_id_from_changelog 34 34 from webkitpy.common.checkout.commitinfo import CommitInfo 35 35 from webkitpy.common.checkout.scm import CommitMessage 36 36 from webkitpy.common.checkout.deps import DEPS 37 37 from webkitpy.common.memoized import memoized 38 from webkitpy.common.net.bugzilla import parse_bug_id_from_changelog39 38 from webkitpy.common.system.executive import Executive, run_command, ScriptError 40 39 from webkitpy.common.system.deprecated_logging import log -
trunk/Tools/Scripts/webkitpy/common/config/urls.py
r76926 r85727 27 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 28 29 import re 30 29 31 30 32 def view_source_url(local_path): … … 35 37 return "http://trac.webkit.org/changeset/%s" % revision_number 36 38 39 37 40 chromium_lkgr_url = "http://chromium-status.appspot.com/lkgr" 38 41 39 42 contribution_guidelines = "http://webkit.org/coding/contributing.html" 43 44 bug_server_host = "bugs.webkit.org" 45 _bug_server_regex = "https?://%s/" % re.sub('\.', '\\.', bug_server_host) 46 bug_server_url = "https://%s/" % bug_server_host 47 bug_url_long = _bug_server_regex + r"show_bug\.cgi\?id=(?P<bug_id>\d+)(&ctype=xml)?" 48 bug_url_short = r"http\://webkit\.org/b/(?P<bug_id>\d+)" -
trunk/Tools/Scripts/webkitpy/common/net/bugzilla/__init__.py
r82196 r85727 2 2 3 3 # We only export public API here. 4 # FIXME: parse_bug_id should not be a free function. 5 from .bugzilla import Bugzilla, parse_bug_id, parse_bug_id_from_changelog 4 from .bugzilla import Bugzilla 6 5 # Unclear if Bug and Attachment need to be public classes. 7 6 from .bug import Bug -
trunk/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py
r85080 r85727 44 44 from webkitpy.common.system.deprecated_logging import log 45 45 from webkitpy.common.config import committers 46 import webkitpy.common.config.urls as config_urls 46 47 from webkitpy.common.net.credentials import Credentials 47 48 from webkitpy.common.system.user import User 48 49 from webkitpy.thirdparty.BeautifulSoup import BeautifulSoup, BeautifulStoneSoup, SoupStrainer 49 50 50 51 # FIXME: parse_bug_id should not be a free function.52 def parse_bug_id(message):53 if not message:54 return None55 match = re.search(Bugzilla.bug_url_short, message)56 if match:57 return int(match.group('bug_id'))58 match = re.search(Bugzilla.bug_url_long, message)59 if match:60 return int(match.group('bug_id'))61 return None62 63 64 # FIXME: parse_bug_id_from_changelog should not be a free function.65 # Parse the bug ID out of a Changelog message based on the format that is66 # used by prepare-ChangeLog67 def parse_bug_id_from_changelog(message):68 if not message:69 return None70 match = re.search("^\s*" + Bugzilla.bug_url_short + "$", message, re.MULTILINE)71 if match:72 return int(match.group('bug_id'))73 match = re.search("^\s*" + Bugzilla.bug_url_long + "$", message, re.MULTILINE)74 if match:75 return int(match.group('bug_id'))76 # We weren't able to find a bug URL in the format used by prepare-ChangeLog. Fall back to the77 # first bug URL found anywhere in the message.78 return parse_bug_id(message)79 51 80 52 def timestamp(): … … 108 80 def _load_query(self, query): 109 81 self._bugzilla.authenticate() 110 full_url = "%s%s" % ( self._bugzilla.bug_server_url, query)82 full_url = "%s%s" % (config_urls.bug_server_url, query) 111 83 return self._bugzilla.browser.open(full_url) 112 84 … … 221 193 self.browser.set_handle_robots(False) 222 194 223 # FIXME: Much of this should go into some sort of config module,224 # such as common.config.urls.225 bug_server_host = "bugs.webkit.org"226 bug_server_regex = "https?://%s/" % re.sub('\.', '\\.', bug_server_host)227 bug_server_url = "https://%s/" % bug_server_host228 bug_url_long = bug_server_regex + r"show_bug\.cgi\?id=(?P<bug_id>\d+)(&ctype=xml)?"229 bug_url_short = r"http\://webkit\.org/b/(?P<bug_id>\d+)"230 231 195 def quips(self): 232 196 # We only fetch and parse the list of quips once per instantiation … … 240 204 return None 241 205 content_type = "&ctype=xml" if xml else "" 242 return "%sshow_bug.cgi?id=%s%s" % ( self.bug_server_url, bug_id, content_type)206 return "%sshow_bug.cgi?id=%s%s" % (config_urls.bug_server_url, bug_id, content_type) 243 207 244 208 def short_bug_url_for_bug_id(self, bug_id): … … 248 212 249 213 def add_attachment_url(self, bug_id): 250 return "%sattachment.cgi?action=enter&bugid=%s" % ( self.bug_server_url, bug_id)214 return "%sattachment.cgi?action=enter&bugid=%s" % (config_urls.bug_server_url, bug_id) 251 215 252 216 def attachment_url_for_id(self, attachment_id, action="view"): … … 256 220 if action and action != "view": 257 221 action_param = "&action=%s" % action 258 return "%sattachment.cgi?id=%s%s" % ( self.bug_server_url,222 return "%sattachment.cgi?id=%s%s" % (config_urls.bug_server_url, 259 223 attachment_id, 260 224 action_param) … … 406 370 return 407 371 408 credentials = Credentials( self.bug_server_host, git_prefix="bugzilla")372 credentials = Credentials(config_urls.bug_server_host, git_prefix="bugzilla") 409 373 410 374 attempts = 0 … … 414 378 415 379 log("Logging in as %s..." % username) 416 self.browser.open( self.bug_server_url +380 self.browser.open(config_urls.bug_server_url + 417 381 "index.cgi?GoAheadAndLogIn=1") 418 382 self.browser.select_form(name="login") … … 575 539 return 576 540 577 self.browser.open( self.bug_server_url + "enter_bug.cgi?product=WebKit")541 self.browser.open(config_urls.bug_server_url + "enter_bug.cgi?product=WebKit") 578 542 self.browser.select_form(name="Create") 579 543 component_items = self.browser.find_control('component').items … … 611 575 bug_id = self._check_create_bug_response(response.read()) 612 576 log("Bug %s created." % bug_id) 613 log("%sshow_bug.cgi?id=%s" % ( self.bug_server_url, bug_id))577 log("%sshow_bug.cgi?id=%s" % (config_urls.bug_server_url, bug_id)) 614 578 return bug_id 615 579 -
trunk/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla_unittest.py
r82766 r85727 31 31 import StringIO 32 32 33 from .bugzilla import Bugzilla, BugzillaQueries, parse_bug_id, parse_bug_id_from_changelog 34 33 from .bugzilla import Bugzilla, BugzillaQueries 34 35 from webkitpy.common.checkout.changelog import parse_bug_id 35 36 from webkitpy.common.system.outputcapture import OutputCapture 36 37 from webkitpy.tool.mocktool import MockBrowser … … 192 193 }], 193 194 } 194 195 def test_parse_bug_id_from_changelog(self):196 commit_text = '''197 2011-03-23 Ojan Vafai <ojan@chromium.org>198 199 Add failing result for WebKit2. All tests that require200 focus fail on WebKit2. See https://bugs.webkit.org/show_bug.cgi?id=56988.201 202 * platform/mac-wk2/fast/css/pseudo-any-expected.txt: Added.203 204 '''205 206 self.assertEquals(56988, parse_bug_id_from_changelog(commit_text))207 208 commit_text = '''209 2011-03-23 Ojan Vafai <ojan@chromium.org>210 211 Add failing result for WebKit2. All tests that require212 focus fail on WebKit2. See https://bugs.webkit.org/show_bug.cgi?id=56988.213 https://bugs.webkit.org/show_bug.cgi?id=12345214 215 * platform/mac-wk2/fast/css/pseudo-any-expected.txt: Added.216 217 '''218 219 self.assertEquals(12345, parse_bug_id_from_changelog(commit_text))220 221 commit_text = '''222 2011-03-31 Adam Roben <aroben@apple.com>223 224 Quote the executable path we pass to ::CreateProcessW225 226 This will ensure that spaces in the path will be interpreted correctly.227 228 Fixes <http://webkit.org/b/57569> Web process sometimes fails to launch when there are229 spaces in its path230 231 Reviewed by Steve Falkenburg.232 233 * UIProcess/Launcher/win/ProcessLauncherWin.cpp:234 (WebKit::ProcessLauncher::launchProcess): Surround the executable path in quotes.235 236 '''237 238 self.assertEquals(57569, parse_bug_id_from_changelog(commit_text))239 240 195 241 196 # FIXME: This should move to a central location and be shared by more unit tests. -
trunk/Tools/Scripts/webkitpy/style/checkers/changelog.py
r82382 r85727 28 28 import re 29 29 from common import TabChecker 30 from webkitpy.common. net.bugzillaimport parse_bug_id_from_changelog30 from webkitpy.common.checkout.changelog import parse_bug_id_from_changelog 31 31 32 32 -
trunk/Tools/Scripts/webkitpy/tool/bot/irc_command.py
r85065 r85727 32 32 from webkitpy.common.config import urls 33 33 from webkitpy.common.config.committers import CommitterList 34 from webkitpy.common. net.bugzillaimport parse_bug_id34 from webkitpy.common.checkout.changelog import parse_bug_id 35 35 from webkitpy.common.system.executive import ScriptError 36 36 from webkitpy.tool.bot.queueengine import TerminateQueue -
trunk/Tools/Scripts/webkitpy/tool/bot/sheriff.py
r75063 r85727 28 28 29 29 from webkitpy.common.config import urls 30 from webkitpy.common. net.bugzillaimport parse_bug_id30 from webkitpy.common.checkout.changelog import parse_bug_id 31 31 from webkitpy.common.system.deprecated_logging import log 32 32 from webkitpy.common.system.executive import ScriptError -
trunk/Tools/Scripts/webkitpy/tool/commands/upload.py
r82196 r85727 37 37 from webkitpy.tool import steps 38 38 39 from webkitpy.common.checkout.changelog import parse_bug_id_from_changelog 39 40 from webkitpy.common.config.committers import CommitterList 40 from webkitpy.common.net.bugzilla import parse_bug_id_from_changelog41 41 from webkitpy.common.system.deprecated_logging import error, log 42 42 from webkitpy.common.system.user import User
Note: See TracChangeset
for help on using the changeset viewer.