Merge branch 'stable-2.14' into stable-2.15

* stable-2.14:
  doc: fix the example of index activate command
  doc: add groups index to index activate command
  AbstractQueryChangesTest: explicitly cover is:owner
  AbstractQueryChangesTest: Add stub test for "query:" predicate
  Fix internal errors when 'destination:' refers to non-existing destination
  lib/elasticsearch: restore jackson_dataformat_smile

Change-Id: If2336eba372f4ceb476e08181cfac9f966466ac5
This commit is contained in:
David Pursehouse
2018-04-17 07:18:20 +02:00
7 changed files with 38 additions and 2 deletions

View File

@@ -31,12 +31,13 @@ This command is intended to be used in scripts.
Currently supported values:
* changes
* accounts
* groups
== EXAMPLES
Activate the latest change index:
----
$ ssh -p 29418 review.example.com gerrit activate changes
$ ssh -p 29418 review.example.com gerrit index activate changes
----
GERRIT

View File

@@ -973,6 +973,12 @@ maven_jar(
sha1 = "93242092324cad33d777e06c0515e40a6b862659",
)
maven_jar(
name = "jackson_dataformat_smile",
artifact = "com.fasterxml.jackson.dataformat:jackson-dataformat-smile:" + JACKSON_VERSION,
sha1 = "d36cbae6b06ac12fca16fda403759e479316141b",
)
maven_jar(
name = "httpasyncclient",
artifact = "org.apache.httpcomponents:httpasyncclient:4.1.2",

View File

@@ -53,6 +53,9 @@ public class VersionedAccountDestinations extends VersionedMetaData {
@Override
protected void onLoad() throws IOException, ConfigInvalidException {
if (revision == null) {
return;
}
String prefix = DestinationList.DIR_NAME + "/";
for (PathInfo p : getPathInfos(true)) {
if (p.fileMode == FileMode.REGULAR_FILE) {

View File

@@ -1104,7 +1104,7 @@ public class ChangeQueryBuilder extends QueryBuilder<ChangeData> {
VersionedAccountDestinations d = VersionedAccountDestinations.forUser(self());
d.load(git);
Set<Branch.NameKey> destinations = d.getDestinationList().getDestinations(name);
if (destinations != null) {
if (destinations != null && !destinations.isEmpty()) {
return new DestinationPredicate(destinations, name);
}
} catch (RepositoryNotFoundException e) {

View File

@@ -646,6 +646,7 @@ public abstract class AbstractQueryChangesTest extends GerritServerTests {
accountManager.authenticate(AuthRequest.forUser("anotheruser")).getAccountId();
Change change2 = insert(repo, newChange(repo), user2);
assertQuery("is:owner", change1);
assertQuery("owner:" + userId.get(), change1);
assertQuery("owner:" + user2, change2);
@@ -2501,6 +2502,24 @@ public abstract class AbstractQueryChangesTest extends GerritServerTests {
assertQuery("-assignee:" + user.getUserName(), change2);
}
@Test
public void userDestination() throws Exception {
TestRepository<Repo> repo = createProject("repo");
insert(repo, newChange(repo));
assertThatQueryException("destination:foo")
.hasMessageThat()
.isEqualTo("Unknown named destination: foo");
}
@Test
public void userQuery() throws Exception {
TestRepository<Repo> repo = createProject("repo");
insert(repo, newChange(repo));
assertThatQueryException("query:foo").hasMessageThat().isEqualTo("Unknown named query: foo");
}
protected ChangeInserter newChange(TestRepository<Repo> repo) throws Exception {
return newChange(repo, null, null, null, null, false);
}

View File

@@ -12,6 +12,7 @@ java_library(
":t-digest",
"//lib/jackson:jackson-core",
"//lib/jackson:jackson-dataformat-cbor",
"//lib/jackson:jackson-dataformat-smile",
"//lib/lucene:lucene-highlighter",
"//lib/lucene:lucene-join",
"//lib/lucene:lucene-memory",

View File

@@ -13,3 +13,9 @@ java_library(
data = ["//lib:LICENSE-Apache2.0"],
exports = ["@jackson_dataformat_cbor//jar"],
)
java_library(
name = "jackson-dataformat-smile",
data = ["//lib:LICENSE-Apache2.0"],
exports = ["@jackson_dataformat_smile//jar"],
)