Title: [260444] trunk/Tools
Revision
260444
Author
[email protected]
Date
2020-04-21 11:13:36 -0700 (Tue, 21 Apr 2020)

Log Message

[ews] Display error message when submit for EWS analysis button doesn't work
https://bugs.webkit.org/show_bug.cgi?id=210803

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-app/ews/views/submittoews.py:
(SubmitToEWS.post): Display relevant error message on submit for EWS analysis button failure.
* BuildSlaveSupport/ews-app/ews/fetcher.py:
(BugzillaPatchFetcher.fetch):
(BugzillaPatchFetcher.send_patches_to_buildbot):
* BuildSlaveSupport/ews-app/ews/config.py: Add few more error codes.

Modified Paths

Diff

Modified: trunk/Tools/BuildSlaveSupport/ews-app/ews/config.py (260443 => 260444)


--- trunk/Tools/BuildSlaveSupport/ews-app/ews/config.py	2020-04-21 18:10:08 UTC (rev 260443)
+++ trunk/Tools/BuildSlaveSupport/ews-app/ews/config.py	2020-04-21 18:13:36 UTC (rev 260444)
@@ -42,3 +42,5 @@
 ERR_EXISTING_PATCH = -2
 ERR_NON_EXISTING_PATCH = -3
 ERR_INVALID_PATCH_ID = -4
+ERR_OBSOLETE_PATCH = -5
+ERR_UNABLE_TO_FETCH_PATCH = -6

Modified: trunk/Tools/BuildSlaveSupport/ews-app/ews/fetcher.py (260443 => 260444)


--- trunk/Tools/BuildSlaveSupport/ews-app/ews/fetcher.py	2020-04-21 18:10:08 UTC (rev 260443)
+++ trunk/Tools/BuildSlaveSupport/ews-app/ews/fetcher.py	2020-04-21 18:13:36 UTC (rev 260444)
@@ -28,6 +28,7 @@
 
 from ews.common.bugzilla import Bugzilla
 from ews.common.buildbot import Buildbot
+from ews.config import ERR_OBSOLETE_PATCH, ERR_UNABLE_TO_FETCH_PATCH
 from ews.models.patch import Patch
 from ews.views.statusbubble import StatusBubble
 
@@ -66,7 +67,7 @@
         Patch.save_patches(patch_ids)
         patches_to_send = self.patches_to_send_to_buildbot(patch_ids)
         _log.info('{} r? patches, {} patches need to be sent to Buildbot: {}'.format(len(patch_ids), len(patches_to_send), patches_to_send))
-        self.send_patches_to_buildbot(patches_to_send)
+        return self.send_patches_to_buildbot(patches_to_send)
 
     def fetch_commit_queue_patches(self):
         patch_ids_commit_queue = Bugzilla.get_list_of_patches_for_commit_queue()
@@ -84,10 +85,14 @@
             bz_patch = Bugzilla.retrieve_attachment(patch_id)
             if not bz_patch or bz_patch['id'] != patch_id:
                 _log.error('Unable to retrive patch "{}"'.format(patch_id))
+                if len(patches_to_send) == 1:
+                    return ERR_UNABLE_TO_FETCH_PATCH
                 continue
             if bz_patch.get('is_obsolete'):
                 _log.warn('Patch is obsolete, skipping')
                 Patch.set_obsolete(patch_id)
+                if len(patches_to_send) == 1:
+                    return ERR_OBSOLETE_PATCH
                 continue
             if not send_to_commit_queue and Patch.is_patch_sent_to_buildbot(patch_id):
                 _log.error('Patch {} is already sent to buildbot.'.format(patch_id))

Modified: trunk/Tools/BuildSlaveSupport/ews-app/ews/views/submittoews.py (260443 => 260444)


--- trunk/Tools/BuildSlaveSupport/ews-app/ews/views/submittoews.py	2020-04-21 18:10:08 UTC (rev 260443)
+++ trunk/Tools/BuildSlaveSupport/ews-app/ews/views/submittoews.py	2020-04-21 18:13:36 UTC (rev 260444)
@@ -1,4 +1,4 @@
-# Copyright (C) 2019 Apple Inc. All rights reserved.
+# Copyright (C) 2019-2020 Apple Inc. All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
@@ -30,6 +30,7 @@
 from django.views import View
 from django.views.decorators.clickjacking import xframe_options_exempt
 
+from ews.config import ERR_OBSOLETE_PATCH, ERR_UNABLE_TO_FETCH_PATCH
 from ews.fetcher import BugzillaPatchFetcher
 from ews.models.patch import Patch
 
@@ -55,7 +56,11 @@
                 return redirect('/status-bubble/{}'.format(patch_id))
             return HttpResponse("Patch {} already submitted. Please wait for status-bubbles.".format(patch_id))
 
-        BugzillaPatchFetcher().fetch([patch_id])
+        rc = BugzillaPatchFetcher().fetch([patch_id])
+        if rc == ERR_UNABLE_TO_FETCH_PATCH:
+            return HttpResponse('EWS is unable to access patch {}. Please ensure that this patch is publicly accessible or has r? set.'.format(patch_id))
+        if rc == ERR_OBSOLETE_PATCH:
+            return HttpResponse('Patch {} is obsolete, not submitting to EWS.'.format(patch_id))
 
         if request.POST.get('next_action') == 'return_to_bubbles':
             return redirect('/status-bubble/{}'.format(patch_id))

Modified: trunk/Tools/ChangeLog (260443 => 260444)


--- trunk/Tools/ChangeLog	2020-04-21 18:10:08 UTC (rev 260443)
+++ trunk/Tools/ChangeLog	2020-04-21 18:13:36 UTC (rev 260444)
@@ -1,3 +1,17 @@
+2020-04-21  Aakash Jain  <[email protected]>
+
+        [ews] Display error message when submit for EWS analysis button doesn't work
+        https://bugs.webkit.org/show_bug.cgi?id=210803
+
+        Reviewed by Jonathan Bedard.
+
+        * BuildSlaveSupport/ews-app/ews/views/submittoews.py:
+        (SubmitToEWS.post): Display relevant error message on submit for EWS analysis button failure.
+        * BuildSlaveSupport/ews-app/ews/fetcher.py:
+        (BugzillaPatchFetcher.fetch):
+        (BugzillaPatchFetcher.send_patches_to_buildbot):
+        * BuildSlaveSupport/ews-app/ews/config.py: Add few more error codes.
+
 2020-04-21  Lauro Moura  <[email protected]>
 
         [GStreamer][JHBuild] Update to 1.16.2
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to