]> source.dussan.org Git - sonarqube.git/commitdiff
MMF-165 Remove action plan mentions
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Wed, 30 Mar 2016 08:34:27 +0000 (10:34 +0200)
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Wed, 30 Mar 2016 08:34:27 +0000 (10:34 +0200)
12 files changed:
server/sonar-server/src/main/java/org/sonar/server/issue/ws/IssuesWs.java
server/sonar-server/src/main/resources/org/sonar/server/ws/list-example.json
server/sonar-server/src/test/java/org/sonar/server/ws/WebServicesWsTest.java
server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/extract_directory_path.xml
server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/shared.xml
server/sonar-server/src/test/resources/org/sonar/server/ws/WebServicesWsTest/list.json [deleted file]
server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/issues_controller.rb
sonar-db/src/main/java/org/sonar/db/issue/IssueDto.java
sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/find_severities_by_component.xml [deleted file]
sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/update-result.xml [deleted file]
sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/update.xml [deleted file]
sonar-plugin-api/src/test/java/org/sonar/api/issue/action/ActionsTest.java

index 6014a49da8eff67b2a6122b9f0ae0fdb7cf67e3c..48dfa38a99d25eb96b10ff9338fd67763815c584 100644 (file)
@@ -155,9 +155,10 @@ public class IssuesWs implements WebService {
       .setRequired(true)
       .setExampleValue("01fc972e-2a3c-433e-bcae-0bd7f88f5123,01fc972e-2a3c-433e-bcae-0bd7f88f9999");
     action.createParam("actions")
-      .setDescription("Comma-separated list of actions to perform. Possible values: assign | set_severity | plan | do_transition")
+      .setDescription("Comma-separated list of actions to perform. Possible values: assign | set_severity | do_transition | plan.<br>" +
+        "In 5.5 action plans are dropped. plan action has no effect.")
       .setRequired(true)
-      .setExampleValue("assign,plan");
+      .setExampleValue("assign,set_severity");
     action.createParam("assign.assignee")
       .setDescription("To assign the list of issues to a specific user (login), or un-assign all the issues")
       .setExampleValue("john.smith");
@@ -171,7 +172,7 @@ public class IssuesWs implements WebService {
       .setPossibleValues(RuleType.ALL_NAMES)
       .setSince("5.5");
     action.createParam("plan.plan")
-      .setDescription("Deprecated in 5.5. Has no effect. To plan the list of issues to a specific action plan (key), or unlink all the issues from an action plan")
+      .setDescription("In 5.5, action plans are dropped. Has no effect. To plan the list of issues to a specific action plan (key), or unlink all the issues from an action plan")
       .setDeprecatedSince("5.5")
       .setExampleValue("3f19de90-1521-4482-a737-a311758ff513");
     action.createParam("do_transition.transition")
index 3f2d8e04df931f4c7c52f4f048305e9818e5fa6b..8aad3729e82c510e546c0dbfb41752501b8f17ef 100644 (file)
 {
   "webServices": [
     {
-      "path": "api/action_plans",
-      "description": "Action plans management",
+      "path": "api/metric",
+      "since": "3.2",
+      "description": "Metrics",
       "actions": [
-        {
-          "key": "close",
-          "description": "Close an action plan. Requires Administer permission on project",
-          "since": "3.6",
-          "internal": false,
-          "post": true,
-          "hasResponseExample": false,
-          "params": [
-            {
-              "key": "format",
-              "description": "Response format can be set through:<ul><li>Parameter format: xml | json</li><li>Or the 'Accept' property in the HTTP header:<ul><li>Accept:text/xml</li><li>Accept:application/json</li></ul></li></ul>If nothing is set, json is used",
-              "required": false,
-              "possibleValues": [
-                "json",
-                "xml"
-              ]
-            },
-            {
-              "key": "key",
-              "description": "Key of the action plan",
-              "required": true,
-              "exampleValue": "3f19de90-1521-4482-a737-a311758ff513"
-            }
-          ]
-        },
         {
           "key": "create",
-          "description": "Create an action plan. Requires Administer permission on project",
-          "since": "3.6",
+          "description": "Create metric",
+          "since": "4.1",
+          "deprecatedSince": "5.3",
           "internal": false,
           "post": true,
-          "hasResponseExample": false,
+          "hasResponseExample": true,
           "params": [
-            {
-              "key": "deadLine",
-              "description": "Due date of the action plan. Format: YYYY-MM-DD",
-              "required": false,
-              "exampleValue": "2013-12-31"
-            },
-            {
-              "key": "description",
-              "description": "Description of the action plan",
-              "required": false,
-              "exampleValue": "Version 3.6"
-            },
-            {
-              "key": "format",
-              "description": "Response format can be set through:<ul><li>Parameter format: xml | json</li><li>Or the 'Accept' property in the HTTP header:<ul><li>Accept:text/xml</li><li>Accept:application/json</li></ul></li></ul>If nothing is set, json is used",
-              "required": false,
-              "possibleValues": [
-                "json",
-                "xml"
-              ]
-            },
             {
               "key": "name",
-              "description": "Name of the action plan",
-              "required": true,
-              "exampleValue": "Version 3.6"
+              "required": false
             },
             {
-              "key": "project",
-              "description": "Project key",
-              "required": true,
-              "exampleValue": "org.codehaus.sonar:sonar"
-            }
-          ]
-        },
-        {
-          "key": "delete",
-          "description": "Delete an action plan. Requires Administer permission on project",
-          "since": "3.6",
-          "internal": false,
-          "post": true,
-          "hasResponseExample": false,
-          "params": [
-            {
-              "key": "format",
-              "description": "Response format can be set through:<ul><li>Parameter format: xml | json</li><li>Or the 'Accept' property in the HTTP header:<ul><li>Accept:text/xml</li><li>Accept:application/json</li></ul></li></ul>If nothing is set, json is used",
+              "key": "severity",
+              "description": "Severity",
               "required": false,
+              "defaultValue": "BLOCKER",
+              "exampleValue": "INFO",
+              "since": "4.4",
+              "deprecatedSince": "5.2",
               "possibleValues": [
-                "json",
-                "xml"
+                "BLOCKER",
+                "INFO"
               ]
-            },
-            {
-              "key": "key",
-              "description": "Key of the action plan",
-              "required": true,
-              "exampleValue": "3f19de90-1521-4482-a737-a311758ff513"
             }
           ]
         },
         {
-          "key": "open",
-          "description": "Open an action plan. Requires Administer permission on project",
-          "since": "3.6",
+          "key": "show",
+          "since": "3.2",
           "internal": false,
-          "post": true,
-          "hasResponseExample": false,
-          "params": [
-            {
-              "key": "format",
-              "description": "Response format can be set through:<ul><li>Parameter format: xml | json</li><li>Or the 'Accept' property in the HTTP header:<ul><li>Accept:text/xml</li><li>Accept:application/json</li></ul></li></ul>If nothing is set, json is used",
-              "required": false,
-              "possibleValues": [
-                "json",
-                "xml"
-              ]
-            },
-            {
-              "key": "key",
-              "description": "Key of the action plan",
-              "required": true,
-              "exampleValue": "3f19de90-1521-4482-a737-a311758ff513"
-            }
-          ]
-        },
+          "post": false,
+          "hasResponseExample": true
+        }
+      ]
+    },
+    {
+      "path": "api/webservices",
+      "description": "List web services",
+      "since": "4.2",
+      "actions": [
         {
-          "key": "search",
-          "description": "Get a list of action plans. Requires Browse permission on project",
-          "since": "3.6",
+          "key": "list",
+          "since": "4.2",
+          "description": "List web services",
           "internal": false,
           "post": false,
           "hasResponseExample": true,
           "params": [
             {
-              "key": "format",
-              "description": "Response format can be set through:<ul><li>Parameter format: xml | json</li><li>Or the 'Accept' property in the HTTP header:<ul><li>Accept:text/xml</li><li>Accept:application/json</li></ul></li></ul>If nothing is set, json is used",
+              "key": "include_internals",
+              "description": "Include web services that are implemented for internal use only. Their forward-compatibility is not assured",
               "required": false,
+              "defaultValue": "false",
               "possibleValues": [
-                "json",
-                "xml"
+                "true",
+                "false",
+                "yes",
+                "no"
               ]
-            },
-            {
-              "key": "project",
-              "description": "Project key",
-              "required": true,
-              "exampleValue": "org.codehaus.sonar:sonar"
             }
           ]
         },
         {
-          "key": "update",
-          "description": "Update an action plan. Requires Administer permission on project",
-          "since": "3.6",
+          "key": "response_example",
+          "since": "4.4",
+          "description": "Display web service response example",
           "internal": false,
-          "post": true,
-          "hasResponseExample": false,
+          "post": false,
+          "hasResponseExample": true,
           "params": [
             {
-              "key": "deadLine",
-              "description": "Due date of the action plan. Format: YYYY-MM-DD",
-              "required": false,
-              "exampleValue": "2013-12-31"
-            },
-            {
-              "key": "description",
-              "description": "Description of the action plan",
-              "required": false,
-              "exampleValue": "Version 3.6"
-            },
-            {
-              "key": "format",
-              "description": "Response format can be set through:<ul><li>Parameter format: xml | json</li><li>Or the 'Accept' property in the HTTP header:<ul><li>Accept:text/xml</li><li>Accept:application/json</li></ul></li></ul>If nothing is set, json is used",
-              "required": false,
-              "possibleValues": [
-                "json",
-                "xml"
-              ]
-            },
-            {
-              "key": "key",
-              "description": "Key of the action plan",
+              "key": "action",
               "required": true,
-              "exampleValue": "3f19de90-1521-4482-a737-a311758ff513"
+              "description": "Action of the web service",
+              "exampleValue": "search"
             },
             {
-              "key": "name",
-              "description": "Name of the action plan",
+              "key": "controller",
               "required": true,
-              "exampleValue": "Version 3.6"
-            }
-          ]
-        }
-      ]
-    },
-    {
-      "path": "api/authentication",
-      "description": "Check authentication credentials",
-      "actions": [
-        {
-          "key": "validate",
-          "description": "Check credentials",
-          "since": "3.3",
-          "internal": false,
-          "post": false,
-          "hasResponseExample": true,
-          "params": [
-            {
-              "key": "format",
-              "description": "Response format can be set through:<ul><li>Parameter format: xml | json</li><li>Or the 'Accept' property in the HTTP header:<ul><li>Accept:text/xml</li><li>Accept:application/json</li></ul></li></ul>If nothing is set, json is used",
-              "required": false,
-              "possibleValues": [
-                "json",
-                "xml"
-              ]
+              "description": "Controller of the web service",
+              "exampleValue": "api/issues"
             }
           ]
         }
index 388b4d481e30e00b104782818faabd17d3ebfcf2..554a1c44c60046185bfbc13d4fa1aae516c70ffb 100644 (file)
@@ -25,6 +25,7 @@ import org.sonar.api.server.ws.Request;
 import org.sonar.api.server.ws.RequestHandler;
 import org.sonar.api.server.ws.Response;
 import org.sonar.api.server.ws.WebService;
+import org.sonar.test.JsonAssert;
 
 import static org.assertj.core.api.Assertions.assertThat;
 
@@ -56,7 +57,10 @@ public class WebServicesWsTest {
   @Test
   public void list() throws Exception {
     WsTester tester = new WsTester(ws, new MetricWs());
-    tester.newGetRequest("api/webservices", "list").execute().assertJson(getClass(), "list.json");
+
+    String response = tester.newGetRequest("api/webservices", "list").execute().outputAsString();
+
+    JsonAssert.assertJson(response).isSimilarTo(getClass().getResource("list-example.json"));
   }
 
   @Test
index c68a82fb8c8181cf8e9f5de5ab1cfa6999971a29..1e3158f86fb6f2aaa31d7eb4dc0e25446060d447 100644 (file)
@@ -26,7 +26,7 @@
       rule_id="200"
       reporter="[null]"
       issue_attributes="JIRA=http://jira.com"
-      action_plan_key="PLAN1"
+      action_plan_key="[null]"
       tags="tag1,tag2,tag3"
       created_at="1400000000000"
       updated_at="1400000000000"
@@ -55,7 +55,7 @@
       rule_id="200"
       reporter="[null]"
       issue_attributes="JIRA=http://jira.com"
-      action_plan_key="PLAN2"
+      action_plan_key="[null]"
       tags="[null]"
       created_at="1400000000000"
       updated_at="1450000000000"
@@ -84,7 +84,7 @@
       rule_id="200"
       reporter="[null]"
       issue_attributes="JIRA=http://jira.com"
-      action_plan_key="PLAN2"
+      action_plan_key="[null]"
       tags="[null]"
       created_at="1400000000000"
       updated_at="1450000000000"
       rule_id="200"
       reporter="[null]"
       issue_attributes="JIRA=http://jira.com"
-      action_plan_key="PLAN2"
+      action_plan_key="[null]"
       tags="[null]"
       created_at="1400000000000"
       updated_at="1450000000000"
index b48d250acaa6bacafc735aa3805a39aa015cb831..018199d9f56d764ee585bd4e0b1a29ee5b5619c2 100644 (file)
@@ -26,7 +26,7 @@
     rule_id="200"
     reporter="[null]"
     issue_attributes="JIRA=http://jira.com"
-    action_plan_key="PLAN1"
+    action_plan_key="[null]"
     tags="tag1,tag2,tag3"
     created_at="1400000000000"
     updated_at="1400000000000"
@@ -56,7 +56,7 @@
     rule_id="200"
     reporter="[null]"
     issue_attributes="JIRA=http://jira.com"
-    action_plan_key="PLAN1"
+    action_plan_key="[null]"
     tags="tag1,tag2,tag3"
     created_at="1400000000000"
     updated_at="1400000000000"
@@ -86,7 +86,7 @@
     rule_id="200"
     reporter="[null]"
     issue_attributes="JIRA=http://jira.com"
-    action_plan_key="PLAN2"
+    action_plan_key="[null]"
     tags="[null]"
     created_at="1400000000000"
     updated_at="1450000000000"
     rule_id="200"
     reporter="[null]"
     issue_attributes="JIRA=http://jira.com"
-    action_plan_key="PLAN1"
+    action_plan_key="[null]"
     tags="[null]"
     created_at="1400000000000"
     updated_at="1400000000000"
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/ws/WebServicesWsTest/list.json b/server/sonar-server/src/test/resources/org/sonar/server/ws/WebServicesWsTest/list.json
deleted file mode 100644 (file)
index 6b3f7a3..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-{"webServices": [
-  {
-    "path": "api/metric",
-    "since": "3.2",
-    "description": "Metrics",
-    "actions": [
-      {
-        "key": "create",
-        "description": "Create metric",
-        "since": "4.1",
-        "deprecatedSince" : "5.3",
-        "internal": false,
-        "post": true,
-        "hasResponseExample": true,
-        "params": [
-          {
-            "key": "name",
-            "required": false
-          },
-          {
-            "key": "severity",
-            "description": "Severity",
-            "required": false,
-            "defaultValue": "BLOCKER",
-            "exampleValue": "INFO",
-            "since":"4.4",
-            "deprecatedSince": "5.2",
-            "possibleValues": ["BLOCKER", "INFO"]
-          }
-        ]
-      },
-      {
-        "key": "show",
-        "since": "3.2",
-        "internal": false,
-        "post": false,
-        "hasResponseExample": true
-      }
-    ]
-  },
-  {
-    "path": "api/webservices",
-    "description": "List web services",
-    "since": "4.2",
-    "actions": [
-      {
-        "key": "list",
-        "since": "4.2",
-        "description": "List web services",
-        "internal": false,
-        "post": false,
-        "hasResponseExample": true,
-        "params": [
-          {
-            "key": "include_internals",
-            "description": "Include web services that are implemented for internal use only. Their forward-compatibility is not assured",
-            "required": false,
-            "defaultValue": "false",
-            "possibleValues": ["true", "false", "yes", "no"]
-          }
-        ]
-      },
-      {
-        "key": "response_example",
-        "since": "4.4",
-        "description": "Display web service response example",
-        "internal": false,
-        "post": false,
-        "hasResponseExample": true,
-        "params": [
-          {
-            "key": "action",
-            "required": true,
-            "description": "Action of the web service",
-            "exampleValue": "search"
-          },
-          {
-            "key": "controller",
-            "required": true,
-            "description": "Controller of the web service",
-            "exampleValue": "api/issues"
-          }
-        ]
-      }
-    ]
-  }
-]}
index 768a23bbcdeb6940c0c029460dd4041dd67cfd8f..62d75c2c8847a43f09719ab6997f62ce00fa9c2c 100644 (file)
@@ -155,11 +155,12 @@ class Api::IssuesController < Api::ApiController
   # -- Mandatory parameters
   # 'issues' is the list of issue keys
   # 'actions' the list of action to execute (expected at least one). Available actions are : assign,set_severity,plan,do_transition,add_tags
+  # Action plans are dropped in 5.5, the 'plan' action has no effect.
   #
   # -- Optional parameters
   # 'assign.assignee' to assign all issues to a user or un-assign.
   # 'set_severity.severity' to change the severity of all issues.
-  # Action Plan are dropped in 5.5'plan.plan' to plan all issues to an action plan or unlink.
+  # Action Plan are dropped in 5.5. 'plan.plan' has no effect. It was to plan all issues to an action plan or unlink.
   # 'do_transition.transition' to execute a transition on all issues.
   # 'add_tags.tags' to add tags on all issues.
   # 'remove_tags.tags' to remove tags on all issues.
index 0c996463aa61e4901ad1064f7ebef3af4d26283a..570ab0acda457696ae1ec4829760ff73a9984180 100644 (file)
@@ -237,11 +237,6 @@ public final class IssueDto implements Serializable {
     return this;
   }
 
-  public IssueDto setActionPlanKey(@Nullable String s) {
-    checkArgument(s == null || s.length() <= 50, "Value is too long for issue action plan: %s", s);
-    return this;
-  }
-
   @CheckForNull
   public String getSeverity() {
     return severity;
diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/find_severities_by_component.xml b/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/find_severities_by_component.xml
deleted file mode 100644 (file)
index 3a272a8..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-<dataset>
-
-  <!-- rule 500 -->
-  <issues
-    id="100"
-    kee="ABCDE-1"
-    component_uuid="CDEF"
-    project_uuid="ABCD"
-    rule_id="500"
-    severity="BLOCKER"
-    manual_severity="[false]"
-    message="[null]"
-    line="200"
-    gap="4.2"
-    status="OPEN"
-    resolution="[null]"
-    checksum="XXX"
-    reporter="[null]"
-    assignee="perceval"
-    author_login="[null]"
-    issue_attributes="JIRA=FOO-1234"
-    issue_creation_date="1366063200000"
-    issue_update_date="1366063200000"
-    issue_close_date="1366063200000"
-    created_at="1400000000000"
-    updated_at="1400000000000"
-    locations="[null]"
-    />
-
-  <issues
-    id="101"
-    kee="ABCDE-2"
-    component_uuid="CDEF"
-    project_uuid="ABCD"
-    rule_id="500"
-    severity="MAJOR"
-    manual_severity="[false]"
-    message="[null]"
-    line="200"
-    gap="4.2"
-    status="OPEN"
-    resolution="[null]"
-    checksum="XXX"
-    reporter="[null]"
-    assignee="perceval"
-    author_login="[null]"
-    issue_attributes="JIRA=FOO-1234"
-    issue_creation_date="1366149600000"
-    issue_update_date="1366149600000"
-    issue_close_date="1366149600000"
-    created_at="1400000000000"
-    updated_at="1400000000000"
-    locations="[null]"
-    />
-
-
-  <!-- rule 501 -->
-  <issues
-    id="102"
-    kee="ABCDE-3"
-    component_uuid="CDEF"
-    project_uuid="ABCD"
-    rule_id="501"
-    severity="BLOCKER"
-    manual_severity="[false]"
-    message="[null]"
-    line="200"
-    gap="4.2"
-    status="OPEN"
-    resolution="[null]"
-    checksum="XXX"
-    reporter="[null]"
-    assignee="perceval"
-    author_login="[null]"
-    issue_attributes="JIRA=FOO-1234"
-    issue_creation_date="1366063200000"
-    issue_update_date="1366063200000"
-    issue_close_date="1366063200000"
-    created_at="1400000000000"
-    updated_at="1400000000000"
-    locations="[null]"
-    />
-</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/update-result.xml b/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/update-result.xml
deleted file mode 100644 (file)
index 4837633..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<dataset>
-  <issues
-      id="100"
-      kee="ABCDE"
-      component_uuid="123"
-      project_uuid="101"
-      rule_id="200"
-      severity="BLOCKER"
-      manual_severity="[false]"
-      message="the message"
-      line="500"
-      gap="3.14"
-      effort="10"
-      status="RESOLVED"
-      resolution="FIXED"
-      checksum="123456789"
-      reporter="[null]"
-      author_login="morgan"
-      assignee="karadoc"
-      issue_attributes="JIRA=FOO-1234"
-      tags="[null]"
-      issue_creation_date="1368828000000"
-      issue_update_date="1368914400000"
-      issue_close_date="1369000800000"
-      created_at="1400000000000"
-      updated_at="1450000000000"
-      action_plan_key="current_sprint"
-      locations="[null]"
-      />
-</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/update.xml b/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/update.xml
deleted file mode 100644 (file)
index cb0d74e..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<dataset>
-  <issues
-      id="100"
-      kee="ABCDE"
-      component_uuid="123"
-      project_uuid="100"
-      rule_id="200"
-      severity="INFO"
-      manual_severity="[false]"
-      message="old"
-      line="[null]"
-      gap="[null]"
-      effort="[null]"
-      status="OPEN"
-      resolution="[null]"
-      checksum="[null]"
-      reporter="[null]"
-      author_login="[null]"
-      assignee="[null]"
-      issue_attributes="[null]"
-      issue_creation_date="[null]"
-      issue_update_date="[null]"
-      issue_close_date="[null]"
-      created_at="1400000000000"
-      updated_at="1400000000000"
-      action_plan_key="[null]"
-      locations="[null]"
-      />
-</dataset>
index 20d7b94c884df4dbe49ee93ce9e4702f2b39cab0..522ebbac329cbb565a144e225cb608c3e46c9f18 100644 (file)
@@ -28,7 +28,7 @@ public class ActionsTest {
   @Test
   public void add_action() {
     Actions actions = new Actions();
-    actions.add("plan");
+    actions.add("assign");
 
     assertThat(actions.list()).hasSize(1);
   }