Merge "Fix for..of loop inside gr-reply-dialog"
diff --git a/Documentation/intro-quick.txt b/Documentation/intro-quick.txt
index c6dad5b..a827bbd 100644
--- a/Documentation/intro-quick.txt
+++ b/Documentation/intro-quick.txt
@@ -1,8 +1,7 @@
= Gerrit Code Review - A Quick Introduction
Gerrit is a web-based code review tool built on top of the git version
-control system, but if you've got as far as reading this guide then
-you probably already know that. The purpose of this introduction is to
+control system. The purpose of this introduction is to
allow you to answer the question, is Gerrit the right tool for me?
Will it fit in my work flow and in my organization?
diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/change/AbandonIT.java b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/change/AbandonIT.java
new file mode 100644
index 0000000..cb9d705
--- /dev/null
+++ b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/change/AbandonIT.java
@@ -0,0 +1,203 @@
+// Copyright (C) 2017 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.api.change;
+
+import static com.google.common.truth.Truth.assertThat;
+import static com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS;
+import static java.util.concurrent.TimeUnit.HOURS;
+import static java.util.concurrent.TimeUnit.SECONDS;
+import static java.util.stream.Collectors.toList;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Iterables;
+import com.google.gerrit.acceptance.AbstractDaemonTest;
+import com.google.gerrit.acceptance.GerritConfig;
+import com.google.gerrit.acceptance.PushOneCommit;
+import com.google.gerrit.common.data.Permission;
+import com.google.gerrit.extensions.client.ChangeStatus;
+import com.google.gerrit.extensions.common.ChangeInfo;
+import com.google.gerrit.extensions.restapi.AuthException;
+import com.google.gerrit.extensions.restapi.ResourceConflictException;
+import com.google.gerrit.reviewdb.client.Project;
+import com.google.gerrit.server.CurrentUser;
+import com.google.gerrit.server.change.AbandonUtil;
+import com.google.gerrit.server.project.ChangeControl;
+import com.google.gerrit.server.query.change.ChangeData;
+import com.google.gerrit.testutil.TestTimeUtil;
+import com.google.inject.Inject;
+import java.util.List;
+import org.eclipse.jgit.internal.storage.dfs.InMemoryRepository;
+import org.eclipse.jgit.junit.TestRepository;
+import org.junit.Test;
+
+public class AbandonIT extends AbstractDaemonTest {
+ @Inject private AbandonUtil abandonUtil;
+
+ @Test
+ public void abandon() throws Exception {
+ PushOneCommit.Result r = createChange();
+ String changeId = r.getChangeId();
+ assertThat(info(changeId).status).isEqualTo(ChangeStatus.NEW);
+ gApi.changes().id(changeId).abandon();
+ ChangeInfo info = get(changeId);
+ assertThat(info.status).isEqualTo(ChangeStatus.ABANDONED);
+ assertThat(Iterables.getLast(info.messages).message.toLowerCase()).contains("abandoned");
+
+ exception.expect(ResourceConflictException.class);
+ exception.expectMessage("change is abandoned");
+ gApi.changes().id(changeId).abandon();
+ }
+
+ @Test
+ public void batchAbandon() throws Exception {
+ CurrentUser user = atrScope.get().getUser();
+ PushOneCommit.Result a = createChange();
+ List<ChangeControl> controlA = changeFinder.find(a.getChangeId(), user);
+ assertThat(controlA).hasSize(1);
+ PushOneCommit.Result b = createChange();
+ List<ChangeControl> controlB = changeFinder.find(b.getChangeId(), user);
+ assertThat(controlB).hasSize(1);
+ List<ChangeControl> list = ImmutableList.of(controlA.get(0), controlB.get(0));
+ changeAbandoner.batchAbandon(
+ batchUpdateFactory, controlA.get(0).getProject().getNameKey(), user, list, "deadbeef");
+
+ ChangeInfo info = get(a.getChangeId());
+ assertThat(info.status).isEqualTo(ChangeStatus.ABANDONED);
+ assertThat(Iterables.getLast(info.messages).message.toLowerCase()).contains("abandoned");
+ assertThat(Iterables.getLast(info.messages).message.toLowerCase()).contains("deadbeef");
+
+ info = get(b.getChangeId());
+ assertThat(info.status).isEqualTo(ChangeStatus.ABANDONED);
+ assertThat(Iterables.getLast(info.messages).message.toLowerCase()).contains("abandoned");
+ assertThat(Iterables.getLast(info.messages).message.toLowerCase()).contains("deadbeef");
+ }
+
+ @Test
+ public void batchAbandonChangeProject() throws Exception {
+ String project1Name = name("Project1");
+ String project2Name = name("Project2");
+ gApi.projects().create(project1Name);
+ gApi.projects().create(project2Name);
+ TestRepository<InMemoryRepository> project1 = cloneProject(new Project.NameKey(project1Name));
+ TestRepository<InMemoryRepository> project2 = cloneProject(new Project.NameKey(project2Name));
+
+ CurrentUser user = atrScope.get().getUser();
+ PushOneCommit.Result a = createChange(project1, "master", "x", "x", "x", "");
+ List<ChangeControl> controlA = changeFinder.find(a.getChangeId(), user);
+ assertThat(controlA).hasSize(1);
+ PushOneCommit.Result b = createChange(project2, "master", "x", "x", "x", "");
+ List<ChangeControl> controlB = changeFinder.find(b.getChangeId(), user);
+ assertThat(controlB).hasSize(1);
+ List<ChangeControl> list = ImmutableList.of(controlA.get(0), controlB.get(0));
+ exception.expect(ResourceConflictException.class);
+ exception.expectMessage(
+ String.format("Project name \"%s\" doesn't match \"%s\"", project2Name, project1Name));
+ changeAbandoner.batchAbandon(batchUpdateFactory, new Project.NameKey(project1Name), user, list);
+ }
+
+ @Test
+ public void abandonDraft() throws Exception {
+ PushOneCommit.Result r = createDraftChange();
+ String changeId = r.getChangeId();
+ assertThat(info(changeId).status).isEqualTo(ChangeStatus.DRAFT);
+
+ exception.expect(ResourceConflictException.class);
+ exception.expectMessage("draft changes cannot be abandoned");
+ gApi.changes().id(changeId).abandon();
+ }
+
+ @Test
+ @GerritConfig(name = "changeCleanup.abandonAfter", value = "1w")
+ public void abandonInactiveOpenChanges() throws Exception {
+ TestTimeUtil.resetWithClockStep(1, SECONDS);
+
+ // create 2 changes which will be abandoned ...
+ int id1 = createChange().getChange().getId().get();
+ int id2 = createChange().getChange().getId().get();
+
+ // ... because they are older than 1 week
+ TestTimeUtil.incrementClock(7 * 24, HOURS);
+
+ // create 1 new change that will not be abandoned
+ ChangeData cd = createChange().getChange();
+ int id3 = cd.getId().get();
+
+ assertThat(toChangeNumbers(query("is:open"))).containsExactly(id1, id2, id3);
+ assertThat(query("is:abandoned")).isEmpty();
+
+ abandonUtil.abandonInactiveOpenChanges(batchUpdateFactory);
+ assertThat(toChangeNumbers(query("is:open"))).containsExactly(id3);
+ assertThat(toChangeNumbers(query("is:abandoned"))).containsExactly(id1, id2);
+ }
+
+ @Test
+ public void abandonNotAllowedWithoutPermission() throws Exception {
+ PushOneCommit.Result r = createChange();
+ String changeId = r.getChangeId();
+ assertThat(info(changeId).status).isEqualTo(ChangeStatus.NEW);
+ setApiUser(user);
+ exception.expect(AuthException.class);
+ exception.expectMessage("abandon not permitted");
+ gApi.changes().id(changeId).abandon();
+ }
+
+ @Test
+ public void abandonAndRestoreAllowedWithPermission() throws Exception {
+ PushOneCommit.Result r = createChange();
+ String changeId = r.getChangeId();
+ assertThat(info(changeId).status).isEqualTo(ChangeStatus.NEW);
+ grant(project, "refs/heads/master", Permission.ABANDON, false, REGISTERED_USERS);
+ setApiUser(user);
+ gApi.changes().id(changeId).abandon();
+ assertThat(info(changeId).status).isEqualTo(ChangeStatus.ABANDONED);
+ gApi.changes().id(changeId).restore();
+ assertThat(info(changeId).status).isEqualTo(ChangeStatus.NEW);
+ }
+
+ @Test
+ public void restore() throws Exception {
+ PushOneCommit.Result r = createChange();
+ String changeId = r.getChangeId();
+ assertThat(info(changeId).status).isEqualTo(ChangeStatus.NEW);
+ gApi.changes().id(changeId).abandon();
+ assertThat(info(changeId).status).isEqualTo(ChangeStatus.ABANDONED);
+
+ gApi.changes().id(changeId).restore();
+ ChangeInfo info = get(changeId);
+ assertThat(info.status).isEqualTo(ChangeStatus.NEW);
+ assertThat(Iterables.getLast(info.messages).message.toLowerCase()).contains("restored");
+
+ exception.expect(ResourceConflictException.class);
+ exception.expectMessage("change is new");
+ gApi.changes().id(changeId).restore();
+ }
+
+ @Test
+ public void restoreNotAllowedWithoutPermission() throws Exception {
+ PushOneCommit.Result r = createChange();
+ String changeId = r.getChangeId();
+ assertThat(info(changeId).status).isEqualTo(ChangeStatus.NEW);
+ gApi.changes().id(changeId).abandon();
+ setApiUser(user);
+ assertThat(info(changeId).status).isEqualTo(ChangeStatus.ABANDONED);
+ exception.expect(AuthException.class);
+ exception.expectMessage("restore not permitted");
+ gApi.changes().id(changeId).restore();
+ }
+
+ private List<Integer> toChangeNumbers(List<ChangeInfo> changes) {
+ return changes.stream().map(i -> i._number).collect(toList());
+ }
+}
diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/change/ChangeIT.java b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/change/ChangeIT.java
index 069f561..dbe4a6c 100644
--- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/change/ChangeIT.java
+++ b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/change/ChangeIT.java
@@ -103,7 +103,6 @@
import com.google.gerrit.reviewdb.client.Project;
import com.google.gerrit.reviewdb.client.RefNames;
import com.google.gerrit.server.ChangeMessagesUtil;
-import com.google.gerrit.server.CurrentUser;
import com.google.gerrit.server.change.ChangeResource;
import com.google.gerrit.server.config.AnonymousCowardNameProvider;
import com.google.gerrit.server.git.ChangeMessageModifier;
@@ -426,134 +425,6 @@
}
@Test
- public void abandon() throws Exception {
- PushOneCommit.Result r = createChange();
- String changeId = r.getChangeId();
- assertThat(info(changeId).status).isEqualTo(ChangeStatus.NEW);
- gApi.changes().id(changeId).abandon();
- ChangeInfo info = get(changeId);
- assertThat(info.status).isEqualTo(ChangeStatus.ABANDONED);
- assertThat(Iterables.getLast(info.messages).message.toLowerCase()).contains("abandoned");
-
- exception.expect(ResourceConflictException.class);
- exception.expectMessage("change is abandoned");
- gApi.changes().id(changeId).abandon();
- }
-
- @Test
- public void batchAbandon() throws Exception {
- CurrentUser user = atrScope.get().getUser();
- PushOneCommit.Result a = createChange();
- List<ChangeControl> controlA = changeFinder.find(a.getChangeId(), user);
- assertThat(controlA).hasSize(1);
- PushOneCommit.Result b = createChange();
- List<ChangeControl> controlB = changeFinder.find(b.getChangeId(), user);
- assertThat(controlB).hasSize(1);
- List<ChangeControl> list = ImmutableList.of(controlA.get(0), controlB.get(0));
- changeAbandoner.batchAbandon(
- batchUpdateFactory, controlA.get(0).getProject().getNameKey(), user, list, "deadbeef");
-
- ChangeInfo info = get(a.getChangeId());
- assertThat(info.status).isEqualTo(ChangeStatus.ABANDONED);
- assertThat(Iterables.getLast(info.messages).message.toLowerCase()).contains("abandoned");
- assertThat(Iterables.getLast(info.messages).message.toLowerCase()).contains("deadbeef");
-
- info = get(b.getChangeId());
- assertThat(info.status).isEqualTo(ChangeStatus.ABANDONED);
- assertThat(Iterables.getLast(info.messages).message.toLowerCase()).contains("abandoned");
- assertThat(Iterables.getLast(info.messages).message.toLowerCase()).contains("deadbeef");
- }
-
- @Test
- public void batchAbandonChangeProject() throws Exception {
- String project1Name = name("Project1");
- String project2Name = name("Project2");
- gApi.projects().create(project1Name);
- gApi.projects().create(project2Name);
- TestRepository<InMemoryRepository> project1 = cloneProject(new Project.NameKey(project1Name));
- TestRepository<InMemoryRepository> project2 = cloneProject(new Project.NameKey(project2Name));
-
- CurrentUser user = atrScope.get().getUser();
- PushOneCommit.Result a = createChange(project1, "master", "x", "x", "x", "");
- List<ChangeControl> controlA = changeFinder.find(a.getChangeId(), user);
- assertThat(controlA).hasSize(1);
- PushOneCommit.Result b = createChange(project2, "master", "x", "x", "x", "");
- List<ChangeControl> controlB = changeFinder.find(b.getChangeId(), user);
- assertThat(controlB).hasSize(1);
- List<ChangeControl> list = ImmutableList.of(controlA.get(0), controlB.get(0));
- exception.expect(ResourceConflictException.class);
- exception.expectMessage(
- String.format("Project name \"%s\" doesn't match \"%s\"", project2Name, project1Name));
- changeAbandoner.batchAbandon(batchUpdateFactory, new Project.NameKey(project1Name), user, list);
- }
-
- @Test
- public void abandonDraft() throws Exception {
- PushOneCommit.Result r = createDraftChange();
- String changeId = r.getChangeId();
- assertThat(info(changeId).status).isEqualTo(ChangeStatus.DRAFT);
-
- exception.expect(ResourceConflictException.class);
- exception.expectMessage("draft changes cannot be abandoned");
- gApi.changes().id(changeId).abandon();
- }
-
- @Test
- public void abandonNotAllowedWithoutPermission() throws Exception {
- PushOneCommit.Result r = createChange();
- String changeId = r.getChangeId();
- assertThat(info(changeId).status).isEqualTo(ChangeStatus.NEW);
- setApiUser(user);
- exception.expect(AuthException.class);
- exception.expectMessage("abandon not permitted");
- gApi.changes().id(changeId).abandon();
- }
-
- @Test
- public void abandonAndRestoreAllowedWithPermission() throws Exception {
- PushOneCommit.Result r = createChange();
- String changeId = r.getChangeId();
- assertThat(info(changeId).status).isEqualTo(ChangeStatus.NEW);
- grant(project, "refs/heads/master", Permission.ABANDON, false, REGISTERED_USERS);
- setApiUser(user);
- gApi.changes().id(changeId).abandon();
- assertThat(info(changeId).status).isEqualTo(ChangeStatus.ABANDONED);
- gApi.changes().id(changeId).restore();
- assertThat(info(changeId).status).isEqualTo(ChangeStatus.NEW);
- }
-
- @Test
- public void restore() throws Exception {
- PushOneCommit.Result r = createChange();
- String changeId = r.getChangeId();
- assertThat(info(changeId).status).isEqualTo(ChangeStatus.NEW);
- gApi.changes().id(changeId).abandon();
- assertThat(info(changeId).status).isEqualTo(ChangeStatus.ABANDONED);
-
- gApi.changes().id(changeId).restore();
- ChangeInfo info = get(changeId);
- assertThat(info.status).isEqualTo(ChangeStatus.NEW);
- assertThat(Iterables.getLast(info.messages).message.toLowerCase()).contains("restored");
-
- exception.expect(ResourceConflictException.class);
- exception.expectMessage("change is new");
- gApi.changes().id(changeId).restore();
- }
-
- @Test
- public void restoreNotAllowedWithoutPermission() throws Exception {
- PushOneCommit.Result r = createChange();
- String changeId = r.getChangeId();
- assertThat(info(changeId).status).isEqualTo(ChangeStatus.NEW);
- gApi.changes().id(changeId).abandon();
- setApiUser(user);
- assertThat(info(changeId).status).isEqualTo(ChangeStatus.ABANDONED);
- exception.expect(AuthException.class);
- exception.expectMessage("restore not permitted");
- gApi.changes().id(changeId).restore();
- }
-
- @Test
public void revert() throws Exception {
PushOneCommit.Result r = createChange();
gApi.changes().id(r.getChangeId()).revision(r.getCommit().name()).review(ReviewInput.approve());
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/CreateProjectScreen.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/CreateProjectScreen.java
index dd46c5c..e6dadaa 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/CreateProjectScreen.java
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/CreateProjectScreen.java
@@ -111,6 +111,14 @@
projectsPopup.initPopup(AdminConstants.I.projects(), PageLinks.ADMIN_PROJECTS);
}
+ @Override
+ public void onShowView() {
+ super.onShowView();
+ if (project != null) {
+ project.setFocus(true);
+ }
+ }
+
private void addCreateProjectPanel() {
final VerticalPanel fp = new VerticalPanel();
fp.setStyleName(Gerrit.RESOURCES.css().createProjectPanel());
diff --git a/gerrit-pgm/src/main/resources/com/google/gerrit/pgm/init/libraries.config b/gerrit-pgm/src/main/resources/com/google/gerrit/pgm/init/libraries.config
index 26ac9d6..5f73bef 100644
--- a/gerrit-pgm/src/main/resources/com/google/gerrit/pgm/init/libraries.config
+++ b/gerrit-pgm/src/main/resources/com/google/gerrit/pgm/init/libraries.config
@@ -13,15 +13,15 @@
# limitations under the License.
[library "mysqlDriver"]
- name = MySQL Connector/J 5.1.41
- url = https://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.41/mysql-connector-java-5.1.41.jar
- sha1 = b0878056f15616989144d6114d36d3942321d0d1
+ name = MySQL Connector/J 5.1.42
+ url = https://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.42/mysql-connector-java-5.1.42.jar
+ sha1 = 80a448a3ec2178b649bb2e3cb3610fab06e11669
remove = mysql-connector-java-.*[.]jar
[library "mariadbDriver"]
- name = MariaDB Connector/J 1.5.9
- url = https://repo1.maven.org/maven2/org/mariadb/jdbc/mariadb-java-client/1.5.9/mariadb-java-client-1.5.9.jar
- sha1 = 75d4d6e4cdb9a551a102e92a14c640768174e214
+ name = MariaDB Connector/J 2.0.1
+ url = https://repo1.maven.org/maven2/org/mariadb/jdbc/mariadb-java-client/2.0.1/mariadb-java-client-2.0.1.jar
+ sha1 = 86958da99eb75eeffd33b77ef4ddb508b45bc6da
remove = mariadb-java-client-.*[.]jar
[library "oracleDriver"]
diff --git a/gerrit-server/src/main/java/com/google/gerrit/common/EventBroker.java b/gerrit-server/src/main/java/com/google/gerrit/common/EventBroker.java
index 96c70c0..3cc7335 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/common/EventBroker.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/common/EventBroker.java
@@ -32,6 +32,7 @@
import com.google.gerrit.server.permissions.PermissionBackend;
import com.google.gerrit.server.permissions.PermissionBackendException;
import com.google.gerrit.server.permissions.ProjectPermission;
+import com.google.gerrit.server.project.NoSuchChangeException;
import com.google.gerrit.server.project.ProjectCache;
import com.google.gerrit.server.project.ProjectControl;
import com.google.gerrit.server.project.ProjectState;
@@ -39,10 +40,13 @@
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.Singleton;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/** Distributes Events to listeners if they are allowed to see them */
@Singleton
public class EventBroker implements EventDispatcher {
+ private static final Logger log = LoggerFactory.getLogger(EventBroker.class);
public static class Module extends LifecycleModule {
@Override
@@ -180,9 +184,15 @@
String ref = refEvent.getRefName();
if (PatchSet.isChangeRef(ref)) {
Change.Id cid = PatchSet.Id.fromRef(ref).getParentKey();
- Change change =
- notesFactory.create(dbProvider.get(), refEvent.getProjectNameKey(), cid).getChange();
- return isVisibleTo(change, user);
+ try {
+ Change change =
+ notesFactory
+ .createChecked(dbProvider.get(), refEvent.getProjectNameKey(), cid)
+ .getChange();
+ return isVisibleTo(change, user);
+ } catch (NoSuchChangeException e) {
+ log.debug("Change {} cannot be found, falling back on ref visibility check", cid.id);
+ }
}
return isVisibleTo(refEvent.getBranchNameKey(), user);
} else if (event instanceof ProjectEvent) {
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/project/ListProjects.java b/gerrit-server/src/main/java/com/google/gerrit/server/project/ListProjects.java
index b4e7380..9e4b42f 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/ListProjects.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/ListProjects.java
@@ -500,7 +500,12 @@
if (ps != null) {
Project.NameKey parent = ps.getProject().getParent();
if (parent != null) {
- parents.add(parent);
+ if (projectCache.get(parent) != null) {
+ parents.add(parent);
+ } else {
+ log.warn(String.format("parent project %s of project %s not found",
+ parent.get(), ps.getProject().getName()));
+ }
}
}
}
diff --git a/plugins/replication b/plugins/replication
index 8fcaee0..db4aecb 160000
--- a/plugins/replication
+++ b/plugins/replication
@@ -1 +1 @@
-Subproject commit 8fcaee07b6d457b3fc6ed44d9e9d441e3cd174ac
+Subproject commit db4aecb2b813e19007b8896a35ac68e794f758a3
diff --git a/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions.js b/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions.js
index 7e53ea2..e901eab 100644
--- a/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions.js
+++ b/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions.js
@@ -48,11 +48,13 @@
ABANDON: 'abandon',
DELETE: '/',
IGNORE: 'ignore',
+ MUTE: 'mute',
PRIVATE: 'private',
PRIVATE_DELETE: 'private.delete',
RESTORE: 'restore',
REVERT: 'revert',
UNIGNORE: 'unignore',
+ UNMUTE: 'unmute',
WIP: 'wip',
};
@@ -225,6 +227,14 @@
},
{
type: ActionType.CHANGE,
+ key: ChangeActions.MUTE,
+ },
+ {
+ type: ActionType.CHANGE,
+ key: ChangeActions.UNMUTE,
+ },
+ {
+ type: ActionType.CHANGE,
key: ChangeActions.PRIVATE,
},
{
diff --git a/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions_test.html b/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions_test.html
index ca562fe..8aa6bab 100644
--- a/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions_test.html
+++ b/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions_test.html
@@ -731,6 +731,85 @@
});
});
+ suite('mute change', () => {
+ setup(done => {
+ sandbox.stub(element, '_fireAction');
+
+ const MuteAction = {
+ __key: 'mute',
+ __type: 'change',
+ __primary: false,
+ method: 'PUT',
+ label: 'Mute',
+ title: 'Working...',
+ enabled: true,
+ };
+
+ element.actions = {
+ mute: MuteAction,
+ };
+
+ element.changeNum = '2';
+ element.patchNum = '2';
+
+ element.reload().then(() => {flush(done);});
+ });
+
+ test('make sure the mute button is not outside of the overflow menu',
+ () => {
+ assert.isNotOk(element.$$('[data-action-key="mute"]'));
+ });
+
+ test('muting change', () => {
+ assert.isOk(element.$.moreActions.$$('span[data-id="mute-change"]'));
+ element.setActionOverflow('change', 'mute', false);
+ flushAsynchronousOperations();
+ assert.isOk(element.$$('[data-action-key="mute"]'));
+ assert.isNotOk(
+ element.$.moreActions.$$('span[data-id="mute-change"]'));
+ });
+ });
+
+ suite('unmute change', () => {
+ setup(done => {
+ sandbox.stub(element, '_fireAction');
+
+ const UnmuteAction = {
+ __key: 'unmute',
+ __type: 'change',
+ __primary: false,
+ method: 'PUT',
+ label: 'Unmute',
+ title: 'Working...',
+ enabled: true,
+ };
+
+ element.actions = {
+ unmute: UnmuteAction,
+ };
+
+ element.changeNum = '2';
+ element.patchNum = '2';
+
+ element.reload().then(() => {flush(done);});
+ });
+
+
+ test('unmute button not outside of the overflow menu', () => {
+ assert.isNotOk(element.$$('[data-action-key="unmute"]'));
+ });
+
+ test('unmuting change', () => {
+ assert.isOk(
+ element.$.moreActions.$$('span[data-id="unmute-change"]'));
+ element.setActionOverflow('change', 'unmute', false);
+ flushAsynchronousOperations();
+ assert.isOk(element.$$('[data-action-key="unmute"]'));
+ assert.isNotOk(
+ element.$.moreActions.$$('span[data-id="unmute-change"]'));
+ });
+ });
+
suite('quick approve', () => {
setup(() => {
element.change = {
@@ -800,7 +879,7 @@
assert.isNull(approveButton);
});
- test('approves when taped', () => {
+ test('approves when tapped', () => {
const fireActionStub = sandbox.stub(element, '_fireAction');
MockInteractions.tap(
element.$$('gr-button[data-action-key=\'review\']'));
diff --git a/tools/eclipse/project.py b/tools/eclipse/project.py
index 6838101..8bc70de 100755
--- a/tools/eclipse/project.py
+++ b/tools/eclipse/project.py
@@ -154,7 +154,7 @@
src.add(m.group(1))
# Exceptions: both source and lib
if p.endswith('libquery_parser.jar') or \
- p.endswith('prolog/libcommon.jar'):
+ p.endswith('libprolog-common.jar'):
lib.add(p)
# JGit dependency from external repository
if 'gerrit-' not in p and 'jgit' in p: