Bug 115387 - [webkitpy] Need suggest-emeriti command
Summary: [webkitpy] Need suggest-emeriti command
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Glenn Adams
URL:
Keywords:
Depends on: 115391
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-29 17:16 PDT by Glenn Adams
Modified: 2018-02-01 10:29 PST (History)
10 users (show)

See Also:


Attachments
Patch (31.89 KB, patch)
2013-05-03 16:51 PDT, Glenn Adams
no flags Details | Formatted Diff | Diff
Patch (31.83 KB, patch)
2013-05-03 23:26 PDT, Glenn Adams
benjamin: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Glenn Adams 2013-04-29 17:16:59 PDT
There should be a suggest-emeriti command that complements to suggest-nominations, and which suggests committers and/or reviewers to be "retired" to an emeritus role.

See the thread at [1].

[1] https://lists.webkit.org/pipermail/webkit-dev/2013-April/024450.html
Comment 1 Glenn Adams 2013-05-03 16:51:36 PDT
Created attachment 200509 [details]
Patch
Comment 2 Benjamin Poulain 2013-05-03 20:43:57 PDT
Comment on attachment 200509 [details]
Patch

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

Really cool!

I think you could have get away with a single command :)

I cannot review this right now but here is some comments I have from looking over the patch:

> Tools/ChangeLog:59
> +        (SuggestNominations._count_recent_patches): Add require_reviews option, which differs from suggest-nominations and suggest-emeriti.

Why not just catch the exception from the call site in SuggestEmeriti?

> Tools/Scripts/webkitpy/tool/commands/suggestemeriti.py:2
> +# Copyright (c) 2011 Google Inc. All rights reserved.
> +# Copyright (c) 2011 Code Aurora Forum. All rights reserved.

It this right?

> Tools/Scripts/webkitpy/tool/commands/suggestemeriti.py:115
> +            # skip committers that are reviewers

Comment style.
Comment 3 Glenn Adams 2013-05-03 23:26:04 PDT
Created attachment 200516 [details]
Patch
Comment 4 Glenn Adams 2013-05-03 23:32:03 PDT
(In reply to comment #2)
> (From update of attachment 200509 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=200509&action=review
> 
> Really cool!
> 
> I think you could have get away with a single command :)

I suppose you mean I could have implemented this as an option on suggest-nominations. Yes, that would have been possible, at the cost of merging somewhat unrelated functionality. I prefer smaller modules with less surface area, making mods easier, etc.

> 
> I cannot review this right now but here is some comments I have from looking over the patch:
> 
> > Tools/ChangeLog:59
> > +        (SuggestNominations._count_recent_patches): Add require_reviews option, which differs from suggest-nominations and suggest-emeriti.
> 
> Why not just catch the exception from the call site in SuggestEmeriti?

In SuggestNominations, we need to treat missing reviewer as an error condition, raising exception without returning a commit dict; but in SuggestEmeriti lack of reviewer isn't an error, and we want the commit object. I suppose I could handle this by returning a commit object in both cases, and have SuggestNominations merely skip it if reviewers is empty. In which case I could remove the CommitLogMissingReviewer class.

> 
> > Tools/Scripts/webkitpy/tool/commands/suggestemeriti.py:2
> > +# Copyright (c) 2011 Google Inc. All rights reserved.
> > +# Copyright (c) 2011 Code Aurora Forum. All rights reserved.
> 
> It this right?

Fixed. I thought of this after I posted the earlier patch.

> 
> > Tools/Scripts/webkitpy/tool/commands/suggestemeriti.py:115
> > +            # skip committers that are reviewers
> 
> Comment style.

Fixed.
Comment 5 Benjamin Poulain 2013-05-08 16:05:27 PDT
Comment on attachment 200516 [details]
Patch

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

> Tools/Scripts/webkitpy/tool/commands/suggestemeriti.py:72
> +            reviewers_cache = activity['reviewers_cache']

Do we really need this? It is not like performance matters here.

> Tools/Scripts/webkitpy/tool/commands/suggestemeriti.py:80
> +                reviewer_name, _ = self._comment_regexp.subn("", reviewer_name)
> +                reviewer_name, _ = self._string_regexp.subn("", reviewer_name)
> +                reviewer_name = reviewer_name.strip()
> +                reviewer = reviewers_cache.get(reviewer_name)
> +                if not reviewer:
> +                    contributors, _ = self._committer_list.contributors_by_fuzzy_match(reviewer_name)
> +                    if contributors:

Discussed on IRC: looks like we should use the generalized cleaning code here.

> Tools/Scripts/webkitpy/tool/commands/suggestemeriti.py:88
> +                if not reviewed_revisions:
> +                    reviewed_revisions = set()

You can use defaultdict or similar mechanism to avoid this kind of tricks.

> Tools/Scripts/webkitpy/tool/commands/suggestemeriti.py:94
> +            committer = commit['committer']
> +            if committer:

Can "not committer" happen?

> Tools/Scripts/webkitpy/tool/commands/suggestemeriti.py:98
> +                if not committed_revisions:
> +                    committed_revisions = set()

Ditto.
Comment 6 Simon Fraser (smfr) 2018-02-01 10:29:55 PST
Would be nice to revive this.