Bug 206534 - EWS django app should send cq+ patches to commit-queue
Summary: EWS django app should send cq+ patches to commit-queue
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Aakash Jain
URL:
Keywords: InRadar
Depends on: 206774
Blocks: 201934
  Show dependency treegraph
 
Reported: 2020-01-21 08:21 PST by Aakash Jain
Modified: 2020-02-19 07:41 PST (History)
5 users (show)

See Also:


Attachments
WIP (10.25 KB, patch)
2020-01-24 15:13 PST, Aakash Jain
no flags Details | Formatted Diff | Diff
Patch (13.01 KB, patch)
2020-01-28 08:10 PST, Aakash Jain
no flags Details | Formatted Diff | Diff
Patch (13.76 KB, patch)
2020-01-28 11:51 PST, Aakash Jain
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aakash Jain 2020-01-21 08:21:12 PST
EWS Django app should send cq+ patches to commit-queue. So that commit-queue (on new EWS) can process them.
Comment 1 Radar WebKit Bug Importer 2020-01-21 08:21:31 PST
<rdar://problem/58759731>
Comment 2 Aakash Jain 2020-01-24 15:13:21 PST
Created attachment 388728 [details]
WIP
Comment 3 Aakash Jain 2020-01-28 08:10:54 PST
Created attachment 388996 [details]
Patch
Comment 4 Jonathan Bedard 2020-01-28 10:51:42 PST
Comment on attachment 388996 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=388996&action=review

> Tools/BuildSlaveSupport/ews-app/ews/fetcher.py:65
> +        self.send_patches_to_buildbot(patches_to_send)

Why weren't we doing this before? This seems out of the scope of this patch.

> Tools/BuildSlaveSupport/ews-app/ews/fetcher.py:71
> +        Patch.save_patches(patch_ids_commit_queue)

What does saving a patch do?

> Tools/BuildSlaveSupport/ews-app/ews/fetcher.py:73
> +        _log.info('{} cq+ patches, {} patches need to be sent to commit queue: {}'.format(len(patch_ids_commit_queue), len(patches_to_send), patches_to_send))

We're printing the patches? That seems wrong, unless patches_to_send is actually patch_ids_to_send

> Tools/BuildSlaveSupport/ews-app/ews/fetcher.py:109
> +                    Patch.set_sent_to_commit_queue(patch_id, False)

Maybe this is better achieved by setting a 'send_patch' function at the beginning of this function so we don't have to duplicate these if statements

> Tools/BuildSlaveSupport/ews-app/ews/common/buildbot.py:44
> +    def send_patch_to_buildbot(cls, patch_path, send_to_commit_queue=False, properties=[]):

Small nit: setting an argument to a function to a list like this is bad because it creates a global list. We usually want to do:

def send_patch_to_buildbot(cls, patch_path, send_to_commit_queue=False, properties=None):
    properties = properties if properties else []

Not part of the patch, though, so feel free to ignore it.

> Tools/BuildSlaveSupport/ews-app/ews/common/buildbot.py:-56
> -        _log.debug('Executing command: {}'.format(command))

Why did we drop this logging message?
Comment 5 Aakash Jain 2020-01-28 11:49:31 PST
Comment on attachment 388996 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=388996&action=review

>> Tools/BuildSlaveSupport/ews-app/ews/fetcher.py:65
>> +        self.send_patches_to_buildbot(patches_to_send)
> 
> Why weren't we doing this before? This seems out of the scope of this patch.

The diff might look visually confusing. We were doing this before as well, I just moved that code to the function send_patches_to_buildbot()

>> Tools/BuildSlaveSupport/ews-app/ews/fetcher.py:71
>> +        Patch.save_patches(patch_ids_commit_queue)
> 
> What does saving a patch do?

Save it in the database table.

>> Tools/BuildSlaveSupport/ews-app/ews/fetcher.py:73
>> +        _log.info('{} cq+ patches, {} patches need to be sent to commit queue: {}'.format(len(patch_ids_commit_queue), len(patches_to_send), patches_to_send))
> 
> We're printing the patches? That seems wrong, unless patches_to_send is actually patch_ids_to_send

Yeah, these are just patch ids.

>> Tools/BuildSlaveSupport/ews-app/ews/fetcher.py:109
>> +                    Patch.set_sent_to_commit_queue(patch_id, False)
> 
> Maybe this is better achieved by setting a 'send_patch' function at the beginning of this function so we don't have to duplicate these if statements

Done in updated patch.

>> Tools/BuildSlaveSupport/ews-app/ews/common/buildbot.py:44
>> +    def send_patch_to_buildbot(cls, patch_path, send_to_commit_queue=False, properties=[]):
> 
> Small nit: setting an argument to a function to a list like this is bad because it creates a global list. We usually want to do:
> 
> def send_patch_to_buildbot(cls, patch_path, send_to_commit_queue=False, properties=None):
>     properties = properties if properties else []
> 
> Not part of the patch, though, so feel free to ignore it.

Done in updated patch.

>> Tools/BuildSlaveSupport/ews-app/ews/common/buildbot.py:-56
>> -        _log.debug('Executing command: {}'.format(command))
> 
> Why did we drop this logging message?

because the command might contain sensitive data like buildbot try password.
Comment 6 Aakash Jain 2020-01-28 11:51:31 PST
Created attachment 389043 [details]
Patch
Comment 7 Jonathan Bedard 2020-01-28 12:02:29 PST
Comment on attachment 389043 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=389043&action=review

r+, just take a look at the removed return statement

> Tools/BuildSlaveSupport/ews-app/ews/fetcher.py:-86
> -        return patch_ids

Any reason we removed this return statement?
Comment 8 Aakash Jain 2020-01-28 12:06:48 PST
(In reply to Jonathan Bedard from comment #7)
> Any reason we removed this return statement?
Since the return value was never used.
Comment 9 WebKit Commit Bot 2020-01-28 12:44:41 PST
Comment on attachment 389043 [details]
Patch

Clearing flags on attachment: 389043

Committed r255269: <https://trac.webkit.org/changeset/255269>
Comment 10 WebKit Commit Bot 2020-01-28 12:44:43 PST
All reviewed patches have been landed.  Closing bug.