From 5dd0174832489f29e9587931c5bd9e4e3f3c5742 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Wed, 25 Apr 2018 21:06:19 +0900 Subject: [PATCH 1/2] AbstractQueryChangesTest#reviewerin: Expand to cover CC Test the behavior of the reviewerin: query when a user is added to a change as CC. On NoteDb, reviewer and CC are separate so the query result should not include users that were added as CC. However under ReviewDb there is no distinction between reviewer and CC so the results should include users that were added as CC. Change-Id: I9f1d53d9ae6aef1e2c10da586951fb7d76978151 --- .../change/AbstractQueryChangesTest.java | 35 +++++++++++++++---- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/gerrit-server/src/test/java/com/google/gerrit/server/query/change/AbstractQueryChangesTest.java b/gerrit-server/src/test/java/com/google/gerrit/server/query/change/AbstractQueryChangesTest.java index d2004f11da..38637e3501 100644 --- a/gerrit-server/src/test/java/com/google/gerrit/server/query/change/AbstractQueryChangesTest.java +++ b/gerrit-server/src/test/java/com/google/gerrit/server/query/change/AbstractQueryChangesTest.java @@ -1715,11 +1715,12 @@ public abstract class AbstractQueryChangesTest extends GerritServerTests { public void reviewerin() throws Exception { Account.Id user1 = accountManager.authenticate(AuthRequest.forUser("user1")).getAccountId(); Account.Id user2 = accountManager.authenticate(AuthRequest.forUser("user2")).getAccountId(); + Account.Id user3 = accountManager.authenticate(AuthRequest.forUser("user3")).getAccountId(); TestRepository repo = createProject("repo"); Change change1 = insert(repo, newChange(repo)); Change change2 = insert(repo, newChange(repo)); - insert(repo, newChange(repo)); + Change change3 = insert(repo, newChange(repo)); AddReviewerInput rin = new AddReviewerInput(); rin.reviewer = user1.toString(); @@ -1731,8 +1732,13 @@ public abstract class AbstractQueryChangesTest extends GerritServerTests { rin.state = ReviewerState.REVIEWER; gApi.changes().id(change2.getId().get()).addReviewer(rin); + rin = new AddReviewerInput(); + rin.reviewer = user3.toString(); + rin.state = ReviewerState.CC; + gApi.changes().id(change3.getId().get()).addReviewer(rin); + String group = gApi.groups().create("foo").get().name; - gApi.groups().id(group).addMembers(user2.toString()); + gApi.groups().id(group).addMembers(user2.toString(), user3.toString()); List members = gApi.groups() @@ -1743,15 +1749,30 @@ public abstract class AbstractQueryChangesTest extends GerritServerTests { .collect(toList()); assertThat(members).contains(user2.toString()); - assertQuery("reviewerin:\"Registered Users\"", change2, change1); - assertQuery("reviewerin:" + group, change2); + if (notesMigration.readChanges()) { + // CC and REVIEWER are separate in NoteDB + assertQuery("reviewerin:\"Registered Users\"", change2, change1); + assertQuery("reviewerin:" + group, change2); + } else { + // CC and REVIEWER are the same in ReviewDb + assertQuery("reviewerin:\"Registered Users\"", change3, change2, change1); + assertQuery("reviewerin:" + group, change3, change2); + } gApi.changes().id(change2.getId().get()).current().review(ReviewInput.approve()); gApi.changes().id(change2.getId().get()).current().submit(); - assertQuery("reviewerin:" + group); - assertQuery("project:repo reviewerin:" + group, change2); - assertQuery("status:merged reviewerin:" + group, change2); + if (notesMigration.readChanges()) { + // CC and REVIEWER are separate in NoteDB + assertQuery("reviewerin:" + group); + assertQuery("project:repo reviewerin:" + group, change2); + assertQuery("status:merged reviewerin:" + group, change2); + } else { + // CC and REVIEWER are the same in ReviewDb + assertQuery("reviewerin:" + group, change3); + assertQuery("project:repo reviewerin:" + group, change2, change3); + assertQuery("status:merged reviewerin:" + group, change2); + } } @Test From 89050c03bc2eeece0f4384ab97e02cd441705fe6 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Thu, 26 Apr 2018 13:16:21 +0900 Subject: [PATCH 2/2] Remove documentation about cleaning the build cache The buck-cache folder is not used since change Ia9c58bc5a, and the whole process of cleaning the build cache is different with bazel anyway. Rather than attempting to document this for bazel, where we rarely need to wipe the build cache (compared to with buck), just remove that part of the documentation. Change-Id: I1ae4e89f1b9c9a8cc3ce75a18a6e48db2d1b2ba2 --- Documentation/dev-bazel.txt | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/Documentation/dev-bazel.txt b/Documentation/dev-bazel.txt index 45a6bfe75b..addbef4758 100644 --- a/Documentation/dev-bazel.txt +++ b/Documentation/dev-bazel.txt @@ -358,26 +358,6 @@ To consume the JGit dependency from the development tree, edit `lib/jgit/jgit.bzl` setting LOCAL_JGIT_REPO to a directory holding a JGit repository. -[[clean-cache]] -=== Cleaning The download cache - -The cache for the Gerrit Code Review project is located in -`~/.gerritcodereview/buck-cache/locally-built-artifacts`. - -If you really do need to clean the cache manually, then: - ----- - rm -rf ~/.gerritcodereview/buck-cache/locally-built-artifacts ----- - -Note that the root `buck-cache` folder should not be deleted as it also contains -the `downloaded-artifacts` directory, which holds the artifacts that got -downloaded (not built locally). - -[NOTE] When building with Bazel the artifacts are still cached in -`~/.gerritcodereview/buck-cache/`. This allows Bazel to make use of -libraries that were previously downloaded by Buck. - GERRIT ------ Part of link:index.html[Gerrit Code Review]