Bug 196802

Summary: [ews-build] Handle bug titles with unicode characters
Product: WebKit Reporter: Aakash Jain <aakash_jain>
Component: Tools / TestsAssignee: Aakash Jain <aakash_jain>
Severity: Normal CC: aakash_jain, ap, commit-queue, dewei_zhu, lforschler, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=196797
Description Flags
Patch none

Description Aakash Jain 2019-04-10 19:14:44 PDT
We should handle bug titles with unicode characters. Currently build fails with an exception for bugs with unicode characters in title.

e.g.: https://ews-build.webkit.org/#/builders/19/builds/460

exceptions.UnicodeEncodeError: 'ascii' codec can't encode characters in position 22-24: ordinal not in range(128)
/usr/lib64/python2.7/site-packages/twisted/internet/defer.py:1185 in _inlineCallbacks
1184            else:
1185                result = g.send(result)
1186        except StopIteration as e:
/usr/lib/python2.7/site-packages/buildbot/process/buildstep.py:705 in run
705            results = yield self.start()
706            if results is not None:
steps.py:351 in start
351        bug_closed = self._is_bug_closed(bug_id)
352        if bug_closed == 1:
steps.py:331 in _is_bug_closed
330        bug_title = bug_json.get('summary')
331        self.addURL('Bug {} {}'.format(bug_id, bug_title), '{}show_bug.cgi?id={}'.format(BUG_SERVER_URL, bug_id))
332        if bug_json.get('status') in self.bug_closed_statuses:
exceptions.UnicodeEncodeError: 'ascii' codec can't encode characters in position 22-24: ordinal not in range(128)

Corresponding bug:
https://bugs.webkit.org/show_bug.cgi?id=196797  REGRESSION (r241734): ⌥⌘↑ and ⌥⌘↓ no longer navigate to previous/next Reading List article
Comment 1 Aakash Jain 2019-04-10 19:14:55 PDT
Comment 2 Aakash Jain 2019-04-10 19:18:40 PDT Comment hidden (obsolete)
Comment 3 Aakash Jain 2019-04-10 19:23:49 PDT
Created attachment 367190 [details]
Comment 4 Alexey Proskuryakov 2019-04-10 20:13:28 PDT
Comment on attachment 367190 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=367190&action=review

> Tools/BuildSlaveSupport/ews-build/steps.py:331
> +        bug_title = bug_title.encode('ascii', 'ignore')  # FIXME: do not remove non-ascii characters from bug title being displayed.

Would encoding as utf-8 make it work?
Comment 5 Aakash Jain 2019-04-11 04:44:01 PDT
> Would encoding as utf-8 make it work?
If using utf-8, it fails later on inside addURL().
Filed Buildbot bug: https://github.com/buildbot/buildbot/issues/4717
Comment 6 Aakash Jain 2019-04-11 17:28:04 PDT
Created attachment 367268 [details]
Comment 7 Aakash Jain 2019-04-11 17:29:00 PDT
(In reply to Aakash Jain from comment #6)
> Created attachment 367268 [details]
> Patch

Sample run: https://ews-build.webkit-uat.org/#/builders/8/builds/270
Comment 8 WebKit Commit Bot 2019-04-11 18:52:50 PDT
Comment on attachment 367268 [details]

Clearing flags on attachment: 367268

Committed r244207: <https://trac.webkit.org/changeset/244207>
Comment 9 WebKit Commit Bot 2019-04-11 18:52:52 PDT
All reviewed patches have been landed.  Closing bug.