def patches_to_send_to_commit_queue(self, patch_ids): if not patch_ids: return patch_ids patches_in_queue = set(Buildbot.get_patches_in_queue('Commit-Queue')) patch_ids = [ patch_id for patch_id in set(patch_ids) if str(patch_id) not in patches_in_queue ] patch_ids_to_send = [] for patch_id in patch_ids: patch = Patch.get_patch(patch_id) recent_build, _ = StatusBubble().get_latest_build_for_queue( patch, 'commit') if not recent_build: patch_ids_to_send.append(patch_id) continue recent_build_timestamp = datetime.datetime.fromtimestamp( recent_build.complete_at, tz=pytz.UTC) cq_timestamp = Bugzilla.get_cq_plus_timestamp(patch_id) if not cq_timestamp: patch_ids_to_send.append(patch_id) continue if cq_timestamp > recent_build_timestamp: patch_ids_to_send.append(patch_id) return patch_ids_to_send
def find_failed_builds_for_patch(self, patch_id): patch = Patch.get_patch(patch_id) if not patch: return [] failed_builds = [] for queue in StatusBubble.ALL_QUEUES: build, _ = self.get_latest_build_for_queue(patch, queue) if not build: continue if build.result in (Buildbot.FAILURE, Buildbot.EXCEPTION, Buildbot.CANCELLED): failed_builds.append(build) return failed_builds
def get(self, request, 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)
def get(self, request, patch_id): hide_icons = request.GET.get('hide_icons', False) patch_id = int(patch_id) patch = Patch.get_patch(patch_id) bubbles, show_submit_to_ews, show_failure_to_apply, show_retry = self._build_bubbles_for_patch(patch, hide_icons) template_values = { 'bubbles': bubbles, 'patch_id': patch_id, 'show_submit_to_ews': show_submit_to_ews, 'show_failure_to_apply': show_failure_to_apply, 'show_retry_button': show_retry, } return render(request, 'statusbubble.html', template_values)
def get(self, request, patch_id): patch_id = int(patch_id) patch = Patch.get_patch(patch_id) response_data = self._build_statuses_for_patch(patch) return JsonResponse(response_data)