Merge branch 'stable-3.9' into stable-3.10
* stable-3.9:
Add code-block markdown to owners-autoassign config.md
Change-Id: I2f5cda6801a00c9f97ba99df85fe39a93f62d426
diff --git a/owners-autoassign/src/main/java/com/googlesource/gerrit/owners/common/AutoassignConfigModule.java b/owners-autoassign/src/main/java/com/googlesource/gerrit/owners/common/AutoassignConfigModule.java
index dfa812d..865d971 100644
--- a/owners-autoassign/src/main/java/com/googlesource/gerrit/owners/common/AutoassignConfigModule.java
+++ b/owners-autoassign/src/main/java/com/googlesource/gerrit/owners/common/AutoassignConfigModule.java
@@ -33,7 +33,7 @@
.annotatedWith(Exports.named(PROJECT_CONFIG_AUTOASSIGN_WIP_CHANGES))
.toInstance(
new ProjectConfigEntry(
- "Auto-assign WIP changes", InheritableBoolean.TRUE, InheritableBoolean.class));
+ "Auto-assign WIP changes", InheritableBoolean.INHERIT, InheritableBoolean.class));
bind(ProjectConfigEntry.class)
.annotatedWith(Exports.named(PROJECT_CONFIG_AUTOASSIGN_FIELD))
.toInstance(
diff --git a/owners/src/test/java/com/googlesource/gerrit/owners/OwnersSubmitRequirementIT.java b/owners/src/test/java/com/googlesource/gerrit/owners/OwnersSubmitRequirementIT.java
index 0e7e40b..f7421fe 100644
--- a/owners/src/test/java/com/googlesource/gerrit/owners/OwnersSubmitRequirementIT.java
+++ b/owners/src/test/java/com/googlesource/gerrit/owners/OwnersSubmitRequirementIT.java
@@ -16,7 +16,6 @@
package com.googlesource.gerrit.owners;
import static com.google.common.truth.Truth.assertThat;
-import static com.google.common.truth.Truth8.assertThat;
import com.google.gerrit.acceptance.TestPlugin;
import com.google.gerrit.acceptance.UseLocalDisk;
diff --git a/owners/src/test/java/com/googlesource/gerrit/owners/OwnersSubmitRequirementITAbstract.java b/owners/src/test/java/com/googlesource/gerrit/owners/OwnersSubmitRequirementITAbstract.java
index 2135b40..3db9dcb 100644
--- a/owners/src/test/java/com/googlesource/gerrit/owners/OwnersSubmitRequirementITAbstract.java
+++ b/owners/src/test/java/com/googlesource/gerrit/owners/OwnersSubmitRequirementITAbstract.java
@@ -16,7 +16,6 @@
package com.googlesource.gerrit.owners;
import static com.google.common.truth.Truth.assertThat;
-import static com.google.common.truth.Truth8.assertThat;
import static com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.allowLabel;
import static com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS;
import static com.google.gerrit.server.project.testing.TestLabels.labelBuilder;
diff --git a/owners/src/test/java/com/googlesource/gerrit/owners/OwnersSubmitRequirementTest.java b/owners/src/test/java/com/googlesource/gerrit/owners/OwnersSubmitRequirementTest.java
index bd6c232..1a411c3 100644
--- a/owners/src/test/java/com/googlesource/gerrit/owners/OwnersSubmitRequirementTest.java
+++ b/owners/src/test/java/com/googlesource/gerrit/owners/OwnersSubmitRequirementTest.java
@@ -15,7 +15,6 @@
package com.googlesource.gerrit.owners;
import static com.google.common.truth.Truth.assertThat;
-import static com.google.common.truth.Truth8.assertThat;
import static com.google.gerrit.server.project.testing.TestLabels.codeReview;
import static com.google.gerrit.server.project.testing.TestLabels.labelBuilder;
import static com.google.gerrit.server.project.testing.TestLabels.value;
diff --git a/owners/src/test/java/com/googlesource/gerrit/owners/restapi/GetFilesOwnersITAbstract.java b/owners/src/test/java/com/googlesource/gerrit/owners/restapi/GetFilesOwnersITAbstract.java
index c39974c..eba9a68 100644
--- a/owners/src/test/java/com/googlesource/gerrit/owners/restapi/GetFilesOwnersITAbstract.java
+++ b/owners/src/test/java/com/googlesource/gerrit/owners/restapi/GetFilesOwnersITAbstract.java
@@ -41,15 +41,11 @@
import com.googlesource.gerrit.owners.entities.GroupOwner;
import com.googlesource.gerrit.owners.entities.Owner;
import com.googlesource.gerrit.owners.restapi.GetFilesOwners.LabelNotFoundException;
-import java.util.Arrays;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.compress.utils.Sets;
-import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription;
import org.eclipse.jgit.internal.storage.dfs.InMemoryRepository;
import org.eclipse.jgit.junit.TestRepository;
-import org.eclipse.jgit.lib.Config;
import org.eclipse.jgit.transport.FetchResult;
-import org.eclipse.jgit.util.FS;
import org.junit.Test;
public abstract class GetFilesOwnersITAbstract extends LightweightPluginDaemonTest {
@@ -350,31 +346,18 @@
public TestRepository<InMemoryRepository> cloneProjectWithMetaRefs(Project.NameKey project)
throws Exception {
- String uri = registerRepoConnection(project, admin);
+ TestRepository<InMemoryRepository> clonedProject = cloneProject(project);
String initialRef = "refs/remotes/origin/config";
- DfsRepositoryDescription desc = new DfsRepositoryDescription("clone of " + project.get());
-
- InMemoryRepository.Builder b = new InMemoryRepository.Builder().setRepositoryDescription(desc);
- if (uri.startsWith("ssh://")) {
- // SshTransport depends on a real FS to read ~/.ssh/config, but InMemoryRepository by default
- // uses a null FS.
- // Avoid leaking user state into our tests.
- b.setFS(FS.detect().setUserHome(null));
- }
- InMemoryRepository dest = b.build();
- Config cfg = dest.getConfig();
- cfg.setString("remote", "origin", "url", uri);
- cfg.setStringList(
- "remote",
- "origin",
- "fetch",
- Arrays.asList(
- "+refs/heads/*:refs/remotes/origin/*", "+refs/meta/config:refs/remotes/origin/config"));
- TestRepository<InMemoryRepository> testRepo = GitUtil.newTestRepository(dest);
- FetchResult result = testRepo.git().fetch().setRemote("origin").call();
+ FetchResult result =
+ clonedProject
+ .git()
+ .fetch()
+ .setRemote("origin")
+ .setRefSpecs("+refs/meta/config:refs/remotes/origin/config")
+ .call();
if (result.getTrackingRefUpdate(initialRef) != null) {
- testRepo.reset(initialRef);
+ clonedProject.reset(initialRef);
}
- return testRepo;
+ return clonedProject;
}
}
diff --git a/owners/src/test/java/com/googlesource/gerrit/owners/restapi/GetFilesOwnersSubmitRequirementsIT.java b/owners/src/test/java/com/googlesource/gerrit/owners/restapi/GetFilesOwnersSubmitRequirementsIT.java
index 8172611..bc57ab2 100644
--- a/owners/src/test/java/com/googlesource/gerrit/owners/restapi/GetFilesOwnersSubmitRequirementsIT.java
+++ b/owners/src/test/java/com/googlesource/gerrit/owners/restapi/GetFilesOwnersSubmitRequirementsIT.java
@@ -28,6 +28,7 @@
import com.google.gerrit.entities.RefNames;
import com.google.gerrit.extensions.api.changes.ReviewInput;
import com.google.gerrit.extensions.restapi.Response;
+import com.google.gerrit.server.config.SitePaths;
import com.google.gerrit.server.project.testing.TestLabels;
import com.google.inject.Inject;
import com.googlesource.gerrit.owners.common.LabelDefinition;
@@ -44,6 +45,7 @@
@UseLocalDisk
public class GetFilesOwnersSubmitRequirementsIT extends GetFilesOwnersITAbstract {
@Inject private ProjectOperations projectOperations;
+ @Inject private SitePaths sitePaths;
@Override
public void setUpTestPlugin() throws Exception {
@@ -53,7 +55,7 @@
// globally
pluginCfg.setBoolean("owners", null, "enableSubmitRequirement", true);
Files.writeString(
- server.getSitePath().resolve("etc").resolve("owners.config"),
+ sitePaths.etc_dir.resolve("owners.config"),
pluginCfg.toText(),
StandardOpenOption.CREATE,
StandardOpenOption.APPEND);