New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 710931 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 764045
Owner: ----
Closed: Sep 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: ----
Type: ----


Previous locations:
gerrit:5956


Sign in to add a comment

Gerrit sending multiple emails for CC

Project Member Reported by tfarina@chromium.org, Apr 6 2017

Issue description

Take https://chromium-review.googlesource.com/465666 as an example.

When I first pushed/uploaded it, it sent an e-mail to me and John (cc) saying that I uploaded a change. Then it sent another e-mail to darin+cc (cc), and a third to avi (cc).

Then when I added Tommi as a reviewer, it sent two emails, one with my comments, and other adding Tommi as a reviewer.

And fifth e-mail when I checked the CQ dry run button.

I think the first 3 was unnecessary, but they were done by Gerrit, not me.

 
Cc: hie...@google.com
Labels: Milestone-Chromium-Launch
hiesel: PTAL. I think something weird is going on with emails and unregistered CCs. Too many individual messages are showing up in the uploader's inbox.

Comment 3 by wyatta@google.com, Apr 7 2017

Cc: -hie...@google.com
Components: -PolyGerrit
Labels: Hotlist-Email
Owner: hie...@google.com
Looks like a dupe of 5931 to me, but assigning to hiesel@ to evaluate it for sure.

Comment 4 by hie...@google.com, Apr 10 2017

From what I see, this might be indented behavior (and not a duplicate of 5931).  Bug 5931  is about sending the exact same message out multiple times, while this bug seems different:

When looking at the timestamps of the actions you mentioned, all of those were individual actions (each causing a notification to be sent):

1) Sat Apr 1 00:30:17 2017 +0000: Create change
2) Sat Apr 1 00:30:27 2017 +0000: CC chromium-reviews@
3) Sat Apr 1 00:30:33 2017 +0000: CC John
4) Sat Apr 1 00:30:38 2017 +0000: CC Darin
5) Sat Apr 1 00:30:42 2017 +0000: CC Avi
6) Sat Apr 1 00:36:53 2017 +0000: Thiago presses QC dry run
[...]

> Then when I added Tommi as a reviewer, it sent two emails, one with my comments, and other adding Tommi as a reviewer.

IIRC, adding a person as a reviewer and posting comments are two different API calls in Gerrit. However, PolyGerrit shows a single UI to do both in one step. Wyatt, is PolyGerrit setting notify=none when people also post a comment next to adding a reviewer? If not, this could cause redundant messages.

Comment 5 by wyatta@google.com, Apr 10 2017

Cc: hie...@google.com
Owner: ----
> From what I see, this might be indented behavior

I see what you mean now, Patrick. This does look like partly intended behavior.

> IIRC, adding a person as a reviewer and posting comments are two different API calls in Gerrit.

They are the same API call (post review), but can result in multiple emails being sent if comments are posted at the same time that reviewers are added or removed. These emails *could* be combined, but it wouldn't be straightforward.

While adding any number of reviewers at the same time that comments and votes are posted, there should only be two (different) emails sent, so it doesn't seem like the source of redundant emails.

> I think the first 3 was unnecessary, but they were done by Gerrit, not me.

Because the timestamps are different, it looks like whatever mechanism is automatically adding the CCs is not adding them together in a batch.

Comment 6 by hie...@google.com, Apr 11 2017

> They are the same API call (post review)

Ah, right, I was thinking of PostReviewer and PostReview and forgot that PostReview can also add new reviewers.

Comment 7 by logan@google.com, Apr 12 2017

Project: chromium
Moved issue gerrit:5956 to now be  issue chromium:710931 .

Comment 8 by logan@google.com, Apr 12 2017

Labels: -Milestone-Chromium-Launch -Hotlist-Email Proj-Gerrit-Migration
Summary: git cl upload adds reviewers and CCs one-by-one (was: Gerrit sending multiple emails for CC )
It doesn't appear that Gerrit is doing anything different than it ever did. What we're seeing is the impact of how chromium's upload script works. It adds reviewers and CCs one-by-one. When there are dozens of CCs this will take several minutes and the change owner will receive dozens of emails.

https://chromium.googlesource.com/chromium/tools/depot_tools/+/a1bab27a2545105f08d5cd7f1d5c9bae643315d2/git_cl.py#3018

https://chromium.googlesource.com/chromium/tools/depot_tools/+/a1bab27a2545105f08d5cd7f1d5c9bae643315d2/gerrit_util.py#673

Gerrit has long supported adding reviewers via git push options. Since July 2016 the Gerrit REST API has also supported adding reviewers in a single batch through the "Set Review" endpoint:

https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#set-review

I recommend reimplementing gerrit_util.AddReviewers in terms of gerrit_util.SetReview (or at least using the same REST endpoint).
Components: Infra>Codereview>Gerrit
Labels: -Proj=Gerrit-Migration Proj-Gerrit-Migration
Mergedinto: 764045
Status: Duplicate (was: New)

Sign in to add a comment