Bug 226894 - [resultsdbpy] Add results-summary API
Summary: [resultsdbpy] Add results-summary API
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: Chris Gambrell
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-06-10 12:52 PDT by Chris Gambrell
Modified: 2021-08-10 15:41 PDT (History)
6 users (show)

See Also:


Attachments
Patch (23.41 KB, patch)
2021-06-10 12:58 PDT, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (10.20 KB, patch)
2021-06-10 14:01 PDT, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (10.30 KB, patch)
2021-06-10 14:18 PDT, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (10.25 KB, patch)
2021-06-10 14:27 PDT, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (12.94 KB, patch)
2021-06-11 12:39 PDT, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (18.67 KB, patch)
2021-08-09 16:15 PDT, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch (22.03 KB, patch)
2021-08-10 10:05 PDT, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch (21.95 KB, patch)
2021-08-10 10:39 PDT, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch (22.71 KB, patch)
2021-08-10 14:19 PDT, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch (22.71 KB, patch)
2021-08-10 14:26 PDT, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch (22.70 KB, patch)
2021-08-10 14:51 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 Chris Gambrell 2021-06-10 12:52:35 PDT
Adding functionality to predict the pass, fail, crash, etc percentages of a given test to the endpoint /api/confidence
Comment 1 Radar WebKit Bug Importer 2021-06-10 12:53:30 PDT
<rdar://problem/79155181>
Comment 2 Chris Gambrell 2021-06-10 12:58:38 PDT
Created attachment 431113 [details]
Patch
Comment 3 Chris Gambrell 2021-06-10 14:01:07 PDT
Created attachment 431125 [details]
Patch
Comment 4 Jonathan Bedard 2021-06-10 14:08:56 PDT
Comment on attachment 431125 [details]
Patch

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

> Tools/Scripts/libraries/resultsdbpy/resultsdbpy/controller/test_controller.py:182
> +            newer_data = []

Want to call out a problem here Chris and I discovered. Under the current code, this is always going to return the most recent `limit` of test results which occurred after the specified commit. The problem with this, is that it will still return the most recent test results even if the specified commit is ancient. I need to double check if there is a way for us to resolve in our Cassandra query, because I'm not sure there is.
Comment 5 Chris Gambrell 2021-06-10 14:18:01 PDT
Created attachment 431129 [details]
Patch
Comment 6 Chris Gambrell 2021-06-10 14:27:27 PDT
Created attachment 431130 [details]
Patch
Comment 7 Chris Gambrell 2021-06-11 12:39:18 PDT
Created attachment 431221 [details]
Patch
Comment 8 Jonathan Bedard 2021-08-09 16:15:44 PDT
Created attachment 435221 [details]
Patch
Comment 9 Aakash Jain 2021-08-10 08:40:51 PDT
Comment on attachment 435221 [details]
Patch

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

> Tools/Scripts/libraries/resultsdbpy/resultsdbpy/controller/test_controller.py:176
> +        uds = []

better to name it uuids

> Tools/Scripts/libraries/resultsdbpy/resultsdbpy/controller/test_controller.py:199
> +            return abort(400, description='No results for configuration in range')

This error is non human-friendly. Should make it something which is easy to understand. 
If the test is not found, the error message should specify that. If the commit is not found, error message should indicate that.

> Tools/Scripts/libraries/resultsdbpy/resultsdbpy/view/templates/documentation.html:363
> +                '/api/aggregate-results/&ltsuite&gt/&lttest&gt',

aggregate-results doesn't sounds like a right name for this api from user's perspective
Comment 10 Jonathan Bedard 2021-08-10 10:05:38 PDT
Created attachment 435269 [details]
Patch
Comment 11 Jonathan Bedard 2021-08-10 10:16:08 PDT
Comment on attachment 435221 [details]
Patch

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

>> Tools/Scripts/libraries/resultsdbpy/resultsdbpy/controller/test_controller.py:176
>> +        uds = []
> 
> better to name it uuids

Need to delete this, was just a variable for testing.

>> Tools/Scripts/libraries/resultsdbpy/resultsdbpy/view/templates/documentation.html:363
>> +                '/api/aggregate-results/&ltsuite&gt/&lttest&gt',
> 
> aggregate-results doesn't sounds like a right name for this api from user's perspective

Discussing a better API name with Aakash, results-status, results-confidence, results-prediction are some candidates
Comment 12 Jonathan Bedard 2021-08-10 10:39:50 PDT
Created attachment 435272 [details]
Patch
Comment 13 Aakash Jain 2021-08-10 14:18:08 PDT
Comment on attachment 435272 [details]
Patch

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

> Tools/Scripts/libraries/resultsdbpy/resultsdbpy/view/templates/documentation.html:363
> +                '/api/aggregate-results/&ltsuite&gt/&lttest&gt',

let's call this results-summary endpoint

> Tools/Scripts/libraries/resultsdbpy/resultsdbpy/view/templates/documentation.html:367
> +                    `Compute the combined results of a give test by aggregating results from a set of runs surrounding a specific commit:`,

Nit: give => given

> Tools/Scripts/libraries/resultsdbpy/resultsdbpy/view/templates/documentation.html:527
> +            codeBlock('include_expectations=Flase'),

Nit: Flase
Comment 14 Jonathan Bedard 2021-08-10 14:19:08 PDT
Created attachment 435288 [details]
Patch
Comment 15 Aakash Jain 2021-08-10 14:20:07 PDT
rs=me with the above comments incorporated
Comment 16 Aakash Jain 2021-08-10 14:24:40 PDT
Comment on attachment 435288 [details]
Patch

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

> Tools/Scripts/libraries/resultsdbpy/resultsdbpy/controller/test_controller.py:203
> +        for key_i in response.keys():

Nit: can rename key_i to key, and key_ii to key_i or something meaningful

> Tools/Scripts/libraries/resultsdbpy/resultsdbpy/controller/test_controller.py:206
> +                    response[key_i][key_ii] = 100 * response[key_i][key_ii] // (aggregate or 1)

Nit: // => #

> Tools/Scripts/libraries/resultsdbpy/resultsdbpy/view/templates/documentation.html:364
> +                ['Branch', 'Configuration', 'Include Expectations', 'Limit', 'Repository', 'Ref', 'UUID'],

Rename: 'Include Expectations' => include_expectations. Better not to change the keyword.
Comment 17 Jonathan Bedard 2021-08-10 14:26:17 PDT
Created attachment 435291 [details]
Patch
Comment 18 Jonathan Bedard 2021-08-10 14:42:27 PDT
Comment on attachment 435288 [details]
Patch

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

>> Tools/Scripts/libraries/resultsdbpy/resultsdbpy/controller/test_controller.py:206
>> +                    response[key_i][key_ii] = 100 * response[key_i][key_ii] // (aggregate or 1)
> 
> Nit: // => #

`//` is integer divide

>> Tools/Scripts/libraries/resultsdbpy/resultsdbpy/view/templates/documentation.html:364
>> +                ['Branch', 'Configuration', 'Include Expectations', 'Limit', 'Repository', 'Ref', 'UUID'],
> 
> Rename: 'Include Expectations' => include_expectations. Better not to change the keyword.

While we could do this, this ends up really breaking the way we use these parameters.
Comment 19 Jonathan Bedard 2021-08-10 14:51:36 PDT
Created attachment 435299 [details]
Patch
Comment 20 Jonathan Bedard 2021-08-10 15:41:20 PDT
Committed r280869 (240408@main): <https://commits.webkit.org/240408@main>