]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-21378 Deprecate diff keys severity and type in api/issues/changelog
authorEric Giffon <eric.giffon@sonarsource.com>
Fri, 29 Dec 2023 14:00:34 +0000 (15:00 +0100)
committersonartech <sonartech@sonarsource.com>
Fri, 29 Dec 2023 20:02:27 +0000 (20:02 +0000)
server/sonar-webserver-webapi/src/it/java/org/sonar/server/issue/ws/ChangelogActionIT.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/issue/ws/ChangelogAction.java
server/sonar-webserver-webapi/src/main/resources/org/sonar/server/issue/ws/changelog-example.json

index 9b539ae0d35c36e13217992348006678ce47f59a..546c8728ae6d278846306d6321f75c26e32e7bca 100644 (file)
@@ -286,12 +286,15 @@ public class ChangelogActionIT {
     userSession.logIn("john")
       .addProjectPermission(USER, project, file);
     db.issues().insertFieldDiffs(issueDto, new FieldDiffs()
-      .setUserUuid(user.getUuid())
-      .setDiff("severity", "MAJOR", "BLOCKER")
-      .setWebhookSource("github")
-      .setExternalUser("toto")
-      .setCreationDate(new Date())
-      .setCreationDate(DateUtils.parseDateTime("2014-03-04T23:03:44+0100")));
+        .setUserUuid(user.getUuid())
+        .setDiff("issueStatus", "OPEN", "ACCEPTED")
+        .setWebhookSource("github")
+        .setExternalUser("ext-user")
+        .setCreationDate(DateUtils.parseDateTime("2014-03-04T23:03:44+0100")),
+      new FieldDiffs()
+        .setDiff("from_branch", "branch-123", "main")
+        .setDiff("assignee", null, "assignee123")
+        .setCreationDate(DateUtils.parseDateTime("2014-03-04T23:05:44+0100")));
 
     String result = tester.newRequest().setParam("issue", issueDto.getKey()).execute().getInput();
 
index a84b23dbf1f67b91db813454bd5cff8168b3dd08..1e2a66e8b19d81bd99dd502cb9106487f6ca3d2c 100644 (file)
@@ -57,7 +57,7 @@ public class ChangelogAction implements IssuesWsAction {
       .setSince("4.1")
       .setChangelog(
         new Change("10.4", "'issueStatus' key is added in the differences"),
-        new Change("10.4", "'status' and 'resolution' keys are now deprecated in the differences"),
+        new Change("10.4", "'status', 'resolution', 'severity' and 'type' keys are now deprecated in the differences"),
         new Change("9.7", "'externalUser' and 'webhookSource' information added to the answer"),
         new Change("6.3", "changes on effort is expressed with the raw value in minutes (instead of the duration previously)"))
       .setHandler(this)
index 04454c24a7c42a54c9c6e20c94230c577f09e95d..0bba49aaee0d24716e39d3ad64f46539fcead3bb 100644 (file)
@@ -6,13 +6,27 @@
       "isUserActive": true,
       "avatar": "b0d8c6e5ea589e6fc3d3e08afb1873bb",
       "creationDate": "2014-03-04T23:03:44+0100",
-      "externalUser": "toto",
+      "externalUser": "ext-user",
       "webhookSource": "github",
       "diffs": [
         {
-          "key": "severity",
-          "newValue": "BLOCKER",
-          "oldValue": "MAJOR"
+          "key": "issueStatus",
+          "newValue": "ACCEPTED",
+          "oldValue": "OPEN"
+        }
+      ]
+    },
+    {
+      "creationDate": "2014-03-04T23:05:44+0100",
+      "diffs": [
+        {
+          "key": "from_branch",
+          "newValue": "main",
+          "oldValue": "branch-123"
+        },
+        {
+          "key": "assignee",
+          "newValue": "assignee123"
         }
       ]
     }