WebKit Bugzilla
Attachment 346403 Details for
Bug 188268
: this is a test
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188268-20180802120139.patch (text/plain), 20.24 KB, created by
Lucas Forschler
on 2018-08-02 12:01:40 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Lucas Forschler
Created:
2018-08-02 12:01:40 PDT
Size:
20.24 KB
patch
obsolete
>Index: Tools/ChangeLog >=================================================================== >--- Tools/ChangeLog (revision 234504) >+++ Tools/ChangeLog (working copy) >@@ -1,3 +1,32 @@ >+2018-08-02 Lucas Forschler <lforschler@apple.com> >+ >+ this is a test >+ https://bugs.webkit.org/show_bug.cgi?id=188268 >+ <rdar://problem/33732700> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Scripts/webkitpy/common/checkout/changelog.py: >+ (parse_radar_id_from_changelog): >+ (ChangeLogEntry): >+ * Scripts/webkitpy/common/checkout/changelog_unittest.py: >+ (test_parse_radar_id_from_changelog): >+ (test_parse_bug_id_from_changelog): Deleted. >+ * Scripts/webkitpy/common/net/bugzilla/bugzilla.py: >+ (Bugzilla.add_keyword_to_bug): >+ * Scripts/webkitpy/tool/commands/upload.py: >+ (Upload): >+ * Scripts/webkitpy/tool/steps/__init__.py: >+ * Scripts/webkitpy/tool/steps/addradar.py: Added. >+ (AddRadar): >+ (AddRadar._get_radar_link_from_diff): >+ (AddRadar.run): >+ * Scripts/webkitpy/tool/steps/addradar_unittest.py: Added. >+ (AddRadarTest): >+ (AddRadarTest.test_get_radar_link_from_diff_1): >+ * Scripts/webkitpy/tool/steps/createbug.py: >+ (CreateBug.run): >+ > 2018-08-02 Wenson Hsieh <wenson_hsieh@apple.com> > > [iOS] Keyboard becomes unresponsive after pressing delete while pressing down on a character key with accents >Index: Tools/Scripts/webkitpy/common/checkout/changelog.py >=================================================================== >--- Tools/Scripts/webkitpy/common/checkout/changelog.py (revision 234504) >+++ Tools/Scripts/webkitpy/common/checkout/changelog.py (working copy) >@@ -56,6 +56,20 @@ def parse_bug_id_from_changelog(message) > # first bug URL found anywhere in the message. > return config_urls.parse_bug_id(message) > >+def parse_radar_id_from_changelog(message): >+ if not message: >+ return None >+ matcher = re.compile(r'(<?rdar:\/\/problems?\/)?(?P<radar_id>-?\d{7,})>?') >+ match = matcher.search(message) >+ if not match: >+ return None >+ radar_id = int(match.group('radar_id')) >+ if radar_id < 0: >+ return None >+ >+ #link = '<rdar://problem/{}>'.format(id) >+ #_log.info("%s" % (link)) >+ return radar_id > > class ChangeLogEntry(object): > # e.g. 2009-06-03 Eric Seidel <eric@webkit.org> >@@ -66,6 +80,8 @@ class ChangeLogEntry(object): > # e.g. (ChangeLogEntry.touched_functions): Added. > touched_functions_regexp = r'^\s*\((?P<function>[^)]*)\):' > >+ radar_id_regexp = r'(<?rdar:\/\/problems?\/)?(?P<radar_id>-?\d{7,})>?' >+ > # e.g. Reviewed by Darin Adler. > # (Discard everything after the first period to match more invalid lines.) > reviewed_by_regexp = r'^\s*((\w+\s+)+and\s+)?(Review|Rubber(\s*|-)stamp)(s|ed)?\s+([a-z]+\s+)*?by\s+(?P<reviewer>.*?)[\.,]?\s*$' >@@ -110,7 +126,18 @@ class ChangeLogEntry(object): > self._committer_list = committer_list > self._revision = revision > self._parse_entry() >+ >+ @classmethod >+ def _parse_radar_id(cls, text): >+ match = re.search(ChangeLogEntry.radar_id_regexp, text, re.MULTILINE | re.IGNORECASE) >+ if not match: >+ return None >+ radar_id = int(match.group('radar_id')) >+ if radar_id < 0: >+ return None > >+ return radar_id >+ > @classmethod > def _parse_reviewer_text(cls, text): > match = re.search(ChangeLogEntry.reviewed_by_regexp, text, re.MULTILINE | re.IGNORECASE) >Index: Tools/Scripts/webkitpy/common/checkout/changelog_unittest.py >=================================================================== >--- Tools/Scripts/webkitpy/common/checkout/changelog_unittest.py (revision 234504) >+++ Tools/Scripts/webkitpy/common/checkout/changelog_unittest.py (working copy) >@@ -170,6 +170,59 @@ class ChangeLogTest(unittest.TestCase): > > == Rolled over to ChangeLog-2009-06-16 == > """ >+ >+ def test_parse_radar_id_from_changelog(self): >+ commit_text = ''' >+2011-03-23 Ojan Vafai <ojan@chromium.org> >+ >+ Add failing result for WebKit2. All tests that require >+ focus fail on WebKit2. See https://bugs.webkit.org/show_bug.cgi?id=56988. >+ <rdar://problem/1234567> >+ >+ * platform/mac-wk2/fast/css/pseudo-any-expected.txt: Added. >+ >+ ''' >+ >+ self.assertEqual(1234567, parse_radar_id_from_changelog(commit_text)) >+ >+ commit_text = ''' >+2011-03-23 Ojan Vafai <ojan@chromium.org> >+ >+ Add failing result for WebKit2. All tests that require >+ focus fail on WebKit2. See https://bugs.webkit.org/show_bug.cgi?id=56988. >+ rdar://problem/2345678 >+ >+ * platform/mac-wk2/fast/css/pseudo-any-expected.txt: Added. >+ >+ ''' >+ >+ self.assertEqual(2345678, parse_radar_id_from_changelog(commit_text)) >+ >+ commit_text = ''' >+2011-03-23 Ojan Vafai <ojan@chromium.org> >+ >+ Add failing result for WebKit2. All tests that require >+ focus fail on WebKit2. See https://bugs.webkit.org/show_bug.cgi?id=56988. >+ rdar://problem/3456789 and rdar://problem/4567890 >+ >+ * platform/mac-wk2/fast/css/pseudo-any-expected.txt: Added. >+ >+ ''' >+ >+ self.assertEqual(3456789, parse_radar_id_from_changelog(commit_text)) >+ >+ commit_text = ''' >+2011-03-23 Ojan Vafai <ojan@chromium.org> >+ >+ Add failing result for WebKit2. All tests that require >+ focus fail on WebKit2. See https://bugs.webkit.org/show_bug.cgi?id=56988. >+ >+ * platform/mac-wk2/fast/css/pseudo-any-expected.txt: Added. >+ >+ ''' >+ >+ self.assertEqual(None, parse_radar_id_from_changelog(commit_text)) >+ > > def test_parse_bug_id_from_changelog(self): > commit_text = ''' >@@ -407,6 +460,52 @@ class ChangeLogTest(unittest.TestCase): > def _contributors(self, names): > return [CommitterList().contributor_by_name(name) for name in names] > >+ def _assert_fuzzy_radar_match(self, radar_text, expected_radar_id): >+ parsed_radar_id = ChangeLogEntry._parse_radar_id(radar_text) >+ self.assertEqual(parsed_radar_id, expected_radar_id) >+ >+ def test_fuzzy_radar_match__none(self): >+ self._assert_fuzzy_radar_match('', None) >+ self._assert_fuzzy_radar_match('Nothing to see here', None) >+ self._assert_fuzzy_radar_match('There is no rdar link here', None) >+ self._assert_fuzzy_radar_match('There is no rdar:// link here', None) >+ self._assert_fuzzy_radar_match('There is no malformed rdar://abcd link here', None) >+ self._assert_fuzzy_radar_match('There is no malformed rdar://problem link here', None) >+ self._assert_fuzzy_radar_match('There is no malformed rdar://problem/abcdefgh link here', None) >+ >+ def test_fuzzy_radar_match_format_1(self): >+ self._assert_fuzzy_radar_match('<rdar://problem/1234567', 1234567) >+ self._assert_fuzzy_radar_match('<rdar://1234567', 1234567) >+ >+ def test_fuzzy_radar_match_format_2(self): >+ self._assert_fuzzy_radar_match('rdar://problem/2345678', 2345678) >+ self._assert_fuzzy_radar_match('rdar://3456789', 3456789) >+ >+ def test_fuzzy_radar_match_format_3(self): >+ changelog = """ >+ +2011-03-23 Ojan Vafai <ojan@chromium.org> >+ >+ + Add failing result for WebKit2. All tests that require >+ + focus fail on WebKit2. See https://bugs.webkit.org/show_bug.cgi?id=56988. >+ + <rdar://problem/42824228> >+ + >+ + * platform/mac-wk2/fast/css/pseudo-any-expected.txt: Added. >+ + >+ + '''""" >+ self._assert_fuzzy_radar_match(changelog, 42824228) >+ >+ changelog = """ >+ 2011-03-23 Ojan Vafai <ojan@chromium.org> >+ >+ Add failing result for WebKit2. All tests that require >+ focus fail on WebKit2. See https://bugs.webkit.org/show_bug.cgi?id=56988. >+ <rdar://problem/42824228> >+ >+ * platform/mac-wk2/fast/css/pseudo-any-expected.txt: Added. >+ >+ '''""" >+ self._assert_fuzzy_radar_match(changelog, 42824228) >+ > def _assert_fuzzy_reviewer_match(self, reviewer_text, expected_text_list, expected_contributors): > unused, reviewer_text_list = ChangeLogEntry._parse_reviewer_text(reviewer_text) > self.assertEqual(reviewer_text_list, expected_text_list) >Index: Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py >=================================================================== >--- Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py (revision 234504) >+++ Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py (working copy) >@@ -851,6 +851,15 @@ class Bugzilla(object): > self.browser["newcc"] = ", ".join(email_address_list) > self.browser.submit() > >+ def add_keyword_to_bug(self, bug_id, keyword): >+ self.authenticate() >+ >+ _log.info("Adding %s to the keyword list for bug %s" % (keyword, bug_id)) >+ self.open_url(self.bug_url_for_bug_id(bug_id)) >+ self.browser.select_form(name="changeform") >+ self.browser["keywords"] = keyword >+ self.browser.submit() >+ > def post_comment_to_bug(self, bug_id, comment_text, cc=None): > self.authenticate() > >Index: Tools/Scripts/webkitpy/tool/commands/upload.py >=================================================================== >--- Tools/Scripts/webkitpy/tool/commands/upload.py (revision 234504) >+++ Tools/Scripts/webkitpy/tool/commands/upload.py (working copy) >@@ -285,6 +285,7 @@ class Upload(AbstractPatchUploadingComma > steps.SuggestReviewers, > steps.EnsureBugIsOpenAndAssigned, > steps.PostDiff, >+ steps.AddRadar, > steps.SubmitToEWS, > steps.WPTChangeExport, > ] >Index: Tools/Scripts/webkitpy/tool/steps/__init__.py >=================================================================== >--- Tools/Scripts/webkitpy/tool/steps/__init__.py (revision 234504) >+++ Tools/Scripts/webkitpy/tool/steps/__init__.py (working copy) >@@ -29,6 +29,7 @@ > > # FIXME: Is this the right way to do this? > from webkitpy.tool.steps.addsvnmimetypeforpng import AddSvnMimetypeForPng >+from webkitpy.tool.steps.addradar import AddRadar > from webkitpy.tool.steps.applypatch import ApplyPatch > from webkitpy.tool.steps.applypatchwithlocalcommit import ApplyPatchWithLocalCommit > from webkitpy.tool.steps.applywatchlist import ApplyWatchList >Index: Tools/Scripts/webkitpy/tool/steps/addradar.py >=================================================================== >--- Tools/Scripts/webkitpy/tool/steps/addradar.py (nonexistent) >+++ Tools/Scripts/webkitpy/tool/steps/addradar.py (working copy) >@@ -0,0 +1,83 @@ >+# Copyright (C) 2018 Apple Inc. All rights reserved. >+# >+# Redistribution and use in source and binary forms, with or without >+# modification, are permitted provided that the following conditions >+# are met: >+# 1. Redistributions of source code must retain the above copyright >+# notice, this list of conditions and the following disclaimer. >+# 2. Redistributions in binary form must reproduce the above copyright >+# notice, this list of conditions and the following disclaimer in the >+# documentation and/or other materials provided with the distribution. >+# >+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY >+# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY >+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES >+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; >+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON >+# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS >+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ >+from webkitpy.tool.steps.abstractstep import AbstractStep >+from webkitpy.common.checkout.diff_parser import DiffParser >+#from webkitpy.tool.steps.validatechangelogs import ValidateChangeLogs >+from webkitpy.common.checkout.changelog import * >+ >+import logging >+import re >+ >+_log = logging.getLogger(__name__) >+ >+ >+class AddRadar(AbstractStep): >+ def _get_radar_link_from_diff(self, diff): >+ matcher = re.compile(r'(<?rdar:\/\/problems?\/)?(?P<radar_id>-?\d{7,})>?') >+ match = matcher.search(diff) >+ >+ if not match: >+ return None >+ >+ id = int(match.group('radar_id')) >+ if id < 0: >+ return None >+ >+ link = '<rdar://problem/{}>'.format(id) >+ _log.info("%s" % (link)) >+ >+ return link >+ >+ def run(self, state): >+ bug_id = state["bug_id"] >+ keyword = "InRadar" >+ wkbi_email = ["webkit-bug-importer@group.apple.com"] >+ radar_link = None >+ >+ # Only add Radar information if we are operating on a newly created bug >+ if state.get("created_new_bug") != True: >+ return >+ >+ for changelog_path in self.cached_lookup(state, "changelogs"): >+ changelog_entry = ChangeLog(changelog_path).latest_entry() >+ radar_id = ChangeLogEntry._parse_radar_id(changelog_entry) >+ if radar_id: >+ # TODO: use the common.url functionality >+ radar_link = "<rdar://problem/{}>".format(radar_link) >+ break >+ >+ # changed_files = self.cached_lookup(state, "changed_files") >+ # for filename in changed_files: >+ # if not self._tool.checkout().is_path_to_changelog(filename): >+ # continue >+ # diff = self._tool.scm().diff_for_file(filename) >+ # radar_link = self._get_radar_link_from_diff(diff) >+ # >+ # # Stop looking as soon as we get any radar link >+ # if radar_link: >+ # break >+ >+ if radar_link: >+ self._tool.bugs.add_keyword_to_bug(bug_id, keyword) >+ self._tool.bugs.post_comment_to_bug(bug_id, radar_link) >+ self._tool.bugs.add_cc_to_bug(bug_id, wkbi_email) >Index: Tools/Scripts/webkitpy/tool/steps/addradar_unittest.py >=================================================================== >--- Tools/Scripts/webkitpy/tool/steps/addradar_unittest.py (nonexistent) >+++ Tools/Scripts/webkitpy/tool/steps/addradar_unittest.py (working copy) >@@ -0,0 +1,110 @@ >+# Copyright (C) 2018 Apple Inc. All rights reserved. >+# >+# Redistribution and use in source and binary forms, with or without >+# modification, are permitted provided that the following conditions >+# are met: >+# 1. Redistributions of source code must retain the above copyright >+# notice, this list of conditions and the following disclaimer. >+# 2. Redistributions in binary form must reproduce the above copyright >+# notice, this list of conditions and the following disclaimer in the >+# documentation and/or other materials provided with the distribution. >+# >+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY >+# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY >+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES >+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; >+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON >+# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS >+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ >+import unittest >+ >+from webkitpy.common.system.outputcapture import OutputCapture >+from webkitpy.tool.mocktool import MockOptions, MockTool >+from webkitpy.tool.steps.addradar import AddRadar >+ >+ >+class AddRadarTest(unittest.TestCase): >+ def test_get_radar_link_from_diff_1(self): >+ capture = OutputCapture() >+ options = MockOptions() >+ step = AddRadar(MockTool(), options) >+ options.diff = """ >+ 2018-07-27 Simon Fraser <simon.fraser@apple.com> >+ >+ Be more conservative with compositing layer creation when memory is low >+ https://bugs.webkit.org/show_bug.cgi?id=187866 >+ rdar://problem/42366345 >+ >+ Reviewed by Zalan Bujtas. >+ >+ When process physical footprint is above a fraction of the jetsam limit, be more conservative in making >+ compositing layers. We avoid compositing for these situations: >+ 1. Layers with 3D transforms which are affine (like translateZ(0)). >+ 2. Layers with will-change >+ 3. Layers for canvases (other than WebGL/WebGPU) >+ >+ We reuse some macOS code in MemoryPressureHandler() but choose different thresholds for iOS, >+ falling into "conservative mode" at 50% of jetsam limit, and "strict mode" at 65%. >+ Compositing chooses to be more conservative in either "conservative" or "strict" memory modes. >+ >+ Plumb through a "compositingPolicyOverride" both so that on-device testing isn't >+ flakily falling into a different mode, and so that we can impose the conservative >+ mode for testing. >+ >+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: >+ (WTR::InjectedBundlePage::prepare): >+ """ >+ >+ expected_logs = "<rdar://problem/42366345>\n" >+ capture.assert_outputs(self, step._get_radar_link_from_diff, [options.diff], expected_logs=expected_logs) >+ >+ def test_get_radar_link_from_diff_2(self): >+ capture = OutputCapture() >+ options = MockOptions() >+ step = AddRadar(MockTool(), options) >+ options.diff = """ >+ 2018-07-30 Lucas Forschler <lforschler@apple.com> >+ >+ Add Radar info to bugzilla when found in ChangeLog >+ https://bugs.webkit.org/show_bug.cgi?id=188186 >+ <rdar://problem/1234567> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Scripts/webkit-patch: >+ * Scripts/webkitpy/common/net/bugzilla/bugzilla.py: >+ (Bugzilla.add_keyword_to_bug): >+ * Scripts/webkitpy/tool/commands/upload.py: >+ (Upload): >+ * Scripts/webkitpy/tool/steps/__init__.py: >+ * Scripts/webkitpy/tool/steps/addwkbi.py: Added. >+ (AddWKBI): >+ (AddWKBI.options): >+ (AddWKBI.GetRadarLinkFromDiff): >+ (AddWKBI.run): >+ """ >+ >+ expected_logs = "<rdar://problem/1234567>\n" >+ capture.assert_outputs(self, step._get_radar_link_from_diff, [options.diff], expected_logs=expected_logs) >+ >+ def test_get_radar_link_from_diff_3(self): >+ capture = OutputCapture() >+ options = MockOptions() >+ step = AddRadar(MockTool(), options) >+ options.diff = """ >+ 2018-07-30 Lucas Forschler <lforschler@apple.com> >+ >+ Add Radar info to bugzilla when found in ChangeLog >+ https://bugs.webkit.org/show_bug.cgi?id=188186 >+ (AddWKBI): >+ (AddWKBI.options): >+ (AddWKBI.GetRadarLinkFromDiff): >+ (AddWKBI.run): >+ """ >+ >+ expected_logs = None >+ capture.assert_outputs(self, step._get_radar_link_from_diff, [options.diff], expected_logs=expected_logs) >Index: Tools/Scripts/webkitpy/tool/steps/createbug.py >=================================================================== >--- Tools/Scripts/webkitpy/tool/steps/createbug.py (revision 234504) >+++ Tools/Scripts/webkitpy/tool/steps/createbug.py (working copy) >@@ -52,6 +52,7 @@ class CreateBug(AbstractStep): > blocked_bugs = state.get("bug_id_list", []) > blocks = ", ".join(str(bug) for bug in blocked_bugs if bug) > state["bug_id"] = self._tool.bugs.create_bug(state["bug_title"], state["bug_description"], blocked=blocks, component=self._options.component, cc=cc) >+ state["created_new_bug"] = True > for blocked_bug in blocked_bugs: > if blocked_bug: > status = self._tool.bugs.fetch_bug(blocked_bug).status()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
dbates
:
review-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188268
: 346403