Bug 187107 - webkit-patch should ignore non-ASCII characters in the status server API key
Summary: webkit-patch should ignore non-ASCII characters in the status server API key
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Daniel Bates
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-06-27 11:02 PDT by Daniel Bates
Modified: 2018-06-27 14:11 PDT (History)
6 users (show)

See Also:


Attachments
Patch (2.53 KB, patch)
2018-06-27 11:27 PDT, Daniel Bates
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 2018-06-27 11:02:55 PDT
webkit-patch should ignore non-ASCII characters in the status server API key.
Comment 1 Daniel Bates 2018-06-27 11:08:10 PDT
Currently specifying non-ASCII characters in the API key will cause a UnicodeEncodeError exception when webkit-patch tries to post a status update. You can reproduce this by running an EWS:

1. In the top-level WebKit checkout, run `git config webkit.status-api-key ‘test’`.
2. Run, `Tools/Scripts/webkit-patch mac-wk2-ews`.

Then we you will eventually see a backtrace of the form:

[[
Traceback (most recent call last):
  File "./Tools/Scripts/webkit-patch", line 84, in <module>
    main()
  File "./Tools/Scripts/webkit-patch", line 79, in main 
    WebKitPatch(os.path.abspath(__file__)).main()
  File "/Volumes/.../Tools/Scripts/webkitpy/tool/multicommandtool.py", line 305, in main 
    result = command.check_arguments_and_execute(options, args, self)
  File "/Volumes/.../Tools/Scripts/webkitpy/tool/multicommandtool.py", line 123, in check_arguments_and_execute
    return self.execute(options, args, tool) or 0 
  File "/Volumes/.../Tools/Scripts/webkitpy/tool/commands/queues.py", line 154, in execute
    return engine(self.name, self, self._tool.wakeup_event, self._options.seconds_to_sleep).run()
  File "/Volumes/.../Tools/Scripts/webkitpy/tool/bot/queueengine.py", line 93, in run
    self._delegate.begin_work_queue()
  File "/Volumes/.../Tools/Scripts/webkitpy/tool/commands/earlywarningsystem.py", line 61, in begin_work_queue
    AbstractReviewQueue.begin_work_queue(self)
  File "/Volumes/.../Tools/Scripts/webkitpy/tool/commands/queues.py", line 460, in begin_work_queue
    PatchProcessingQueue.begin_work_queue(self)
  File "/Volumes/.../Tools/Scripts/webkitpy/tool/commands/queues.py", line 294, in begin_work_queue
    AbstractPatchQueue.begin_work_queue(self)
  File "/Volumes/.../Tools/Scripts/webkitpy/tool/commands/queues.py", line 131, in begin_work_queue
    self._tool.status_server.update_status(self.name, "Starting Queue")
  File "/Volumes/.../Tools/Scripts/webkitpy/common/net/statusserver.py", line 198, in update_status
    return NetworkTransaction().run(lambda: self._post_status_to_server(queue_name, status, patch, results_file))
  File "/Volumes/.../Tools/Scripts/webkitpy/common/net/networktransaction.py", line 53, in run
    return request()
  File "/Volumes/.../Tools/Scripts/webkitpy/common/net/statusserver.py", line 198, in <lambda>
    return NetworkTransaction().run(lambda: self._post_status_to_server(queue_name, status, patch, results_file))
  File "/Volumes/.../Tools/Scripts/webkitpy/common/net/statusserver.py", line 107, in _post_status_to_server
    self._browser.open(update_status_url)
  File "/Volumes/.../Tools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_mechanize.py", line 203, in open 
    return self._mech_open(url, data, timeout=timeout)
  File "/Volumes/.../Tools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_mechanize.py", line 230, in _mech_open
    response = UserAgentBase.open(self, request, data)
  File "/Volumes/.../Tools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_opener.py", line 193, in open 
    response = urlopen(self, req, data)
  File "/Volumes/.../Tools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_urllib2_fork.py", line 344, in _open
    '_open', req) 
  File "/Volumes/.../Tools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_urllib2_fork.py", line 332, in _call_chain
    result = func(*args)
  File "/Volumes/.../Tools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_urllib2_fork.py", line 1170, in https_open
    return self.do_open(conn_factory, req) 
  File "/Volumes/.../Tools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_urllib2_fork.py", line 1115, in do_open
    h.request(req.get_method(), req.get_selector(), req.data, headers)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1053, in request
    self._send_request(method, url, body, headers)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1092, in _send_request
    self.putheader(hdr, value)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1028, in putheader
    values = [str(v) for v in values]
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2018' in position 7: ordinal not in range(128)
]]
Comment 2 Daniel Bates 2018-06-27 11:27:43 PDT
Created attachment 343731 [details]
Patch
Comment 3 Daniel Bates 2018-06-27 14:10:28 PDT
Comment on attachment 343731 [details]
Patch

Clearing flags on attachment: 343731

Committed r233276: <https://trac.webkit.org/changeset/233276>
Comment 4 Daniel Bates 2018-06-27 14:10:30 PDT
All reviewed patches have been landed.  Closing bug.
Comment 5 Radar WebKit Bug Importer 2018-06-27 14:11:31 PDT
<rdar://problem/41542531>