Bug 180303 - Add docstring in EarlyWarningSystemTask to explain return values
Summary: Add docstring in EarlyWarningSystemTask to explain return values
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: 2017-12-01 18:20 PST by Aakash Jain
Modified: 2017-12-04 16:06 PST (History)
9 users (show)

See Also:


Attachments
Proposed patch (1.34 KB, patch)
2017-12-01 18:23 PST, Aakash Jain
dbates: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aakash Jain 2017-12-01 18:20:48 PST
EarlyWarningSystemTask run() method has return value which are slightly non-intuitive. False does not indicate that patch failed EWS, it indicates that EWS is not sure. Patch failure is indicated by an exception. We should document these values in order to avoid confusion.

Having this comment could have prevented https://bugs.webkit.org/show_bug.cgi?id=180302
Comment 1 Aakash Jain 2017-12-01 18:23:59 PST
Created attachment 328202 [details]
Proposed patch
Comment 2 Daniel Bates 2017-12-01 21:52:46 PST
Comment on attachment 328202 [details]
Proposed patch

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

> Tools/Scripts/webkitpy/tool/bot/earlywarningsystemtask.py:61
> +        """

Could named constants help make this clearer And let us simplify this comment to just explain that an exception indicates patch failure (e.g. RETRY = False, PASS => True)?

If you have your heart set on this comment then “would be”  => “will be”. Also does the formatting of this docstring match the formatting of other docstrings that explain return values and/or exceptions?
Comment 3 Aakash Jain 2017-12-04 16:05:05 PST
Committed r225500: <https://trac.webkit.org/changeset/225500>
Comment 4 Radar WebKit Bug Importer 2017-12-04 16:06:40 PST
<rdar://problem/35842175>