Title: [238627] trunk/Tools
- Revision
- 238627
- Author
- [email protected]
- Date
- 2018-11-28 12:12:00 -0800 (Wed, 28 Nov 2018)
Log Message
[ews-app] Add methods to update Patch fields
https://bugs.webkit.org/show_bug.cgi?id=191931
Reviewed by Lucas Forschler.
* BuildSlaveSupport/ews-app/ews/models/patch.py:
(Patch.set_sent_to_buildbot):
(Patch.set_bug_id):
(Patch.set_obsolete):
Modified Paths
Diff
Modified: trunk/Tools/BuildSlaveSupport/ews-app/ews/models/patch.py (238626 => 238627)
--- trunk/Tools/BuildSlaveSupport/ews-app/ews/models/patch.py 2018-11-28 19:47:01 UTC (rev 238626)
+++ trunk/Tools/BuildSlaveSupport/ews-app/ews/models/patch.py 2018-11-28 20:12:00 UTC (rev 238627)
@@ -26,7 +26,7 @@
from django.db import models
-from ews.config import *
+from ews.config import ERR_EXISTING_PATCH, ERR_INVALID_PATCH_ID, ERR_NON_EXISTING_PATCH, SUCCESS
_log = logging.getLogger(__name__)
@@ -73,3 +73,47 @@
@classmethod
def is_patch_sent_to_buildbot(cls, patch_id):
return Patch.is_existing_patch_id(patch_id) and Patch.objects.get(pk=patch_id).sent_to_buildbot
+
+ @classmethod
+ def set_sent_to_buildbot(cls, patch_id):
+ if not Patch.is_existing_patch_id(patch_id):
+ return ERR_NON_EXISTING_PATCH
+
+ patch = Patch.objects.get(pk=patch_id)
+ if patch.sent_to_buildbot:
+ _log.warn('Patch {} has already been sent to Buildbot.'.format(patch_id))
+ return SUCCESS
+
+ patch.sent_to_buildbot = True
+ patch.save()
+ _log.debug('Updated patch {} with sent_to_buildbot=True'.format(patch_id))
+ return SUCCESS
+
+ @classmethod
+ def set_bug_id(cls, patch_id, bug_id):
+ if not Patch.is_existing_patch_id(patch_id):
+ return ERR_NON_EXISTING_PATCH
+
+ patch = Patch.objects.get(pk=patch_id)
+ if patch.bug_id == bug_id:
+ _log.warn('Patch {} already has bug id {} set.'.format(patch_id, bug_id))
+ return SUCCESS
+
+ patch.bug_id = bug_id
+ patch.save()
+ _log.debug('Updated patch {} with bug id {}'.format(patch_id, bug_id))
+ return SUCCESS
+
+ @classmethod
+ def set_obsolete(cls, patch_id, obsolete=True):
+ if not Patch.is_existing_patch_id(patch_id):
+ return ERR_NON_EXISTING_PATCH
+
+ patch = Patch.objects.get(pk=patch_id)
+ if patch.obsolete == obsolete:
+ _log.warn('Patch {} is already marked with obsolete={}.'.format(patch_id, obsolete))
+ return SUCCESS
+ patch.obsolete = obsolete
+ patch.save()
+ _log.debug('Marked patch {} as obsolete={}'.format(patch_id, obsolete))
+ return SUCCESS
Modified: trunk/Tools/ChangeLog (238626 => 238627)
--- trunk/Tools/ChangeLog 2018-11-28 19:47:01 UTC (rev 238626)
+++ trunk/Tools/ChangeLog 2018-11-28 20:12:00 UTC (rev 238627)
@@ -1,3 +1,15 @@
+2018-11-28 Aakash Jain <[email protected]>
+
+ [ews-app] Add methods to update Patch fields
+ https://bugs.webkit.org/show_bug.cgi?id=191931
+
+ Reviewed by Lucas Forschler.
+
+ * BuildSlaveSupport/ews-app/ews/models/patch.py:
+ (Patch.set_sent_to_buildbot):
+ (Patch.set_bug_id):
+ (Patch.set_obsolete):
+
2018-11-28 Yongjun Zhang <[email protected]>
Allow WebKit clients to specify a minimum effective width for layout.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes