diff options
author | David Pursehouse <david.pursehouse@sonymobile.com> | 2015-11-09 12:45:53 -0800 |
---|---|---|
committer | David Pursehouse <david.pursehouse@sonymobile.com> | 2015-11-09 12:47:15 -0800 |
commit | f80ab0ad5b638eb2d12e61ce6ac5c50e79808d31 (patch) | |
tree | e349e061a45eb774b9e71857b8a54d8d7a6ea1d0 | |
parent | dec158ff0506ee0ccd1836a7b0be451a7ace4c19 (diff) | |
parent | 4d97777677abccbd86e4023abd01e635984f70ee (diff) |
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
4 files changed, 62 insertions, 4 deletions
diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/ssh/CreateProjectIT.java b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/ssh/CreateProjectIT.java new file mode 100644 index 0000000000..a7791368ff --- /dev/null +++ b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/ssh/CreateProjectIT.java @@ -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(); + } +} diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/account/AccountConstants.properties b/gerrit-gwtui/src/main/java/com/google/gerrit/client/account/AccountConstants.properties index 4580aead57..09444482eb 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/account/AccountConstants.properties +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/account/AccountConstants.properties @@ -32,9 +32,6 @@ myMenuName = Name myMenuUrl = URL myMenuReset = Reset -changeScreenOldUi = Old Screen -changeScreenNewUi = New Screen - tabAccountSummary = Profile tabAgreements = Agreements tabContactInformation = Contact Information diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/args4j/AccountGroupUUIDHandler.java b/gerrit-server/src/main/java/com/google/gerrit/server/args4j/AccountGroupUUIDHandler.java index 406ca58b6d..674fe086c4 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/args4j/AccountGroupUUIDHandler.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/args4j/AccountGroupUUIDHandler.java @@ -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"); } diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/StreamEvents.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/StreamEvents.java index 3f7914edd9..379f1b92b9 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/StreamEvents.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/StreamEvents.java @@ -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. */ |