Merge branch 'stable-2.11'

* stable-2.11:
  Update buck to ba9f239f69287a553ca93af76a27484d83693563
  Fix Incorrect owner group matching behaviour for creating projects
  Remove unused account constants properties
  Add username to stream-events queue entries
  Set correct revision of cookbook plugin
  Revert "Prevent usage of not initialized IndexCollection"
  Handle commit validation errors when creating new change via REST
  Handle commit validation errors when publishing change edit
  ChangeEditUtil.publish: Remove declaration of unthrown exception
  Prevent usage of not initialized IndexCollection

The changes:

  Handle commit validation errors when creating new change via REST
  Handle commit validation errors when publishing change edit

are reverted by this merge due to conflicts with refactored code
on master.  The fixes will be reapplied in follow-up commits

Change-Id: I9db2ec48c0f9cde8f176976f6caf4aa0bbe66b72
This commit is contained in:
David Pursehouse
2015-11-09 12:45:53 -08:00
4 changed files with 62 additions and 4 deletions

View File

@@ -0,0 +1,56 @@
// Copyright (C) 2015 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.acceptance.ssh;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assert_;
import com.google.gerrit.acceptance.AbstractDaemonTest;
import com.google.gerrit.reviewdb.client.Project;
import com.google.gerrit.server.project.ProjectState;
import org.junit.Test;
public class CreateProjectIT extends AbstractDaemonTest {
@Test
public void withValidGroupName() throws Exception {
String newGroupName = "newGroup";
adminSession.put("/groups/" + newGroupName);
String newProjectName = "newProject";
sshSession.exec("gerrit create-project --branch master --owner "
+ newGroupName + " " + newProjectName);
assert_().withFailureMessage(sshSession.getError())
.that(sshSession.hasError()).isFalse();
ProjectState projectState =
projectCache.get(new Project.NameKey(newProjectName));
assertThat(projectState).isNotNull();
}
@Test
public void withInvalidGroupName() throws Exception {
String newGroupName = "newGroup";
adminSession.put("/groups/" + newGroupName);
String wrongGroupName = "newG";
String newProjectName = "newProject";
sshSession.exec("gerrit create-project --branch master --owner "
+ wrongGroupName + " " + newProjectName);
assert_().withFailureMessage(sshSession.getError())
.that(sshSession.hasError()).isTrue();
ProjectState projectState =
projectCache.get(new Project.NameKey(newProjectName));
assertThat(projectState).isNull();
}
}

View File

@@ -32,9 +32,6 @@ myMenuName = Name
myMenuUrl = URL
myMenuReset = Reset
changeScreenOldUi = Old Screen
changeScreenNewUi = New Screen
tabAccountSummary = Profile
tabAgreements = Agreements
tabContactInformation = Contact Information

View File

@@ -43,7 +43,7 @@ public class AccountGroupUUIDHandler extends OptionHandler<AccountGroup.UUID> {
public final int parseArguments(final Parameters params)
throws CmdLineException {
final String n = params.getParameter(0);
final GroupReference group = GroupBackends.findBestSuggestion(groupBackend, n);
GroupReference group = GroupBackends.findExactSuggestion(groupBackend, n);
if (group == null) {
throw new CmdLineException(owner, "Group \"" + n + "\" does not exist");
}

View File

@@ -95,6 +95,11 @@ final class StreamEvents extends BaseCommand {
public void cancel() {
onExit(0);
}
@Override
public String toString() {
return "Stream Events (" + currentUser.getAccount().getUserName() + ")";
}
};
/** True if {@link #droppedOutputEvent} needs to be sent. */