WebKit Bugzilla
Attachment 346291 Details for
Bug 188235
: If there's a radar in the changelog, webkit-patch upload/create-bug should put the radar in the bug and set InRadar
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188235-20180801131000.patch (text/plain), 13.34 KB, created by
Lucas Forschler
on 2018-08-01 13:10:02 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Lucas Forschler
Created:
2018-08-01 13:10:02 PDT
Size:
13.34 KB
patch
obsolete
>Index: Tools/ChangeLog >=================================================================== >--- Tools/ChangeLog (revision 234466) >+++ Tools/ChangeLog (working copy) >@@ -1,3 +1,28 @@ >+2018-08-01 Lucas Forschler <lforschler@apple.com> >+ >+ If there's a radar in the changelog, webkit-patch upload/create-bug should put the radar in the bug and set InRadar >+ https://bugs.webkit.org/show_bug.cgi?id=188235 >+ <rdar://problem/33732700> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Scripts/webkitpy/common/net/bugzilla/bugzilla.py: >+ (Bugzilla.add_keyword_to_bug): Teach the bugzilla tools how to add a keyword to the bugzilla entry. >+ * Scripts/webkitpy/tool/commands/upload.py: >+ (Upload): Add a new step to the 'Upload' workflow to add the radar information >+ * Scripts/webkitpy/tool/steps/__init__.py: >+ * Scripts/webkitpy/tool/steps/addradar.py: Added. >+ (AddRadar): Create a new class for adding Radar information to bugzilla >+ (AddRadar._get_radar_link_from_diff): regex parse our a radar url from a diff >+ (AddRadar.run): entry point for doing the work to extract radar url, add keyword/comments/cc wkbi >+ * Scripts/webkitpy/tool/steps/addradar_unittest.py: Added. >+ (AddRadarTest):unit tests for get_radar_link functionality >+ (AddRadarTest.test_get_radar_link_from_diff_1): test 'rdar://problem/42366345' format >+ (AddRadarTest.test_get_radar_link_from_diff_2): test '<rdar://problem/1234567>' format >+ (AddRadarTest.test_get_radar_link_from_diff_3): test missing radar format >+ * Scripts/webkitpy/tool/steps/createbug.py: set the "created_new_bug" state when a new bugzilla entry is created >+ (CreateBug.run): >+ > 2018-08-01 Commit Queue <commit-queue@webkit.org> > > Unreviewed, rolling out r234443 and r234445. >Index: Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py >=================================================================== >--- Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py (revision 234466) >+++ 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 234466) >+++ 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 234466) >+++ 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,74 @@ >+# Copyright (C) 2005, 2006, 2007, 2008, 2009, 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 >+ >+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 >+ >+ 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) 2005, 2006, 2007, 2008, 2009, 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 234466) >+++ 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
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188235
:
346291
|
346420
|
346422
|
346711