Changeset 251516 in webkit


Ignore:
Timestamp:
Oct 23, 2019 5:18:15 PM (5 years ago)
Author:
aakash_jain@apple.com
Message:

[EWS] Multiple builds are triggered for one patch sometimes in new EWS
https://bugs.webkit.org/show_bug.cgi?id=199417

Reviewed by Jonathan Bedard.

  • BuildSlaveSupport/ews-app/ews/fetcher.py:

(BugzillaPatchFetcher.fetch): Set the flag before sending the patch to buildbot. Unset it in case of failure.
Also added additional check for sent_to_buildbot flag before processing patch.

  • BuildSlaveSupport/ews-app/ews/models/patch.py:

(Patch.save_patch): Improved logging.
(Patch.set_sent_to_buildbot): Modified to accept sent_to_buildbot paramater, and set the value accordingly.

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/BuildSlaveSupport/ews-app/ews/fetcher.py

    r249483 r251516  
    6161        Patch.save_patches(patch_ids)
    6262        patches_to_send = self.patches_to_send_to_buildbot(patch_ids)
    63         _log.info('{} r? patches, {} patches need to be sent to Buildbot.'.format(len(patch_ids), len(patches_to_send)))
     63        _log.info('{} r? patches, {} patches need to be sent to Buildbot: {}'.format(len(patch_ids), len(patches_to_send), patches_to_send))
    6464
    6565        for patch_id in patches_to_send:
     66            if Patch.is_patch_sent_to_buildbot(patch_id):
     67                _log.error('Patch {} is already sent to buildbot.'.format(patch_id))
     68                continue
     69            Patch.set_sent_to_buildbot(patch_id, True)
    6670            bz_patch = Bugzilla.retrieve_attachment(patch_id)
    6771            if not bz_patch or bz_patch['id'] != patch_id:
     
    7680            if rc == 0:
    7781                Patch.set_bug_id(patch_id, bz_patch['bug_id'])
    78                 Patch.set_sent_to_buildbot(patch_id)
    7982            else:
    8083                _log.error('Failed to send patch to buildbot.')
     84                Patch.set_sent_to_buildbot(patch_id, False)
    8185                #FIXME: send an email for this failure
    8286        return patch_ids
  • trunk/Tools/BuildSlaveSupport/ews-app/ews/models/patch.py

    r241488 r251516  
    4646    def save_patch(cls, patch_id, bug_id=-1, obsolete=False, sent_to_buildbot=False):
    4747        if not Patch.is_valid_patch_id(patch_id):
     48            _log.warn('Patch id {} in invalid. Skipped saving.'.format(patch_id))
    4849            return ERR_INVALID_PATCH_ID
    4950
    5051        if Patch.is_existing_patch_id(patch_id):
    51             _log.debug("Patch id {} already exists in database. Skipped saving.".format(patch_id))
     52            _log.debug('Patch id {} already exists in database. Skipped saving.'.format(patch_id))
    5253            return ERR_EXISTING_PATCH
    5354        Patch(patch_id, bug_id, obsolete, sent_to_buildbot).save()
     
    8384
    8485    @classmethod
    85     def set_sent_to_buildbot(cls, patch_id):
     86    def set_sent_to_buildbot(cls, patch_id, sent_to_buildbot=True):
    8687        if not Patch.is_existing_patch_id(patch_id):
    87             return ERR_NON_EXISTING_PATCH
     88            Patch.save_patch(patch_id=patch_id, sent_to_buildbot=sent_to_buildbot)
     89            _log.info('Patch {} saved to database with sent_to_buildbot={}'.format(patch_id, sent_to_buildbot))
     90            return SUCCESS
    8891
    8992        patch = Patch.objects.get(pk=patch_id)
    90         if patch.sent_to_buildbot:
    91             _log.warn('Patch {} has already been sent to Buildbot.'.format(patch_id))
     93        if patch.sent_to_buildbot == sent_to_buildbot:
     94            _log.warn('Patch {} already has sent_to_buildbot={}'.format(patch_id, sent_to_buildbot))
    9295            return SUCCESS
    9396
    94         patch.sent_to_buildbot = True
     97        patch.sent_to_buildbot = sent_to_buildbot
    9598        patch.save()
    96         _log.debug('Updated patch {} with sent_to_buildbot=True'.format(patch_id))
     99        _log.info('Updated patch {} with sent_to_buildbot={}'.format(patch_id, sent_to_buildbot))
    97100        return SUCCESS
    98101
  • trunk/Tools/ChangeLog

    r251514 r251516  
     12019-10-23  Aakash Jain  <aakash_jain@apple.com>
     2
     3        [EWS] Multiple builds are triggered for one patch sometimes in new EWS
     4        https://bugs.webkit.org/show_bug.cgi?id=199417
     5
     6        Reviewed by Jonathan Bedard.
     7
     8        * BuildSlaveSupport/ews-app/ews/fetcher.py:
     9        (BugzillaPatchFetcher.fetch): Set the flag before sending the patch to buildbot. Unset it in case of failure.
     10        Also added additional check for sent_to_buildbot flag before processing patch.
     11        * BuildSlaveSupport/ews-app/ews/models/patch.py:
     12        (Patch.save_patch): Improved logging.
     13        (Patch.set_sent_to_buildbot): Modified to accept sent_to_buildbot paramater, and set the value accordingly.
     14
    1152019-10-23  Truitt Savell  <tsavell@apple.com>
    216
Note: See TracChangeset for help on using the changeset viewer.