Bug 202473 - Python 3: Add support in webkitpy.common.watchlist
Summary: Python 3: Add support in webkitpy.common.watchlist
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jonathan Bedard
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-10-02 09:12 PDT by Jonathan Bedard
Modified: 2019-10-18 16:56 PDT (History)
9 users (show)

See Also:


Attachments
Patch (52.06 KB, patch)
2019-10-03 11:31 PDT, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch (12.83 KB, patch)
2019-10-17 15:48 PDT, Jonathan Bedard
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Bedard 2019-10-02 09:12:09 PDT
Add webkitpy.common.watchlist to test-webkitpy-python3
Comment 1 Jonathan Bedard 2019-10-03 11:31:28 PDT
Created attachment 380145 [details]
Patch
Comment 2 Stephanie Lewis 2019-10-16 15:34:58 PDT
why are we removing raw strings?  They don't appear to be different in python3 from a brief look.
Comment 3 Jonathan Bedard 2019-10-16 15:53:27 PDT
(In reply to Stephanie Lewis from comment #2)
> why are we removing raw strings?  They don't appear to be different in
> python3 from a brief look.

Because Python 2 and Python 3 have different rules for \ in r strings.
Comment 4 Jonathan Bedard 2019-10-16 15:54:08 PDT
(In reply to Jonathan Bedard from comment #3)
> (In reply to Stephanie Lewis from comment #2)
> > why are we removing raw strings?  They don't appear to be different in
> > python3 from a brief look.
> 
> Because Python 2 and Python 3 have different rules for \ in r strings.

Totally open to other ideas, but this was the easiest way to get things working in a compatible way.
Comment 5 dewei_zhu 2019-10-17 13:56:03 PDT
Comment on attachment 380145 [details]
Patch

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

> Tools/Scripts/webkitpy/common/watchlist/watchlist_unittest.py:46
> +            '            "filename": ".*\\\\\\\\MyFileName\\\\.cpp",'

Why do we need so may back slashes for first '\\'
Comment 6 Jonathan Bedard 2019-10-17 15:48:34 PDT
Created attachment 381241 [details]
Patch
Comment 7 dewei_zhu 2019-10-18 14:33:39 PDT
Comment on attachment 381241 [details]
Patch

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

> Tools/Scripts/webkitpy/common/watchlist/watchlist_unittest.py:46
> +            '            "filename": r".*MyFileName\\.cpp",'

Can we still use raw string in Python3? Also regex before and after your change are not identical, we usually don't change test case itself when converting to be python3 compatible, do we?
Comment 8 Jonathan Bedard 2019-10-18 14:45:12 PDT
Comment on attachment 381241 [details]
Patch

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

>> Tools/Scripts/webkitpy/common/watchlist/watchlist_unittest.py:46
>> +            '            "filename": r".*MyFileName\\.cpp",'
> 
> Can we still use raw string in Python3? Also regex before and after your change are not identical, we usually don't change test case itself when converting to be python3 compatible, do we?

We can.

The are not identical, not sure why we had \M before, that's a special regex value (Like \s) in Python2, not exactly sure what it does, but we definitely shouldn't  have been using it.
Comment 9 dewei_zhu 2019-10-18 14:52:07 PDT
r=me after discussing with Jonathan in person. It's probably OK to allow `ThisIsMyFileName.cpp` to match (which does not previously) as those are test cases.
Comment 10 WebKit Commit Bot 2019-10-18 16:54:37 PDT
The commit-queue encountered the following flaky tests while processing attachment 381241 [details]:

inspector/console/webcore-logging.html bug 203118 (authors: drousso@apple.com and eric.carlson@apple.com)
The commit-queue is continuing to process your patch.
Comment 11 WebKit Commit Bot 2019-10-18 16:55:26 PDT
Comment on attachment 381241 [details]
Patch

Clearing flags on attachment: 381241

Committed r251312: <https://trac.webkit.org/changeset/251312>
Comment 12 WebKit Commit Bot 2019-10-18 16:55:28 PDT
All reviewed patches have been landed.  Closing bug.
Comment 13 Radar WebKit Bug Importer 2019-10-18 16:56:17 PDT
<rdar://problem/56424838>