Disabling email on trivial rebase

119 views
Skip to first unread message

Øyvind Harboe

unread,
Jan 22, 2015, 1:01:12 PM1/22/15
to repo-d...@googlegroups.com
Is there a way to disable all email notification on a trivial rebase/comment only change?

Reducing email notification is one of the most requested configuration changes we have for our Gerrit deployment.

We're running Gerrit 2.9 and intend to update to 2.10 soon after it is released.

Thanks!

Øyvind

Edwin Kempin

unread,
Jan 23, 2015, 3:57:52 AM1/23/15
to Øyvind Harboe, Repo and Gerrit Discussion
2015-01-22 19:01 GMT+01:00 Øyvind Harboe <oyvind...@gmail.com>:
Is there a way to disable all email notification on a trivial rebase/comment only change?
No, such an option does not exist yet.
 

Reducing email notification is one of the most requested configuration changes we have for our Gerrit deployment.

We're running Gerrit 2.9 and intend to update to 2.10 soon after it is released.

Thanks!

Øyvind

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Øyvind Harboe

unread,
Jan 23, 2015, 4:05:54 AM1/23/15
to repo-d...@googlegroups.com, oyvind...@gmail.com

On Friday, January 23, 2015 at 9:57:52 AM UTC+1, Edwin Kempin wrote:


2015-01-22 19:01 GMT+01:00 Øyvind Harboe <oyvind...@gmail.com>:
Is there a way to disable all email notification on a trivial rebase/comment only change?
No, such an option does not exist yet.

Am I correct in concluding from what you write that you think this is a good idea and that formulating a patch would make sense?
 

Edwin Kempin

unread,
Jan 23, 2015, 4:15:10 AM1/23/15
to Øyvind Harboe, Repo and Gerrit Discussion
2015-01-23 10:05 GMT+01:00 Øyvind Harboe <oyvind...@gmail.com>:

On Friday, January 23, 2015 at 9:57:52 AM UTC+1, Edwin Kempin wrote:


2015-01-22 19:01 GMT+01:00 Øyvind Harboe <oyvind...@gmail.com>:
Is there a way to disable all email notification on a trivial rebase/comment only change?
No, such an option does not exist yet.

Am I correct in concluding from what you write that you think this is a good idea and that formulating a patch would make sense?
Yes, this would be a nice feature!

Øyvind Harboe

unread,
Jan 23, 2015, 4:19:06 AM1/23/15
to Edwin Kempin, Repo and Gerrit Discussion
On Fri, Jan 23, 2015 at 10:15 AM, Edwin Kempin <edwin....@gmail.com> wrote:


2015-01-23 10:05 GMT+01:00 Øyvind Harboe <oyvind...@gmail.com>:

On Friday, January 23, 2015 at 9:57:52 AM UTC+1, Edwin Kempin wrote:


2015-01-22 19:01 GMT+01:00 Øyvind Harboe <oyvind...@gmail.com>:
Is there a way to disable all email notification on a trivial rebase/comment only change?
No, such an option does not exist yet.

Am I correct in concluding from what you write that you think this is a good idea and that formulating a patch would make sense?
Yes, this would be a nice feature!

I'll wait until we've upgraded to Gerrit 2.10 and when the dust has settled, I'll dabble a bit in this to see if I have any luck.

2.10 has some a features where Jenkins can know if a patchset is a trivial rebase and skip builds. This will massively improve throughput on Jenkins for us. I suspect that that infrastructure will come in handy when trying to implement no notification on a trivial rebase.
 
 
 
 

Reducing email notification is one of the most requested configuration changes we have for our Gerrit deployment.

We're running Gerrit 2.9 and intend to update to 2.10 soon after it is released.

Thanks!

Øyvind

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.




--
Øyvind Harboe

Øyvind Harboe

unread,
Jan 28, 2015, 3:19:34 PM1/28/15
to repo-d...@googlegroups.com, oyvind...@gmail.com


On Friday, January 23, 2015 at 10:15:10 AM UTC+1, Edwin Kempin wrote:


2015-01-23 10:05 GMT+01:00 Øyvind Harboe <oyvind...@gmail.com>:

On Friday, January 23, 2015 at 9:57:52 AM UTC+1, Edwin Kempin wrote:


2015-01-22 19:01 GMT+01:00 Øyvind Harboe <oyvind...@gmail.com>:
Is there a way to disable all email notification on a trivial rebase/comment only change?
No, such an option does not exist yet.

Am I correct in concluding from what you write that you think this is a good idea and that formulating a patch would make sense?
Yes, this would be a nice feature!

The change below to Gerrit 2.10 seems to have done the trick from my testing on my local setup. I'll test it out after we've upgraded to Gerrit 2.10.

