My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 155: Clear approvals after replace
  Back to list
Status:  WontFix
Owner:  code-rev...@gtempaccount.com
Closed:  Sep 2009


Sign in to add a comment
 
Reported by code-rev...@gtempaccount.com, Sep 24, 2009
Reported by Eric Tsai <erictsai@erictsai.tw> on Wed Apr 29 02:27:30 PDT 2009
Source: JIRA GERRIT-155
Affected Version: 2.0.10

Since the content of patch sets can be much different , previous scores should
be cleared if a change has been replaced.
This can avoid come malicious change (previous upload gets +1 Verified and +2
Code Review, then replace it with problematic code then been merged by a
carelessness submitter).
Sep 24, 2009
#1 code-rev...@gtempaccount.com
Comment by Shawn Pearce <sop@google.com> on Wed Apr 29 07:52:50 PDT 2009

This is already done, isn't it?

Check Recieve.java.  Upon receiving a new patch set Gerrit loops through the
existing ChangeApproval records and:

 - If the approval is a negative score, leaves it alone.  Thus Verified -1 or
Code Review -1 or -2 stay.

 - If the approval was made by the patch set uploader, leaves it alone.  The
assumption is, the patch set uploader has previously approved this change, and
is now uploading a replacement.  They probably still feel the same way about
that patch set, so why should we erase their own approval bits?

 - Otherwise, clear the approval (set to 0).

The intent is, if someone has previously blocked this change by a negative
vote, it stays blocked.  If someone had previously approved the change, the
approval is removed.  But if you approved it yourself (e.g. self-verify) its
OK to keep it self-approved.
Sep 24, 2009
#2 code-rev...@gtempaccount.com
Comment by Eric Tsai <erictsai@erictsai.tw> on Wed Apr 29 09:28:08 PDT 2009

Oh, sorry, I always do self-verify during my testing so I didn't discover this.
Thanks for your explanation.
Sep 24, 2009
#3 code-rev...@gtempaccount.com
Update by Shawn Pearce <sop@google.com> on Wed Apr 29 09:55:28 PDT 2009
Status: WontFix
Sign in to add a comment

Powered by Google Project Hosting