Bug 196802 - [ews-build] Handle bug titles with unicode characters
Summary: [ews-build] Handle bug titles with unicode characters
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Aakash Jain
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-04-10 19:14 PDT by Aakash Jain
Modified: 2019-04-11 18:52 PDT (History)
7 users (show)

See Also:


Attachments
Patch (1.39 KB, patch)
2019-04-10 19:18 PDT, Aakash Jain
no flags Details | Formatted Diff | Diff
Patch (1.39 KB, patch)
2019-04-10 19:23 PDT, Aakash Jain
no flags Details | Formatted Diff | Diff
Patch (1.32 KB, patch)
2019-04-11 17:28 PDT, Aakash Jain
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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
704 
705            results = yield self.start()
706            if results is not None:
steps.py:351 in start
350 
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
<rdar://problem/49797747>
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]
Patch
Comment 4 Alexey Proskuryakov 2019-04-10 20:13:28 PDT
Comment on attachment 367190 [details]
Patch

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]
Patch
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]
Patch

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.