I don't have a contributors agreement sorted out, so I can't upload it as a Gerrit review yet. I'm not sure what else there's to it. Is there any reason to send out emails upon a trivial rebase? If not, then a configuration option is an unnecessary complication.


git show -w 499e002e7375c2c5211b
commit 499e002e7375c2c5211b49e3871cef3deaa4bd6a
Author: Øyvind Harboe
Date:   Wed Jan 28 21:07:30 2015 +0100

    notification: no longer sends out email on notification on trivial rebase
   
    Change-Id: I2726456c6e1e3b22274ad253de01578a6a9ebdb0

diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/git/ReceiveCom
index cedf11a..8c034aa 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/git/ReceiveCommits.ja
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/git/ReceiveCommits.ja
@@ -2093,8 +2093,16 @@ public class ReceiveCommits {
           .addChange(change)
           .reindex()
           .runAsync();
-      workQueue.getDefaultQueue()
-          .submit(requestScopePropagator.wrap(new Runnable() {
+
+      /* Reduce noise by not sending out emails about trivial rebases */
+      RevCommit priorCommit = revisions.inverse().get(priorPatchSet);
+      ChangeKind changeKind = changeKindCache.getChangeKind(
+          projectControl.getProjectState(), repo, priorCommit, newCommit);
+
+      if (changeKind != ChangeKind.TRIVIAL_REBASE)
+      {
+        workQueue.getDefaultQueue().submit(
+            requestScopePropagator.wrap(new Runnable() {
               @Override
               public void run() {
                 try {
@@ -2107,7 +2115,8 @@ public class ReceiveCommits {
                   cm.addExtraCC(recipients.getCcOnly());
                   cm.send();
                 } catch (Exception e) {
-            log.error("Cannot send email for new patch set " + newPatchSet.getI
+                  log.error("Cannot send email for new patch set "
+                      + newPatchSet.getId(), e);
                 }
                 if (mergedIntoRef != null) {
                   sendMergedEmail(ReplaceRequest.this);
@@ -2119,6 +2128,7 @@ public class ReceiveCommits {
                 return "send-email newpatchset";
               }
             }));
+      }
       f.checkedGet();


Dave Borowitz

unread,
Jan 28, 2015, 4:50:47 PM1/28/15
to Øyvind Harboe, repo-discuss
On Wed, Jan 28, 2015 at 12:19 PM, Øyvind Harboe <oyvind...@gmail.com> wrote:


On Friday, January 23, 2015 at 10:15:10 AM UTC+1, Edwin Kempin wrote:


2015-01-23 10:05 GMT+01:00 Øyvind Harboe <oyvind...@gmail.com>:

On Friday, January 23, 2015 at 9:57:52 AM UTC+1, Edwin Kempin wrote:


2015-01-22 19:01 GMT+01:00 Øyvind Harboe <oyvind...@gmail.com>:
Is there a way to disable all email notification on a trivial rebase/comment only change?
No, such an option does not exist yet.

Am I correct in concluding from what you write that you think this is a good idea and that formulating a patch would make sense?
Yes, this would be a nice feature!

The change below to Gerrit 2.10 seems to have done the trick from my testing on my local setup. I'll test it out after we've upgraded to Gerrit 2.10.

I don't have a contributors agreement sorted out, so I can't upload it as a Gerrit review yet. I'm not sure what else there's to it. Is there any reason to send out emails upon a trivial rebase? If not, then a configuration option is an unnecessary complication.

We would love to have your contribution, but unfortunately  we simply cannot accept this until you've signed a CLA. Sending it in an email instead of through the Gerrit interface does not make it any more acceptable.
 

Øyvind Harboe

unread,
Jan 28, 2015, 5:07:15 PM1/28/15
to Dave Borowitz, repo-discuss

We would love to have your contribution, but unfortunately  we simply cannot accept this until you've signed a CLA. Sending it in an email instead of through the Gerrit interface does not make it any more acceptable.

Of course.

I've contributed to other open source projects where I've signed copyright assignment(FSF last time for eCos), so it's not a problem, it just takes a bit of time.

Meanwhile, if you have some pointers to me w.r.t. what more I can do to improve the patch other than test it more that would be nice. I'll study the contributor documentation and make sure that I get the formatting and whatnot right.

Thanks!


--
Øyvind Harboe

Øyvind Harboe

unread,
Feb 10, 2015, 1:28:25 PM2/10/15
to repo-d...@googlegroups.com
Proposed change to implement no email on trivial rebase:

https://gerrit-review.googlesource.com/#/c/64403/

Reply all
Reply to author
Forward
0 new messages