Bug 208940 - Add API endpoint in EWS django app to provide patch status in json format
Summary: Add API endpoint in EWS django app to provide patch status in json format
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: 208938
  Show dependency treegraph
 
Reported: 2020-03-11 12:51 PDT by Aakash Jain
Modified: 2020-03-20 09:15 PDT (History)
6 users (show)

See Also:


Attachments
Patch (5.56 KB, patch)
2020-03-11 12:56 PDT, Aakash Jain
no flags Details | Formatted Diff | Diff
Patch (4.74 KB, patch)
2020-03-12 15:12 PDT, Aakash Jain
no flags Details | Formatted Diff | Diff
Patch for landing (4.74 KB, patch)
2020-03-13 11:31 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 2020-03-11 12:51:23 PDT
Add API endpoint in EWS django app to provide patch status in json format. This data can be used by other tools.
Comment 1 Aakash Jain 2020-03-11 12:56:32 PDT
Created attachment 393279 [details]
Patch
Comment 2 Aakash Jain 2020-03-11 13:00:19 PDT
e.g.: https://ews.webkit-uat.org/status/390184/
Comment 3 Jonathan Bedard 2020-03-11 15:14:49 PDT
Comment on attachment 393279 [details]
Patch

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

> Tools/ChangeLog:3
> +        Add API endpoint in EWS django app to provide patch status in json format

Good idea, curious if there is a specific use case you had in mind for this

> Tools/BuildSlaveSupport/ews-app/ews/views/status.py:43
> +        if build.result is None:

I wonder if something like this would be more elegant:

bubble['state'] = {
    None: 'started',
    Buildbot.SUCCESS: 'pass',
    Buildbot.WARNINGS: 'pass',
    ...
}.get(build.result, 'error')
Comment 4 Aakash Jain 2020-03-12 15:12:16 PDT
Created attachment 393419 [details]
Patch
Comment 5 Aakash Jain 2020-03-12 15:16:00 PDT
(In reply to Jonathan Bedard from comment #3)
> Good idea, curious if there is a specific use case you had in mind for this
For https://bugs.webkit.org/show_bug.cgi?id=208938

> I wonder if something like this would be more elegant:
I simplified it further, simply used build.result for 'state'.
Comment 6 Jonathan Bedard 2020-03-12 16:23:01 PDT
Comment on attachment 393419 [details]
Patch

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

> Tools/BuildSlaveSupport/ews-app/ews/views/status.py:67
> +        response_data = {'status': self._build_statuses_for_patch(patch)}

I think we should return the list directly instead of packaging it in a dictionary.
Comment 7 Aakash Jain 2020-03-13 11:31:35 PDT
Created attachment 393511 [details]
Patch for landing
Comment 8 Aakash Jain 2020-03-13 11:35:05 PDT
(In reply to Jonathan Bedard from comment #6)
> I think we should return the list directly instead of packaging it in a dictionary.
Done in updated patch.
Comment 9 WebKit Commit Bot 2020-03-13 11:52:05 PDT
Comment on attachment 393511 [details]
Patch for landing

Clearing flags on attachment: 393511

Committed r258415: <https://trac.webkit.org/changeset/258415>
Comment 10 WebKit Commit Bot 2020-03-13 11:52:07 PDT
All reviewed patches have been landed.  Closing bug.
Comment 11 Radar WebKit Bug Importer 2020-03-13 11:53:14 PDT
<rdar://problem/60427130>