Merge "Merge branch 'stable-2.16' into stable-3.0" into stable-3.0

This commit is contained in:
David Pursehouse
2019-11-13 16:07:59 +00:00
committed by Gerrit Code Review
4 changed files with 4 additions and 13 deletions

View File

@@ -16,7 +16,6 @@ package com.google.gerrit.server.git.validators;
import com.google.gerrit.extensions.annotations.ExtensionPoint; import com.google.gerrit.extensions.annotations.ExtensionPoint;
import com.google.gerrit.reviewdb.client.Branch; import com.google.gerrit.reviewdb.client.Branch;
import com.google.gerrit.reviewdb.client.Change;
import com.google.gerrit.reviewdb.client.PatchSet; import com.google.gerrit.reviewdb.client.PatchSet;
import com.google.gerrit.server.IdentifiedUser; import com.google.gerrit.server.IdentifiedUser;
import com.google.gerrit.server.git.CodeReviewCommit; import com.google.gerrit.server.git.CodeReviewCommit;
@@ -37,7 +36,6 @@ public interface MergeValidationListener {
* @param commit commit details * @param commit commit details
* @param destProject the destination project * @param destProject the destination project
* @param destBranch the destination branch * @param destBranch the destination branch
* @param changeId the change ID
* @param patchSetId the patch set ID * @param patchSetId the patch set ID
* @param caller the user who initiated the merge request * @param caller the user who initiated the merge request
* @throws MergeValidationException if the commit fails to validate * @throws MergeValidationException if the commit fails to validate
@@ -47,7 +45,6 @@ public interface MergeValidationListener {
CodeReviewCommit commit, CodeReviewCommit commit,
ProjectState destProject, ProjectState destProject,
Branch.NameKey destBranch, Branch.NameKey destBranch,
Change.Id changeId,
PatchSet.Id patchSetId, PatchSet.Id patchSetId,
IdentifiedUser caller) IdentifiedUser caller)
throws MergeValidationException; throws MergeValidationException;

View File

@@ -24,7 +24,6 @@ import com.google.gerrit.extensions.registration.Extension;
import com.google.gerrit.extensions.restapi.AuthException; import com.google.gerrit.extensions.restapi.AuthException;
import com.google.gerrit.reviewdb.client.Account; import com.google.gerrit.reviewdb.client.Account;
import com.google.gerrit.reviewdb.client.Branch; import com.google.gerrit.reviewdb.client.Branch;
import com.google.gerrit.reviewdb.client.Change;
import com.google.gerrit.reviewdb.client.PatchSet; import com.google.gerrit.reviewdb.client.PatchSet;
import com.google.gerrit.reviewdb.client.Project; import com.google.gerrit.reviewdb.client.Project;
import com.google.gerrit.reviewdb.client.RefNames; import com.google.gerrit.reviewdb.client.RefNames;
@@ -82,7 +81,6 @@ public class MergeValidators {
CodeReviewCommit commit, CodeReviewCommit commit,
ProjectState destProject, ProjectState destProject,
Branch.NameKey destBranch, Branch.NameKey destBranch,
Change.Id changeId,
PatchSet.Id patchSetId, PatchSet.Id patchSetId,
IdentifiedUser caller) IdentifiedUser caller)
throws MergeValidationException { throws MergeValidationException {
@@ -94,7 +92,7 @@ public class MergeValidators {
groupValidatorFactory.create()); groupValidatorFactory.create());
for (MergeValidationListener validator : validators) { for (MergeValidationListener validator : validators) {
validator.onPreMerge(repo, commit, destProject, destBranch, changeId, patchSetId, caller); validator.onPreMerge(repo, commit, destProject, destBranch, patchSetId, caller);
} }
} }
@@ -159,7 +157,6 @@ public class MergeValidators {
final CodeReviewCommit commit, final CodeReviewCommit commit,
final ProjectState destProject, final ProjectState destProject,
final Branch.NameKey destBranch, final Branch.NameKey destBranch,
final Change.Id changeId,
final PatchSet.Id patchSetId, final PatchSet.Id patchSetId,
IdentifiedUser caller) IdentifiedUser caller)
throws MergeValidationException { throws MergeValidationException {
@@ -255,12 +252,11 @@ public class MergeValidators {
CodeReviewCommit commit, CodeReviewCommit commit,
ProjectState destProject, ProjectState destProject,
Branch.NameKey destBranch, Branch.NameKey destBranch,
Change.Id changeId,
PatchSet.Id patchSetId, PatchSet.Id patchSetId,
IdentifiedUser caller) IdentifiedUser caller)
throws MergeValidationException { throws MergeValidationException {
mergeValidationListeners.runEach( mergeValidationListeners.runEach(
l -> l.onPreMerge(repo, commit, destProject, destBranch, changeId, patchSetId, caller), l -> l.onPreMerge(repo, commit, destProject, destBranch, patchSetId, caller),
MergeValidationException.class); MergeValidationException.class);
} }
} }
@@ -290,7 +286,6 @@ public class MergeValidators {
CodeReviewCommit commit, CodeReviewCommit commit,
ProjectState destProject, ProjectState destProject,
Branch.NameKey destBranch, Branch.NameKey destBranch,
Change.Id changeId,
PatchSet.Id patchSetId, PatchSet.Id patchSetId,
IdentifiedUser caller) IdentifiedUser caller)
throws MergeValidationException { throws MergeValidationException {
@@ -342,7 +337,6 @@ public class MergeValidators {
CodeReviewCommit commit, CodeReviewCommit commit,
ProjectState destProject, ProjectState destProject,
Branch.NameKey destBranch, Branch.NameKey destBranch,
Change.Id changeId,
PatchSet.Id patchSetId, PatchSet.Id patchSetId,
IdentifiedUser caller) IdentifiedUser caller)
throws MergeValidationException { throws MergeValidationException {

View File

@@ -836,7 +836,7 @@ public class MergeOp implements AutoCloseable {
MergeValidators mergeValidators = mergeValidatorsFactory.create(); MergeValidators mergeValidators = mergeValidatorsFactory.create();
try { try {
mergeValidators.validatePreMerge( mergeValidators.validatePreMerge(
or.repo, commit, or.project, destBranch, changeId, ps.getId(), caller); or.repo, commit, or.project, destBranch, ps.getId(), caller);
} catch (MergeValidationException mve) { } catch (MergeValidationException mve) {
commitStatus.problem(changeId, mve.getMessage()); commitStatus.problem(changeId, mve.getMessage());
continue; continue;