WebKit Bugzilla
Attachment 361880 Details for
Bug 194572
: [ews-app] Generate status-bubble
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch
status-bubble-v2.patch (text/plain), 3.79 KB, created by
Aakash Jain
on 2019-02-12 17:58:33 PST
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Aakash Jain
Created:
2019-02-12 17:58:33 PST
Size:
3.79 KB
patch
obsolete
>Index: Tools/ChangeLog >=================================================================== >--- Tools/ChangeLog (revision 241331) >+++ Tools/ChangeLog (working copy) >@@ -1,3 +1,15 @@ >+2019-02-12 Aakash Jain <aakash_jain@apple.com> >+ >+ [ews-app] Generate status-bubble >+ https://bugs.webkit.org/show_bug.cgi?id=194572 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * BuildSlaveSupport/ews-app/ews/views/statusbubble.py: >+ (StatusBubble._build_bubble): >+ (StatusBubble._should_show_bubble_for): >+ (StatusBubble._build_bubbles_for_patch): >+ > 2019-02-12 Jonathan Bedard <jbedard@apple.com> > > webkitpy: Remove bug_dummy from parsed test expectations >Index: Tools/BuildSlaveSupport/ews-app/ews/views/statusbubble.py >=================================================================== >--- Tools/BuildSlaveSupport/ews-app/ews/views/statusbubble.py (revision 241329) >+++ Tools/BuildSlaveSupport/ews-app/ews/views/statusbubble.py (working copy) >@@ -25,8 +25,73 @@ from __future__ import unicode_literals > from django.http import HttpResponse > from django.shortcuts import render > from django.views import View >+from django.views.decorators.clickjacking import xframe_options_exempt >+from ews.models.patch import Patch >+import ews.config as config > > > class StatusBubble(View): >+ def _build_bubble(self, build, patch): >+ builder_display_name = build.builder_id # TODO: implement this, fetch it from buildermapping table. >+ builder_full_name = build.builder_id # TODO: implement this, fetch it from buildermapping table. >+ >+ bubble = { >+ "name": builder_display_name, >+ "url": 'https://{}/#/builders/{}/builds/{}'.format(config.BUILDBOT_SERVER_HOST, build.builder_id, build.number), >+ } >+ >+ bubble["details_message"] = '{}\n{}'.format(builder_full_name, build.state_string) >+ if build.result is None: >+ bubble["state"] = "started" >+ elif build.result == 0: # SUCCESS >+ bubble["state"] = "pass" >+ elif build.result == 1: # WARNINGS >+ bubble["state"] = "pass" >+ elif build.result == 2: # FAILURE >+ bubble["state"] = "fail" >+ elif build.result == 3: # SKIPPED >+ bubble["state"] = "none" >+ elif build.result == 4: # EXCEPTION >+ bubble["state"] = "error" >+ elif build.result == 5: # RETRY >+ bubble["state"] = "provisional-fail" >+ else: >+ bubble["state"] = "fail" >+ >+ return bubble >+ >+ def _should_show_bubble_for(self, patch, build): >+ # TODO: Implement this. >+ return True >+ >+ def _build_bubbles_for_patch(self, patch): >+ show_submit_to_ews = True >+ failed_to_apply = False # TODO: Implement this. >+ bubbles = [] >+ >+ if not patch: >+ return (None, show_submit_to_ews, failed_to_apply) >+ >+ for build in patch.build_set.all(): >+ show_submit_to_ews = False >+ if not self._should_show_bubble_for(patch, build): >+ continue >+ bubble = self._build_bubble(build, patch) >+ if bubble: >+ bubbles.append(bubble) >+ >+ return (bubbles, show_submit_to_ews, failed_to_apply) >+ >+ @xframe_options_exempt > def get(self, request, patch_id): >- return HttpResponse("Placeholder for status bubble for {}.".format(patch_id)) >+ patch_id = int(patch_id) >+ patch = Patch.get_patch(patch_id) >+ bubbles, show_submit_to_ews, show_failure_to_apply = self._build_bubbles_for_patch(patch) >+ >+ template_values = { >+ "bubbles": bubbles, >+ "patch_id": patch_id, >+ "show_submit_to_ews": show_submit_to_ews, >+ "show_failure_to_apply": show_failure_to_apply, >+ } >+ return render(request, 'statusbubble.html', template_values)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
lforschler
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194572
:
361874
| 361880 |
361896