Skip to content
Permalink
Browse files
[ews] Display status-bubble for try builds (builds for specific ews q…
…ueues)

https://bugs.webkit.org/show_bug.cgi?id=235679

Reviewed by Jonathan Bedard.

* Tools/CISupport/ews-app/ews/models/build.py:
(Build.save_build): Save the patch information in database.
* Tools/CISupport/ews-app/ews/views/statusbubble.py:
(StatusBubble._build_bubble):
(StatusBubble._should_show_bubble_for_build):
(StatusBubble._build_bubbles_for_patch):


Canonical link: https://commits.webkit.org/246479@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288673 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
aj062 committed Jan 27, 2022
1 parent 5151819 commit 38fe5a010c3fedc760e7e8140052031b5ebc7173
Showing with 16 additions and 11 deletions.
  1. +4 −0 Tools/CISupport/ews-app/ews/models/build.py
  2. +12 −11 Tools/CISupport/ews-app/ews/views/statusbubble.py
@@ -65,6 +65,10 @@ def save_build(cls, patch_id, hostname, build_id, builder_id, builder_name, buil
# If the build data is already present in database, update it, e.g.: build complete event.
return Build.update_build(build, patch_id, uid, builder_id, builder_name, builder_display_name, number, result, state_string, started_at, complete_at)

if not Patch.is_existing_patch_id(patch_id):
Patch.save_patch(patch_id)
_log.info('Received result for unknown patch. Saved patch {} to database'.format(patch_id))

# Save the new build data, e.g.: build start event.
Build(patch_id, uid, builder_id, builder_name, builder_display_name, number, result, state_string, started_at, complete_at).save()
_log.info('Saved build {} in database for patch_id: {}'.format(uid, patch_id))
@@ -80,7 +80,7 @@ class StatusBubble(View):
BUILD_RETRY_MSG = 'retrying build'
UNKNOWN_QUEUE_POSITION = '?'

def _build_bubble(self, patch, queue, hide_icons=False):
def _build_bubble(self, patch, queue, hide_icons=False, sent_to_buildbot=True):
bubble = {
'name': queue,
}
@@ -97,7 +97,7 @@ def _build_bubble(self, patch, queue, hide_icons=False):
if builds:
build = builds[0]
builds = builds[:10] # Limit number of builds to display in status-bubble hover over message
if not self._should_show_bubble_for_build(build):
if not self._should_show_bubble_for_build(build, sent_to_buildbot):
return None

if not build:
@@ -292,9 +292,11 @@ def find_failed_builds_for_patch(self, patch_id):
failed_builds.append(build)
return failed_builds

def _should_show_bubble_for_build(self, build):
def _should_show_bubble_for_build(self, build, sent_to_buildbot=True):
if build and build.result == Buildbot.SKIPPED and re.search(r'Patch .* doesn\'t have relevant changes', build.state_string):
return False
if (not build) and (not sent_to_buildbot):
return False
return True

def _queue_position(self, patch, queue, parent_queue=None):
@@ -342,14 +344,12 @@ def _build_bubbles_for_patch(self, patch, hide_icons=False):
if not patch:
return (None, show_submit_to_ews, failed_to_apply, show_retry)

if patch.sent_to_buildbot:
for queue in StatusBubble.ALL_QUEUES:
bubble = self._build_bubble(patch, queue, hide_icons)
if bubble:
show_submit_to_ews = False
bubbles.append(bubble)
if bubble['state'] in ('fail', 'error'):
show_retry = True
for queue in StatusBubble.ALL_QUEUES:
bubble = self._build_bubble(patch, queue, hide_icons, patch.sent_to_buildbot)
if bubble:
bubbles.append(bubble)
if bubble['state'] in ('fail', 'error'):
show_retry = True

if patch.sent_to_commit_queue:
if not patch.sent_to_buildbot:
@@ -358,6 +358,7 @@ def _build_bubbles_for_patch(self, patch, hide_icons=False):
if cq_bubble:
bubbles.insert(0, cq_bubble)

show_submit_to_ews = not patch.sent_to_buildbot
return (bubbles, show_submit_to_ews, failed_to_apply, show_retry)

@xframe_options_exempt

0 comments on commit 38fe5a0

Please sign in to comment.