Limit the number of comments per change (to 5000 by default)

Also refactor the robot comment size check to be in line with the size
check for human comments.

Change-Id: If24adc10f5f16cd8894bf246078f0e6c992cdafa
This commit is contained in:
Joerg Zieren
2020-01-02 10:18:14 +01:00
parent b91db6bcdd
commit 7cac5d14a9
23 changed files with 555 additions and 266 deletions

View File

@@ -128,7 +128,8 @@ import com.google.gerrit.server.git.ReceivePackInitializer;
import com.google.gerrit.server.git.TagCache;
import com.google.gerrit.server.git.TransferConfig;
import com.google.gerrit.server.git.receive.ReceiveCommitsModule;
import com.google.gerrit.server.git.validators.CommentLimitsValidator;
import com.google.gerrit.server.git.validators.CommentCountValidator;
import com.google.gerrit.server.git.validators.CommentSizeValidator;
import com.google.gerrit.server.git.validators.CommitValidationListener;
import com.google.gerrit.server.git.validators.MergeValidationListener;
import com.google.gerrit.server.git.validators.MergeValidators;
@@ -410,8 +411,11 @@ public class GerritGlobalModule extends FactoryModule {
DynamicSet.setOf(binder(), UploadValidationListener.class);
bind(CommentValidator.class)
.annotatedWith(Exports.named(CommentLimitsValidator.class.getSimpleName()))
.to(CommentLimitsValidator.class);
.annotatedWith(Exports.named(CommentCountValidator.class.getSimpleName()))
.to(CommentCountValidator.class);
bind(CommentValidator.class)
.annotatedWith(Exports.named(CommentSizeValidator.class.getSimpleName()))
.to(CommentSizeValidator.class);
DynamicMap.mapOf(binder(), DynamicOptions.DynamicBean.class);
DynamicMap.mapOf(binder(), ChangeQueryBuilder.ChangeOperatorFactory.class);