]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-19372 remove branch support for anticipated transitions
authorPierre <pierre.guillot@sonarsource.com>
Mon, 31 Jul 2023 14:49:36 +0000 (16:49 +0200)
committersonartech <sonartech@sonarsource.com>
Wed, 2 Aug 2023 20:03:03 +0000 (20:03 +0000)
server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/issue/AnticipatedTransitionRepositoryImpl.java
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/issue/TransitionIssuesToAnticipatedStatesVisitorTest.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/anticipatedtransition/AnticipatedTransitionParser.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/issue/ws/anticipatedtransition/AnticipatedTransitionHandlerTest.java
server/sonar-webserver-webapi/src/test/java/org/sonar/server/issue/ws/anticipatedtransition/AnticipatedTransitionParserTest.java
sonar-core/src/main/java/org/sonar/core/issue/AnticipatedTransition.java
sonar-core/src/test/java/org/sonar/core/issue/AnticipatedTransitionTest.java
sonar-core/src/test/java/org/sonar/core/issue/tracking/AnticipatedTransitionTrackerTest.java

index 9c0e943cacc927ed2088855eb0c8c8d71d6b48cd..e2a115a98c2cffe405bfb43064edecadf51578dd 100644 (file)
@@ -63,7 +63,6 @@ public class AnticipatedTransitionRepositoryImpl implements AnticipatedTransitio
   private AnticipatedTransition getAnticipatedTransition(AnticipatedTransitionDto transitionDto) {
     return new AnticipatedTransition(
       transitionDto.getProjectUuid(),
-      "branch",
       transitionDto.getUserUuid(),
       RuleKey.parse(transitionDto.getRuleKey()),
       transitionDto.getMessage(),
index b7b76f23a90fb418d37ffbe7b3d02504d908ff21..4cd4af882e9f7b141b3c0ca2233d697aec3916be 100644 (file)
@@ -115,11 +115,11 @@ public class TransitionIssuesToAnticipatedStatesVisitorTest {
   }
 
   private Collection<AnticipatedTransition> getAnticipatedTransitions(String projecKey, String fileName) {
-    return Stream.of(new AnticipatedTransition(projecKey, null, "admin", RuleKey.parse("repo:id"), "issue message", fileName, 1, "abcdefghi", "wontfix", "doing the transition in an anticipated way")).collect(Collectors.toList());
+    return Stream.of(new AnticipatedTransition(projecKey, "admin", RuleKey.parse("repo:id"), "issue message", fileName, 1, "abcdefghi", "wontfix", "doing the transition in an anticipated way")).collect(Collectors.toList());
   }
 
   private Collection<AnticipatedTransition> getAnticipatedTransitionsWithEmptyComment(String projecKey, String fileName) {
-    return Stream.of(new AnticipatedTransition(projecKey, null, "admin", RuleKey.parse("repo:id"), "issue message", fileName, 1, "abcdefghi", "wontfix", null)).collect(Collectors.toList());
+    return Stream.of(new AnticipatedTransition(projecKey, "admin", RuleKey.parse("repo:id"), "issue message", fileName, 1, "abcdefghi", "wontfix", null)).collect(Collectors.toList());
   }
 
   private Component getComponent(Component.Type type) {
index eb02da3726a54a8bd48975e05b5664810bb5b1e9..1b4cbab8bd1315a71894a41fcfaa46a1488e475f 100644 (file)
@@ -56,7 +56,6 @@ public class AnticipatedTransitionParser {
     return anticipatedTransitions.stream()
       .map(anticipatedTransition -> new AnticipatedTransition(
         projectKey,
-        "branch",
         userUuid,
         RuleKey.parse(anticipatedTransition.ruleKey()),
         anticipatedTransition.message(),
index 6cc2bf6415c02d4dabbb3bbe016d6cade9078b56..6e6e1d4fa47b1021637052f0ca4a68f6e332d1e7 100644 (file)
@@ -98,7 +98,6 @@ public class AnticipatedTransitionHandlerTest {
   private AnticipatedTransition populateAnticipatedTransition() {
     return new AnticipatedTransition(
       PROJECT_KEY,
-      "branch",
       USER_UUID,
       RuleKey.of("repo", "squid:S0001"),
       "issueMessage1",
index 02b3e5042df6f8836bb05fab66d455cf07e2929f..c1e771124d877b107fc72b66eeb8466d6e35f4c1 100644 (file)
@@ -102,7 +102,6 @@ public class AnticipatedTransitionParserTest {
     return List.of(
       new AnticipatedTransition(
         PROJECT_KEY,
-        "branch",
         USER_UUID,
         RuleKey.parse("squid:S0001"),
         "issueMessage1",
@@ -113,7 +112,6 @@ public class AnticipatedTransitionParserTest {
         "comment1"),
       new AnticipatedTransition(
         PROJECT_KEY,
-        "branch",
         USER_UUID,
         RuleKey.parse("squid:S0002"),
         "issueMessage2",
index 5d0fe394964f3eedfd11a26295e86054b06a81e2..bcb1c5192dc5bdfb212559298238ae5b8869d030 100644 (file)
@@ -31,7 +31,6 @@ import org.sonar.core.issue.tracking.Trackable;
 public class AnticipatedTransition implements Trackable {
 
   private final String projectKey;
-  private final String branch;
   private final String transition;
   private final String userUuid;
   private final String comment;
@@ -43,7 +42,6 @@ public class AnticipatedTransition implements Trackable {
 
   public AnticipatedTransition(
     String projectKey,
-    @Nullable String branch,
     String userUuid,
     @Nullable RuleKey ruleKey,
     @Nullable String message,
@@ -53,7 +51,6 @@ public class AnticipatedTransition implements Trackable {
     String transition,
     @Nullable String comment) {
     this.projectKey = projectKey;
-    this.branch = branch;
     this.transition = transition;
     this.userUuid = userUuid;
     this.comment = comment;
@@ -68,10 +65,6 @@ public class AnticipatedTransition implements Trackable {
     return projectKey;
   }
 
-  public String getBranch() {
-    return branch;
-  }
-
   public String getTransition() {
     return transition;
   }
@@ -132,7 +125,6 @@ public class AnticipatedTransition implements Trackable {
     }
     AnticipatedTransition that = (AnticipatedTransition) o;
     return Objects.equals(projectKey, that.projectKey)
-      && Objects.equals(branch, that.branch)
       && Objects.equals(transition, that.transition)
       && Objects.equals(userUuid, that.userUuid)
       && Objects.equals(comment, that.comment)
index 041753af341f42be9ef6bbf8f6bf8643b1a344ec..4e1be63dfefe0b8e497f5d404d140585e68d6683 100644 (file)
@@ -45,7 +45,6 @@ public class AnticipatedTransitionTest {
 
   private void assertFieldsAreTheSame(AnticipatedTransition anticipatedTransition, AnticipatedTransition anticipatedTransition2) {
     Assertions.assertThat(anticipatedTransition.getProjectKey()).isEqualTo(anticipatedTransition2.getProjectKey());
-    Assertions.assertThat(anticipatedTransition.getBranch()).isEqualTo(anticipatedTransition2.getBranch());
     Assertions.assertThat(anticipatedTransition.getUserUuid()).isEqualTo(anticipatedTransition2.getUserUuid());
     Assertions.assertThat(anticipatedTransition.getTransition()).isEqualTo(anticipatedTransition2.getTransition());
     Assertions.assertThat(anticipatedTransition.getComment()).isEqualTo(anticipatedTransition2.getComment());
@@ -59,7 +58,6 @@ public class AnticipatedTransitionTest {
   private AnticipatedTransition getAnticipatedTransition() {
     return new AnticipatedTransition(
       "projectKey",
-      "branch",
       "userUuid",
       RuleKey.parse("rule:key"),
       "message",
index 2d88c8942663b32a24e16a7556fcd49bc1e2de75..017e4b8417a459d6451e64b42f4d66717673acb7 100644 (file)
@@ -93,7 +93,6 @@ public class AnticipatedTransitionTrackerTest {
 
   private AnticipatedTransition getAnticipatedTransition(Integer line, String message, String hash, String ruleKey) {
     return new AnticipatedTransition("projectKey",
-      null,
       "userUuid",
       RuleKey.parse(ruleKey),
       message,