Changeset 251368 in webkit
- Timestamp:
- Oct 21, 2019 11:34:45 AM (5 years ago)
- Location:
- trunk/Tools
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/BuildSlaveSupport/ews-app/ews/models/build.py
r243502 r251368 45 45 started_at = models.IntegerField(null=True, blank=True) 46 46 complete_at = models.IntegerField(null=True, blank=True) 47 retried = models.BooleanField(default=False) 47 48 created = models.DateTimeField(auto_now_add=True) 48 49 modified = models.DateTimeField(auto_now=True) … … 93 94 94 95 @classmethod 96 def set_retried(cls, uid, retried=True): 97 build = Build.get_existing_build(uid) 98 if not build: 99 return 100 build.retried = retried 101 build.save(update_fields=['retried', 'modified']) 102 _log.info('Updated build {} in database with retried={}'.format(uid, retried)) 103 104 @classmethod 95 105 def get_existing_build(cls, uid): 96 106 try: -
trunk/Tools/BuildSlaveSupport/ews-app/ews/templates/statusbubble.html
r244940 r251368 49 49 } 50 50 form { 51 float: left; 51 52 display: block; 52 53 } … … 101 102 {% endif %} 102 103 104 {% if show_retry_button %} 105 <form name="retry" method="POST" action="/retry/">{% csrf_token %} 106 <input type="hidden" name="patch_id" value="{{ patch_id }}"> 107 <input class="status" type="submit" value="↻ Retry failed builds"> 108 </form> 109 {% endif %} 110 103 111 <script> 104 112 // Convert from UTC dates to local. -
trunk/Tools/BuildSlaveSupport/ews-app/ews/views/retrypatch.py
r250623 r251368 26 26 27 27 from django.http import HttpResponse 28 from django.shortcuts import re nder28 from django.shortcuts import redirect, render 29 29 from django.views import View 30 30 from django.views.decorators.clickjacking import xframe_options_exempt 31 31 32 32 from ews.common.buildbot import Buildbot 33 from ews.models.build import Build 33 34 from ews.models.patch import Patch 34 35 from ews.views.statusbubble import StatusBubble … … 56 57 failed_to_retry_builds = [] 57 58 for build in builds_to_retry: 59 if build.retried: 60 _log.warn('Build {} for patch {} is already retried.'.format(build.uid, patch_id)) 61 continue 62 Build.set_retried(build.uid, True) 58 63 if not Buildbot.retry_build(build.builder_id, build.number): 59 64 failed_to_retry_builds.append(build) 65 Build.set_retried(build.uid, False) 60 66 61 67 if len(failed_to_retry_builds) > 0: … … 64 70 _log.warn(message) 65 71 return HttpResponse(message) 66 return HttpResponse('Submitted {} build(s) to EWS for retry for patch {}.'.format(len(builds_to_retry),patch_id))72 return redirect('/status-bubble/{}'.format(patch_id)) -
trunk/Tools/BuildSlaveSupport/ews-app/ews/views/statusbubble.py
r251256 r251368 99 99 bubble['state'] = 'started' 100 100 bubble['details_message'] = 'Build is in-progress. Recent messages:' + self._steps_messages_from_multiple_builds(builds) 101 elif build.retried: 102 bubble['state'] = 'started' 103 bubble['details_message'] = 'Waiting for available bot to retry the build.\n\nRecent messages:' + self._steps_messages_from_multiple_builds(builds) 101 104 elif build.result == Buildbot.SUCCESS: 102 105 if is_parent_build: … … 277 280 show_submit_to_ews = True 278 281 failed_to_apply = False # TODO: https://bugs.webkit.org/show_bug.cgi?id=194598 282 show_retry = False 279 283 bubbles = [] 280 284 281 285 if not (patch and patch.sent_to_buildbot): 282 return (None, show_submit_to_ews, failed_to_apply )286 return (None, show_submit_to_ews, failed_to_apply, show_retry) 283 287 284 288 for queue in StatusBubble.ALL_QUEUES: … … 290 294 show_submit_to_ews = False 291 295 bubbles.append(bubble) 292 293 return (bubbles, show_submit_to_ews, failed_to_apply) 296 if bubble['state'] in ('fail', 'error'): 297 show_retry = True 298 299 return (bubbles, show_submit_to_ews, failed_to_apply, show_retry) 294 300 295 301 @xframe_options_exempt … … 298 304 patch_id = int(patch_id) 299 305 patch = Patch.get_patch(patch_id) 300 bubbles, show_submit_to_ews, show_failure_to_apply = self._build_bubbles_for_patch(patch, hide_icons)306 bubbles, show_submit_to_ews, show_failure_to_apply, show_retry = self._build_bubbles_for_patch(patch, hide_icons) 301 307 302 308 template_values = { … … 305 311 'show_submit_to_ews': show_submit_to_ews, 306 312 'show_failure_to_apply': show_failure_to_apply, 313 'show_retry_button': show_retry, 307 314 } 308 315 return render(request, 'statusbubble.html', template_values) -
trunk/Tools/ChangeLog
r251365 r251368 1 2019-10-18 Aakash Jain <aakash_jain@apple.com> 2 3 EWS should have a way to retry a patch 4 https://bugs.webkit.org/show_bug.cgi?id=196599 5 6 Reviewed by Jonathan Bedard. 7 8 * BuildSlaveSupport/ews-app/ews/models/build.py: 9 (Build): Add the retried field to keep track of whether a build is requested to be retried or not. 10 (Build.set_retried): Method to set the retried field. 11 * BuildSlaveSupport/ews-app/ews/templates/statusbubble.html: Added the 'Retry failed builds' button. 12 * BuildSlaveSupport/ews-app/ews/views/retrypatch.py: 13 (RetryPatch.post): Added a check if the build is already retried. Also, set the retried flag appropriately. 14 * BuildSlaveSupport/ews-app/ews/views/statusbubble.py: 15 (StatusBubble._build_bubble): Updated the status-bubble to in-progress while waiting for build to be retried. 16 (StatusBubble._build_bubbles_for_patch): Display the retry button only if there are failed builds. 17 * BuildSlaveSupport/ews-app/ews/migrations/0002_build_retried.py: Added database migration. 18 1 19 2019-10-21 Alicia Boya García <aboya@igalia.com> 2 20
Note: See TracChangeset
for help on using the changeset viewer.