WebKit Bugzilla
Attachment 368985 Details for
Bug 197519
: webkit-patch --no-review upload does not submit patch to New EWS
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-197519-20190503140516.patch (text/plain), 17.44 KB, created by
Aakash Jain
on 2019-05-03 14:05:17 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Aakash Jain
Created:
2019-05-03 14:05:17 PDT
Size:
17.44 KB
patch
obsolete
>Index: Tools/ChangeLog >=================================================================== >--- Tools/ChangeLog (revision 244894) >+++ Tools/ChangeLog (working copy) >@@ -1,3 +1,29 @@ >+2019-05-02 Aakash Jain <aakash_jain@apple.com> >+ >+ webkit-patch --no-review upload does not submit patch to New EWS >+ https://bugs.webkit.org/show_bug.cgi?id=197519 >+ <rdar://problem/50424887> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Scripts/webkitpy/tool/steps/submittoews.py: >+ (SubmitToEWS.run): Submit to both old and new EWS. >+ * Scripts/webkitpy/common/config/urls.py: Added url for new EWS server. >+ * Scripts/webkitpy/common/net/ewsserver.py: Added. >+ (EWSServer._server_url): Method to return server url. >+ (EWSServer._post_patch_to_ews): Method to post patch to ews. >+ (EWSServer.submit_to_ews): Method to submit the patch to ews using NetworkTransaction. >+ * Scripts/webkitpy/common/net/ewsserver_mock.py: Added Mock EWS Server. >+ * Scripts/webkitpy/common/net/ewsserver_unittest.py: Added unit-test for EWS Server. >+ * Scripts/webkitpy/common/net/statusserver_mock.py: >+ (MockStatusServer.submit_to_ews): Updated the log text. >+ * Scripts/webkitpy/tool/commands/queues_unittest.py: Updated unit-tests. >+ * Scripts/webkitpy/tool/commands/upload_unittest.py: Ditto. >+ * Scripts/webkitpy/tool/main.py: >+ (WebKitPatch.__init__): Initialize ews_server. >+ * Scripts/webkitpy/tool/mocktool.py: >+ (MockTool.__init__): Ditto. >+ > 2019-05-02 John Wilander <wilander@apple.com> > > Make both filterForRegistrableDomains() in WebKit::NetworkProcess use WebCore::RegistrableDomain::uncheckedCreateFromHost() >Index: Tools/Scripts/webkitpy/common/config/urls.py >=================================================================== >--- Tools/Scripts/webkitpy/common/config/urls.py (revision 244918) >+++ Tools/Scripts/webkitpy/common/config/urls.py (working copy) >@@ -1,4 +1,5 @@ > # Copyright (c) 2010, Google Inc. All rights reserved. >+# Copyright (c) 2019 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 >@@ -55,6 +56,7 @@ svn_server_host = "svn.webkit.org" > svn_server_realm = "<http://svn.webkit.org:80> Mac OS Forge" > > statusserver_default_host = "webkit-queues.webkit.org" >+ewsserver_default_host = "ews.webkit.org" > > > def parse_bug_id(string): >Index: Tools/Scripts/webkitpy/common/net/ewsserver.py >=================================================================== >--- Tools/Scripts/webkitpy/common/net/ewsserver.py (nonexistent) >+++ Tools/Scripts/webkitpy/common/net/ewsserver.py (working copy) >@@ -0,0 +1,51 @@ >+# Copyright (C) 2019 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.common.config.urls import ewsserver_default_host >+from webkitpy.common.net.networktransaction import NetworkTransaction >+ >+import logging >+ >+_log = logging.getLogger(__name__) >+ >+ >+class EWSServer: >+ def __init__(self, host=ewsserver_default_host, use_https=True, browser=None): >+ self.host = host >+ self.use_https = bool(use_https) >+ from webkitpy.thirdparty.autoinstalled.mechanize import Browser >+ self._browser = browser or Browser() >+ self._browser.set_handle_robots(False) >+ >+ def _server_url(self): >+ return '{}://{}'.format(('https' if self.use_https else 'http'), self.host) >+ >+ def _post_patch_to_ews(self, attachment_id): >+ submit_to_ews_url = '{}/submit-to-ews'.format(self._server_url()) >+ self._browser.open(submit_to_ews_url) >+ self._browser.select_form(name='submit_to_ews') >+ self._browser['patch_id'] = unicode(attachment_id) >+ self._browser.submit() >+ >+ def submit_to_ews(self, attachment_id): >+ _log.info('Submitting attachment {} to EWS queues'.format(attachment_id)) >+ return NetworkTransaction().run(lambda: self._post_patch_to_ews(attachment_id)) >Index: Tools/Scripts/webkitpy/common/net/ewsserver_mock.py >=================================================================== >--- Tools/Scripts/webkitpy/common/net/ewsserver_mock.py (nonexistent) >+++ Tools/Scripts/webkitpy/common/net/ewsserver_mock.py (working copy) >@@ -0,0 +1,34 @@ >+# Copyright (C) 2019 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 logging >+ >+_log = logging.getLogger(__name__) >+ >+ >+class MockEWSServer(object): >+ >+ def __init__(self): >+ self.host = 'example.com' >+ >+ def submit_to_ews(self, patch_id): >+ _log.info('MOCK: submit_to_ews: {}'.format(patch_id)) >Index: Tools/Scripts/webkitpy/common/net/ewsserver_unittest.py >=================================================================== >--- Tools/Scripts/webkitpy/common/net/ewsserver_unittest.py (nonexistent) >+++ Tools/Scripts/webkitpy/common/net/ewsserver_unittest.py (working copy) >@@ -0,0 +1,36 @@ >+# Copyright (C) 2019 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.net.ewsserver import EWSServer >+from webkitpy.common.system.outputcapture import OutputCaptureTestCaseBase >+from webkitpy.common.net.web_mock import MockBrowser >+ >+ >+class EWSServerTest(OutputCaptureTestCaseBase): >+ def test_submit_to_ews(self): >+ mock_browser = MockBrowser() >+ ews_server = EWSServer(browser=mock_browser) >+ self.assertTrue(ews_server.use_https) >+ ews_server.submit_to_ews(10008) >+ self.assertEqual(mock_browser['patch_id'], u'10008') >Index: Tools/Scripts/webkitpy/common/net/statusserver.py >=================================================================== >--- Tools/Scripts/webkitpy/common/net/statusserver.py (revision 244918) >+++ Tools/Scripts/webkitpy/common/net/statusserver.py (working copy) >@@ -1,5 +1,5 @@ > # Copyright (C) 2009 Google Inc. All rights reserved. >-# Copyright (C) 2018 Apple Inc. All rights reserved. >+# Copyright (C) 2018, 2019 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 >@@ -157,7 +157,7 @@ class StatusServer: > self._browser.submit() > > def submit_to_ews(self, attachment_id): >- _log.info("Submitting attachment %s to EWS queues" % attachment_id) >+ _log.info("Submitting attachment %s to old EWS queues" % attachment_id) > return NetworkTransaction().run(lambda: self._post_work_item_to_ews(attachment_id)) > > def next_work_item(self, queue_name): >Index: Tools/Scripts/webkitpy/common/net/statusserver_mock.py >=================================================================== >--- Tools/Scripts/webkitpy/common/net/statusserver_mock.py (revision 244918) >+++ Tools/Scripts/webkitpy/common/net/statusserver_mock.py (working copy) >@@ -1,4 +1,5 @@ > # Copyright (C) 2011 Google Inc. All rights reserved. >+# Copyright (C) 2019 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 >@@ -66,7 +67,7 @@ class MockStatusServer(object): > _log.info('MOCK: upload_attachment: {}'.format(attachment.id())) > > def submit_to_ews(self, patch_id): >- _log.info("MOCK: submit_to_ews: %s" % (patch_id)) >+ _log.info("MOCK: submit_to_old_ews: %s" % (patch_id)) > > def update_status(self, queue_name, status, patch=None, results_file=None): > _log.info("MOCK: update_status: %s %s" % (queue_name, status)) >Index: Tools/Scripts/webkitpy/common/net/web_mock.py >=================================================================== >--- Tools/Scripts/webkitpy/common/net/web_mock.py (revision 244918) >+++ Tools/Scripts/webkitpy/common/net/web_mock.py (working copy) >@@ -1,4 +1,5 @@ > # Copyright (C) 2011 Google Inc. All rights reserved. >+# Copyright (C) 2019 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 >@@ -78,6 +79,9 @@ class MockBrowser(object): > def __setitem__(self, key, value): > self.params[key] = value > >+ def __getitem__(self, key): >+ return self.params.get(key) >+ > def submit(self): > return StringIO.StringIO() > >Index: Tools/Scripts/webkitpy/tool/main.py >=================================================================== >--- Tools/Scripts/webkitpy/tool/main.py (revision 244918) >+++ Tools/Scripts/webkitpy/tool/main.py (working copy) >@@ -1,5 +1,5 @@ > # Copyright (c) 2010 Google Inc. All rights reserved. >-# Copyright (c) 2009, 2013 Apple Inc. All rights reserved. >+# Copyright (c) 2009, 2013, 2019 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 >@@ -38,6 +38,7 @@ from webkitpy.common.checkout.scm import > from webkitpy.common.config.ports import DeprecatedPort > from webkitpy.common.host import Host > from webkitpy.common.net.irc import ircproxy >+from webkitpy.common.net.ewsserver import EWSServer > from webkitpy.common.net.statusserver import StatusServer > from webkitpy.tool.multicommandtool import MultiCommandTool > from webkitpy.tool import commands >@@ -61,6 +62,7 @@ class WebKitPatch(MultiCommandTool, Host > Host.__init__(self) > self._path = path > self.status_server = StatusServer() >+ self.ews_server = EWSServer() > > self.wakeup_event = threading.Event() > self._irc = None >Index: Tools/Scripts/webkitpy/tool/mocktool.py >=================================================================== >--- Tools/Scripts/webkitpy/tool/mocktool.py (revision 244918) >+++ Tools/Scripts/webkitpy/tool/mocktool.py (working copy) >@@ -1,4 +1,5 @@ > # Copyright (C) 2011 Google Inc. All rights reserved. >+# Copyright (C) 2019 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 >@@ -30,6 +31,7 @@ import threading > > from webkitpy.common.host_mock import MockHost > from webkitpy.common.net.buildbot.buildbot_mock import MockBuildBot >+from webkitpy.common.net.ewsserver_mock import MockEWSServer > from webkitpy.common.net.statusserver_mock import MockStatusServer > from webkitpy.common.net.irc.irc_mock import MockIRC > >@@ -66,6 +68,7 @@ class MockTool(MockHost): > > self._deprecated_port = MockPort() > self.status_server = MockStatusServer() >+ self.ews_server = MockEWSServer() > > self._irc = None > self.irc_password = "MOCK irc password" >Index: Tools/Scripts/webkitpy/tool/commands/queues_unittest.py >=================================================================== >--- Tools/Scripts/webkitpy/tool/commands/queues_unittest.py (revision 244918) >+++ Tools/Scripts/webkitpy/tool/commands/queues_unittest.py (working copy) >@@ -1,4 +1,5 @@ > # Copyright (C) 2009 Google Inc. All rights reserved. >+# Copyright (C) 2019 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 >@@ -145,8 +146,8 @@ Feeding commit-queue high priority items > MOCK: update_work_items: commit-queue [10005, 10000] > Feeding EWS (2 r? patches, 2 new) > MOCK: upload_attachment: 10008 >-MOCK: submit_to_ews: 10008 >-MOCK: submit_to_ews: 10002 >+MOCK: submit_to_old_ews: 10008 >+MOCK: submit_to_old_ews: 10002 > """, > "handle_unexpected_error": "Mock error message\n", > } >Index: Tools/Scripts/webkitpy/tool/commands/upload_unittest.py >=================================================================== >--- Tools/Scripts/webkitpy/tool/commands/upload_unittest.py (revision 244918) >+++ Tools/Scripts/webkitpy/tool/commands/upload_unittest.py (working copy) >@@ -1,5 +1,5 @@ > # Copyright (C) 2009 Google Inc. All rights reserved. >-# Copyright (C) 2018 Apple Inc. All rights reserved. >+# Copyright (C) 2018, 2019 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 >@@ -181,6 +181,7 @@ Obsoleting 2 old patches on bug 50000 > MOCK reassign_bug: bug_id=50000, assignee=None > MOCK add_patch_to_bug: bug_id=50000, description=MOCK description, mark_for_review=False, mark_for_commit_queue=False, mark_for_landing=False > MOCK: user.open_url: http://example.com/50000 >+MOCK: submit_to_old_ews: 10001 > MOCK: submit_to_ews: 10001 > """ > self.assert_execute_outputs(Upload(), [50000], options=options, expected_logs=expected_logs) >@@ -204,6 +205,7 @@ Obsoleting 1 old patch on bug 50007 > MOCK add_patch_to_bug: bug_id=50007, description=MOCK description, mark_for_review=False, mark_for_commit_queue=False, mark_for_landing=False > MOCK: user.open_url: http://example.com/50007 > MOCK: upload_attachment: 10008 >+MOCK: submit_to_old_ews: 10008 > MOCK: submit_to_ews: 10008 > """ > self.assert_execute_outputs(Upload(), [50007], options=options, expected_logs=expected_logs) >Index: Tools/Scripts/webkitpy/tool/steps/submittoews.py >=================================================================== >--- Tools/Scripts/webkitpy/tool/steps/submittoews.py (revision 244918) >+++ Tools/Scripts/webkitpy/tool/steps/submittoews.py (working copy) >@@ -1,4 +1,4 @@ >-# Copyright (C) 2017 Apple Inc. All rights reserved. >+# Copyright (C) 2017, 2019 Apple Inc. All rights reserved. > # > # Redistribution and use in source and binary forms, with or without > # modification, are permitted provided that the following conditions >@@ -41,3 +41,4 @@ class SubmitToEWS(AbstractStep): > if attachment.bug().is_security_sensitive(): > self._tool.status_server.upload_attachment(attachment) > self._tool.status_server.submit_to_ews(attachment_id) >+ self._tool.ews_server.submit_to_ews(attachment_id)
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 197519
:
368790
|
368844
|
368860
| 368985