Support disallowing voting on labels after submission

For common labels like Code-Review and Verified, it still makes sense
to allow voting after submission, so keep the default as true. For
others, such as a label to trigger CI, it doesn't.

Bug: Issue 4942
Change-Id: I01a6281c11ee13bec9a6c8a2568b18ddd4eaccf4
This commit is contained in:
Dave Borowitz
2016-11-15 17:02:16 -08:00
parent f1790ce471
commit 20d71e58ad
6 changed files with 94 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ import java.util.List;
import java.util.Map;
public class LabelType {
public static final boolean DEF_ALLOW_POST_SUBMIT = true;
public static final boolean DEF_CAN_OVERRIDE = true;
public static final boolean DEF_COPY_ALL_SCORES_IF_NO_CHANGE = true;
public static final boolean DEF_COPY_ALL_SCORES_IF_NO_CODE_CHANGE = false;
@@ -104,6 +105,7 @@ public class LabelType {
protected boolean copyAllScoresOnTrivialRebase;
protected boolean copyAllScoresIfNoCodeChange;
protected boolean copyAllScoresIfNoChange;
protected boolean allowPostSubmit;
protected short defaultValue;
protected List<LabelValue> values;
@@ -144,6 +146,7 @@ public class LabelType {
DEF_COPY_ALL_SCORES_ON_MERGE_FIRST_PARENT_UPDATE);
setCopyMaxScore(DEF_COPY_MAX_SCORE);
setCopyMinScore(DEF_COPY_MIN_SCORE);
setAllowPostSubmit(DEF_ALLOW_POST_SUBMIT);
}
public String getName() {
@@ -174,6 +177,14 @@ public class LabelType {
this.canOverride = canOverride;
}
public boolean allowPostSubmit() {
return allowPostSubmit;
}
public void setAllowPostSubmit(boolean allowPostSubmit) {
this.allowPostSubmit = allowPostSubmit;
}
public void setRefPatterns(List<String> refPatterns) {
this.refPatterns = refPatterns;
}