]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-10299 Drop the project link "developer connection"
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Mon, 12 Feb 2018 16:03:52 +0000 (17:03 +0100)
committerStas Vilchik <stas.vilchik@sonarsource.com>
Tue, 20 Feb 2018 09:06:52 +0000 (10:06 +0100)
12 files changed:
server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java
server/sonar-server/src/main/java/org/sonar/server/computation/task/projectanalysis/step/PersistProjectLinksStep.java
server/sonar-server/src/test/java/org/sonar/server/computation/task/projectanalysis/step/PersistProjectLinksStepTest.java
sonar-core/src/main/java/org/sonar/core/config/CorePropertyDefinitions.java
sonar-core/src/main/java/org/sonar/core/config/ScannerProperties.java
sonar-core/src/test/java/org/sonar/core/config/CorePropertyDefinitionsTest.java
sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java
sonar-plugin-api/src/main/java/org/sonar/api/batch/scm/ScmProvider.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/report/ComponentsPublisher.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/scm/ScmConfiguration.java
sonar-scanner-protocol/src/main/protobuf/scanner_report.proto
tests/src/test/java/org/sonarqube/tests/analysis/LinksTest.java

index 13a1cb4609d3676c961b883c7b7185581eec62c9..fa90b0e662044774a41ecd6ba54d86300367fcbb 100644 (file)
@@ -120,7 +120,7 @@ public class ComputeEngineContainerImplTest {
         + 26 // level 1
         + 52 // content of DaoModule
         + 3 // content of EsSearchModule
-        + 60 // content of CorePropertyDefinitions
+        + 59 // content of CorePropertyDefinitions
         + 1 // StopFlagContainer
     );
     assertThat(
index c255ba1189fca8efc422cb46336655ed593f1416..7d7127ceea0750fcfec71d1c998ec7f9f404eba0 100644 (file)
@@ -48,7 +48,6 @@ public class PersistProjectLinksStep implements ComputationStep {
   private static final Map<ComponentLinkType, String> typesConverter = ImmutableMap.of(
     ComponentLinkType.HOME, ProjectLinkDto.TYPE_HOME_PAGE,
     ComponentLinkType.SCM, ProjectLinkDto.TYPE_SOURCES,
-    ComponentLinkType.SCM_DEV, ProjectLinkDto.TYPE_SOURCES_DEV,
     ComponentLinkType.CI, ProjectLinkDto.TYPE_CI,
     ComponentLinkType.ISSUE, ProjectLinkDto.TYPE_ISSUE_TRACKER);
 
index b13cc434b1a4f6e06bac912822fe1d6a408ed858..d5dfa7235d3d349174473b52c40d2c3f932627c3 100644 (file)
@@ -41,7 +41,6 @@ import static org.sonar.scanner.protocol.output.ScannerReport.ComponentLink.Comp
 import static org.sonar.scanner.protocol.output.ScannerReport.ComponentLink.ComponentLinkType.HOME;
 import static org.sonar.scanner.protocol.output.ScannerReport.ComponentLink.ComponentLinkType.ISSUE;
 import static org.sonar.scanner.protocol.output.ScannerReport.ComponentLink.ComponentLinkType.SCM;
-import static org.sonar.scanner.protocol.output.ScannerReport.ComponentLink.ComponentLinkType.SCM_DEV;
 
 public class PersistProjectLinksStepTest extends BaseStepTest {
 
@@ -77,7 +76,6 @@ public class PersistProjectLinksStepTest extends BaseStepTest {
       .addChildRef(2)
       .addLink(ScannerReport.ComponentLink.newBuilder().setType(HOME).setHref("http://www.sonarqube.org").build())
       .addLink(ScannerReport.ComponentLink.newBuilder().setType(SCM).setHref("https://github.com/SonarSource/sonar").build())
-      .addLink(ScannerReport.ComponentLink.newBuilder().setType(SCM_DEV).setHref("scm:git:git@github.com:SonarSource/sonar.git/sonar").build())
       .addLink(ScannerReport.ComponentLink.newBuilder().setType(ISSUE).setHref("http://jira.sonarsource.com/").build())
       .addLink(ScannerReport.ComponentLink.newBuilder().setType(CI).setHref("http://bamboo.ci.codehaus.org/browse/SONAR").build())
       .build());
@@ -89,7 +87,6 @@ public class PersistProjectLinksStepTest extends BaseStepTest {
       .containsExactlyInAnyOrder(
         tuple("homepage", "http://www.sonarqube.org", null),
         tuple("scm", "https://github.com/SonarSource/sonar", null),
-        tuple("scm_dev", "scm:git:git@github.com:SonarSource/sonar.git/sonar", null),
         tuple("issue", "http://jira.sonarsource.com/", null),
         tuple("ci", "http://bamboo.ci.codehaus.org/browse/SONAR", null));
   }
index e7d215f829607b8e45acfae8e7f4d859c81de1a4..01acaad196a0573f6d513f9489faf99f0591630c 100644 (file)
@@ -91,12 +91,6 @@ public class CorePropertyDefinitions {
         .description("HTTP URL of the server which hosts the sources of the project.")
         .category(CoreProperties.CATEGORY_GENERAL)
         .build(),
-      PropertyDefinition.builder(CoreProperties.LINKS_SOURCES_DEV)
-        .name("SCM connection for developers")
-        .description("HTTP URL used by developers to connect to the SCM server for the project.")
-        .category(CoreProperties.CATEGORY_GENERAL)
-        .hidden()
-        .build(),
       PropertyDefinition.builder(CoreProperties.PREVIEW_INCLUDE_PLUGINS)
         .name("Plugins accepted for Preview mode")
         .description("DEPRECATED - List of plugin keys. Those plugins will be used during preview analyses.")
index 854a6ff356b7a58c0de1edcfc6bc93e48c2cea37..1cc3bddeef59409347f86eb74dc355540fa18a9d 100644 (file)
@@ -35,6 +35,8 @@ public class ScannerProperties {
   public static final String BRANCH_TARGET = "sonar.branch.target";
   public static final String ORGANIZATION = "sonar.organization";
 
+  public static final String LINKS_SOURCES_DEV = "sonar.links.scm_dev";
+
   private ScannerProperties() {
     // only static stuff
   }
index 2be463f4364ee60530433edda59781b3643c58c8..b3054a31a22143ac21403b3c84aa3a93ed43c5c4 100644 (file)
@@ -30,7 +30,7 @@ public class CorePropertyDefinitionsTest {
   @Test
   public void all() {
     List<PropertyDefinition> defs = CorePropertyDefinitions.all();
-    assertThat(defs).hasSize(60);
+    assertThat(defs).hasSize(59);
   }
 
   @Test
index d0087bfb76d23c24abf6dda27f7ecef0708d5091..1e27f1369e09489f7c4dec433f190c5366367839 100644 (file)
@@ -328,7 +328,9 @@ public interface CoreProperties {
 
   /**
    * @since 3.3
+   * @deprecated since 7.1, developer connection link is no more feed
    */
+  @Deprecated
   String LINKS_SOURCES_DEV = "sonar.links.scm_dev";
 
   /**
index 49cb3305dd0b767be6f24ba7c11d223a221f9908..b698b8974fe9216ade3ff7e4c50e6564bc5e12c0 100644 (file)
@@ -29,7 +29,7 @@ import org.sonar.api.batch.InstantiationStrategy;
 import org.sonar.api.batch.ScannerSide;
 
 /**
- * See {@link CoreProperties#LINKS_SOURCES_DEV} to get old Maven URL format.
+ * See {@link LINKS_SOURCES_DEV#LINKS_SOURCES_DEV} to get old Maven URL format.
  * @since 5.0
  */
 @ScannerSide
index df61662bb9e4b1b15204b6a41cc41110419c7470..c1edd6f92f73a2e312d1271cc83c6e6aaa906e9b 100644 (file)
@@ -236,7 +236,6 @@ public class ComponentsPublisher implements ReportPublisherStep {
       writeProjectLink(builder, def, linkBuilder, CoreProperties.LINKS_CI, ComponentLinkType.CI);
       writeProjectLink(builder, def, linkBuilder, CoreProperties.LINKS_ISSUE_TRACKER, ComponentLinkType.ISSUE);
       writeProjectLink(builder, def, linkBuilder, CoreProperties.LINKS_SOURCES, ComponentLinkType.SCM);
-      writeProjectLink(builder, def, linkBuilder, CoreProperties.LINKS_SOURCES_DEV, ComponentLinkType.SCM_DEV);
     }
   }
 
index 55931063274ee29ac5ed1da28789f144e0aee3b0..56957d3befd0b53d3e82496fa175f748a0f24a36 100644 (file)
@@ -38,6 +38,7 @@ import org.sonar.api.config.Configuration;
 import org.sonar.api.utils.MessageException;
 import org.sonar.api.utils.log.Logger;
 import org.sonar.api.utils.log.Loggers;
+import org.sonar.core.config.ScannerProperties;
 
 @Properties({
   @Property(
@@ -112,7 +113,7 @@ public class ScmConfiguration implements Startable {
   }
 
   private void considerOldScmUrl() {
-    settings.get(CoreProperties.LINKS_SOURCES_DEV).ifPresent(url -> {
+    settings.get(ScannerProperties.LINKS_SOURCES_DEV).ifPresent(url -> {
       if (StringUtils.startsWith(url, "scm:")) {
         String[] split = url.split(":");
         if (split.length > 1) {
index 75f915b9501577c9b0f0534038456135a857edca..7d3123d24c12a167b19dd94931195cf5c0276e98 100644 (file)
@@ -84,12 +84,13 @@ message ComponentLink {
   
   enum ComponentLinkType {
     UNSET = 0;
-         HOME = 1;
-         SCM = 2;
-         SCM_DEV = 3;
-         ISSUE = 4;
-         CI = 5;
-       }
+       HOME = 1;
+       SCM = 2;
+       // SCM_DEV is no more set since 7.1. See SONAR-10299
+       IGNORED_SCM_DEV = 3;
+       ISSUE = 4;
+       CI = 5;
+  }
 }
 
 message Component {
index fccc755826b80b9f7dbc739fb2c868f87622e937..c40de4c99149f197954345bddc030f9144698fb5 100644 (file)
@@ -80,7 +80,6 @@ public class LinksTest {
     verifyLink(links, "ci", "http://bamboo.ci.codehaus.org/browse/SIMPLESAMPLE");
     verifyLink(links, "issue", "http://jira.codehaus.org/browse/SIMPLESAMPLE");
     verifyLink(links, "scm", "https://github.com/SonarSource/simplesample");
-    verifyLink(links, "scm_dev", "scm:git:git@github.com:SonarSource/simplesample.git");
   }
 
   private void verifyLink(List<ProjectLinks.Link> links, String expectedType, String expectedUrl) {