Bug 204385 - results.webkit.org/api/failures should return an error when no test-run is found for specified criteria
Summary: results.webkit.org/api/failures should return an error when no test-run is fo...
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-11-19 15:57 PST by Jonathan Bedard
Modified: 2019-11-22 16:15 PST (History)
3 users (show)

See Also:


Attachments
Patch (6.52 KB, patch)
2019-11-19 16:01 PST, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch for landing (6.50 KB, patch)
2019-11-22 14:43 PST, 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-11-19 15:57:17 PST
This is a problem pretty unique to the failures endpoint, at the moment, since it's the only endpoint which is collapsing results from multiple test runs.
Comment 1 Jonathan Bedard 2019-11-19 15:57:46 PST
<rdar://problem/57334389>
Comment 2 Jonathan Bedard 2019-11-19 16:01:43 PST
Created attachment 383916 [details]
Patch
Comment 3 Aakash Jain 2019-11-21 09:24:53 PST
Comment on attachment 383916 [details]
Patch

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

rs=me

> Tools/resultsdbpy/resultsdbpy/controller/failure_controller.py:86
> +                abort(404, description='No test runs found with the specified criteria')

should it be 404 or something else. It might make it hard to distinguish incorrect urls from correct urls returning 404.
Comment 4 Jonathan Bedard 2019-11-21 09:45:54 PST
Comment on attachment 383916 [details]
Patch

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

>> Tools/resultsdbpy/resultsdbpy/controller/failure_controller.py:86
>> +                abort(404, description='No test runs found with the specified criteria')
> 
> should it be 404 or something else. It might make it hard to distinguish incorrect urls from correct urls returning 404.

The error messages for this is different 'No test runs found with the specified criteria' vs 'The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.'.

We clearly need a 400 family error, I don't see one that fits better....maybe 406 or 425? But you kind of have to think creatively for why those fit.
Comment 5 Jonathan Bedard 2019-11-22 14:43:39 PST
Created attachment 384200 [details]
Patch for landing
Comment 6 WebKit Commit Bot 2019-11-22 16:15:13 PST
Comment on attachment 384200 [details]
Patch for landing

Clearing flags on attachment: 384200

Committed r252815: <https://trac.webkit.org/changeset/252815>
Comment 7 WebKit Commit Bot 2019-11-22 16:15:14 PST
All reviewed patches have been landed.  Closing bug.