Merge branch 'stable-3.0' into stable-3.1

* stable-3.0:
  Revert "MergeValidationListener: Include the change Id in onPreMerge"

Change-Id: I75d6103e25ac9254ee3a99878a2775c63d55c355
This commit is contained in:
David Pursehouse
2019-11-13 00:53:06 -08:00
4 changed files with 4 additions and 14 deletions

View File

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

View File

@@ -19,7 +19,6 @@ import com.google.common.collect.ImmutableList;
import com.google.common.flogger.FluentLogger;
import com.google.gerrit.entities.Account;
import com.google.gerrit.entities.BranchNameKey;
import com.google.gerrit.entities.Change;
import com.google.gerrit.entities.PatchSet;
import com.google.gerrit.entities.Project;
import com.google.gerrit.entities.RefNames;
@@ -82,7 +81,6 @@ public class MergeValidators {
CodeReviewCommit commit,
ProjectState destProject,
BranchNameKey destBranch,
Change.Id changeId,
PatchSet.Id patchSetId,
IdentifiedUser caller)
throws MergeValidationException {
@@ -94,7 +92,7 @@ public class MergeValidators {
groupValidatorFactory.create());
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 ProjectState destProject,
final BranchNameKey destBranch,
final Change.Id changeId,
final PatchSet.Id patchSetId,
IdentifiedUser caller)
throws MergeValidationException {
@@ -255,12 +252,11 @@ public class MergeValidators {
CodeReviewCommit commit,
ProjectState destProject,
BranchNameKey destBranch,
Change.Id changeId,
PatchSet.Id patchSetId,
IdentifiedUser caller)
throws MergeValidationException {
mergeValidationListeners.runEach(
l -> l.onPreMerge(repo, commit, destProject, destBranch, changeId, patchSetId, caller),
l -> l.onPreMerge(repo, commit, destProject, destBranch, patchSetId, caller),
MergeValidationException.class);
}
}
@@ -290,7 +286,6 @@ public class MergeValidators {
CodeReviewCommit commit,
ProjectState destProject,
BranchNameKey destBranch,
Change.Id changeId,
PatchSet.Id patchSetId,
IdentifiedUser caller)
throws MergeValidationException {
@@ -341,7 +336,6 @@ public class MergeValidators {
CodeReviewCommit commit,
ProjectState destProject,
BranchNameKey destBranch,
Change.Id changeId,
PatchSet.Id patchSetId,
IdentifiedUser caller)
throws MergeValidationException {

View File

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