]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-8867 drop metadata columns from table RULES
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Wed, 22 Mar 2017 15:07:06 +0000 (16:07 +0100)
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Thu, 23 Mar 2017 16:54:56 +0000 (17:54 +0100)
31 files changed:
server/sonar-db-core/src/main/resources/org/sonar/db/version/rows-h2.sql
server/sonar-db-core/src/main/resources/org/sonar/db/version/schema-h2.ddl
server/sonar-db-dao/src/test/resources/org/sonar/db/rule/RuleDaoTest/insert_parameter-result.xml
server/sonar-db-dao/src/test/resources/org/sonar/db/rule/RuleDaoTest/insert_parameter.xml
server/sonar-db-dao/src/test/resources/org/sonar/db/rule/RuleDaoTest/selectEnabled.xml
server/sonar-db-dao/src/test/resources/org/sonar/db/rule/RuleDaoTest/selectNonManual.xml
server/sonar-db-dao/src/test/resources/org/sonar/db/rule/RuleDaoTest/select_parameters_by_rule_key.xml
server/sonar-db-dao/src/test/resources/org/sonar/db/rule/RuleDaoTest/shared.xml
server/sonar-db-dao/src/test/resources/org/sonar/db/rule/RuleDaoTest/update.xml
server/sonar-db-dao/src/test/resources/org/sonar/db/rule/RuleDaoTest/update_parameter-result.xml
server/sonar-db-dao/src/test/resources/org/sonar/db/rule/RuleDaoTest/update_parameter.xml
server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v64/DbVersion64.java
server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v64/DropMetadataColumnsFromRules.java [new file with mode: 0644]
server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v64/DbVersion64Test.java
server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v64/DropMetadataColumnsFromRulesTest.java [new file with mode: 0644]
server/sonar-db-migration/src/test/resources/org/sonar/server/platform/db/migration/version/v64/DropMetadataColumnsFromRulesTest/rules.sql [new file with mode: 0644]
server/sonar-server/src/test/resources/org/sonar/server/computation/task/projectanalysis/step/PersistIssuesStepTest/insert_new_issue.xml
server/sonar-server/src/test/resources/org/sonar/server/computation/task/projectanalysis/step/PersistIssuesStepTest/shared.xml
server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueIndexerTest/index.xml
server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueIndexerTest/index_project.xml
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/extract_file_path.xml
server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/many_projects.xml
server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/one_issue.xml
server/sonar-server/src/test/resources/org/sonar/server/issue/index/IssueResultSetIteratorTest/shared.xml
server/sonar-server/src/test/resources/org/sonar/server/platform/BackendCleanupTest/shared.xml
server/sonar-server/src/test/resources/org/sonar/server/qualityprofile/index/ActiveRuleIndexerTest/index.xml
server/sonar-server/src/test/resources/org/sonar/server/qualityprofile/index/ActiveRuleResultSetIteratorTest/active_rule_with_inherited_inheritance.xml
server/sonar-server/src/test/resources/org/sonar/server/qualityprofile/index/ActiveRuleResultSetIteratorTest/active_rule_with_overrides_inheritance.xml
server/sonar-server/src/test/resources/org/sonar/server/qualityprofile/index/ActiveRuleResultSetIteratorTest/one_active_rule.xml
server/sonar-server/src/test/resources/org/sonar/server/qualityprofile/index/ActiveRuleResultSetIteratorTest/shared.xml

index a4705b31fc7d8a89630fd06766d9ef1dd8b352ec..0dd7c8e771d16599b093ace0515023a7ae14d361 100644 (file)
@@ -549,6 +549,7 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1613');
 INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1614');
 INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1615');
 INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1616');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1617');
 
 INSERT INTO USERS(ID, LOGIN, NAME, EMAIL, EXTERNAL_IDENTITY, EXTERNAL_IDENTITY_PROVIDER, USER_LOCAL, CRYPTED_PASSWORD, SALT, IS_ROOT, CREATED_AT, UPDATED_AT) VALUES (1, 'admin', 'Administrator', '', 'admin', 'sonarqube', true, 'a373a0e667abb2604c1fd571eb4ad47fe8cc0878', '48bc4b0d93179b5103fd3885ea9119498e9d161b', false, '1418215735482', '1418215735482');
 ALTER TABLE USERS ALTER COLUMN ID RESTART WITH 2;
index d2a2e5c4dca2ba21746c76ed9de1edefe44530e0..d662a5fd67bf985863944c60aaa1c6325d314372 100644 (file)
@@ -138,18 +138,10 @@ CREATE TABLE "RULES" (
   "NAME" VARCHAR(200),
   "STATUS" VARCHAR(40),
   "LANGUAGE" VARCHAR(20),
-  "NOTE_DATA" CLOB(2147483647),
-  "NOTE_USER_LOGIN" VARCHAR(255),
-  "NOTE_CREATED_AT" TIMESTAMP,
-  "NOTE_UPDATED_AT" TIMESTAMP,
-  "REMEDIATION_FUNCTION" VARCHAR(20),
   "DEF_REMEDIATION_FUNCTION" VARCHAR(20),
-  "REMEDIATION_GAP_MULT" VARCHAR(20),
   "DEF_REMEDIATION_GAP_MULT" VARCHAR(20),
-  "REMEDIATION_BASE_EFFORT" VARCHAR(20),
   "DEF_REMEDIATION_BASE_EFFORT" VARCHAR(20),
   "GAP_DESCRIPTION" VARCHAR(4000),
-  "TAGS" VARCHAR(4000),
   "SYSTEM_TAGS" VARCHAR(4000),
   "RULE_TYPE" TINYINT,
   "CREATED_AT" BIGINT,
index 09c5a0403c7e57357535a6149fbb1462b3f54cf8..36b0c887fcdb001080b27c65eb9bfb6acf818357 100644 (file)
@@ -1,12 +1,27 @@
 <dataset>
-    <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="NewRuleKey" plugin_name="plugin" name="new name" description="new description" status="DEPRECATED"
-           plugin_config_key="NewConfigKey" priority="0" is_template="[true]" language="dart" template_id="3"
-           note_data="[null]" note_user_login="[null]" note_created_at="[null]" note_updated_at="[null]"
-           remediation_function="linear" def_remediation_function="linear_offset"
-           remediation_gap_mult="1h" def_remediation_gap_mult="5d"
-           remediation_base_effort="5min" def_remediation_base_effort="10h"
-           gap_description="squid.S115.effortToFix"
-           created_at="[null]" updated_at="[null]"
-            />
-  <rules_parameters id="1" rule_id="1" name="max" param_type="INTEGER" default_value="30" description="My Parameter"/>
+  <rules system_tags="[null]"
+         id="1"
+         plugin_rule_key="NewRuleKey"
+         plugin_name="plugin"
+         name="new name"
+         description="new description"
+         status="DEPRECATED"
+         plugin_config_key="NewConfigKey"
+         priority="0"
+         is_template="[true]"
+         language="dart"
+         template_id="3"
+         def_remediation_function="linear_offset"
+         def_remediation_gap_mult="5d"
+         def_remediation_base_effort="10h"
+         gap_description="squid.S115.effortToFix"
+         created_at="[null]"
+         updated_at="[null]"
+  />
+  <rules_parameters id="1"
+                    rule_id="1"
+                    name="max"
+                    param_type="INTEGER"
+                    default_value="30"
+                    description="My Parameter"/>
 </dataset>
index 82a2fb6c47248218c5c0f985ae11e93d476aa986..bf6dd1ccf8ee2db0cd5df4cb0fcb2ade14d3b4da 100644 (file)
@@ -1,11 +1,21 @@
 <dataset>
-    <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="NewRuleKey" plugin_name="plugin" name="new name" description="new description" status="DEPRECATED"
-           plugin_config_key="NewConfigKey" priority="0" is_template="[true]" language="dart" template_id="3"
-           note_data="[null]" note_user_login="[null]" note_created_at="[null]" note_updated_at="[null]"
-           remediation_function="linear" def_remediation_function="linear_offset"
-           remediation_gap_mult="1h" def_remediation_gap_mult="5d"
-           remediation_base_effort="5min" def_remediation_base_effort="10h"
-           gap_description="squid.S115.effortToFix"
-           created_at="[null]" updated_at="[null]"
-            />
+  <rules system_tags="[null]"
+         id="1"
+         plugin_rule_key="NewRuleKey"
+         plugin_name="plugin"
+         name="new name"
+         description="new description"
+         status="DEPRECATED"
+         plugin_config_key="NewConfigKey"
+         priority="0"
+         is_template="[true]"
+         language="dart"
+         template_id="3"
+         def_remediation_function="linear_offset"
+         def_remediation_gap_mult="5d"
+         def_remediation_base_effort="10h"
+         gap_description="squid.S115.effortToFix"
+         created_at="[null]"
+         updated_at="[null]"
+  />
 </dataset>
index e17e6ca13db0190e77a23929183ad3ea81dac738..66427866042d5d4658a70ff1841d8c60dcb2c1ac 100644 (file)
@@ -1,21 +1,35 @@
 <dataset>
 
-  <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="AvoidNull" plugin_name="checkstyle" name="Avoid Null" description="Should avoid NULL" status="READY"
-         note_data="Rule note with accents éèà" note_user_login="polop.palap" note_created_at="2013-12-25" description_format="HTML"
-         remediation_function="LINEAR" def_remediation_function="LINEAR_OFFSET"
-         remediation_gap_mult="1h" def_remediation_gap_mult="5d"
-         remediation_base_effort="5min" def_remediation_base_effort="10h"
+  <rules system_tags="[null]"
+         id="1"
+         plugin_rule_key="AvoidNull"
+         plugin_name="checkstyle"
+         name="Avoid Null"
+         description="Should avoid NULL"
+         description_format="HTML"
+         status="READY"
+         def_remediation_function="LINEAR_OFFSET"
+         def_remediation_gap_mult="5d"
+         def_remediation_base_effort="10h"
          gap_description="squid.S115.effortToFix"
-         created_at="1500000000000" updated_at="1600000000000"
+         created_at="1500000000000"
+         updated_at="1600000000000"
   />
 
-  <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="AvoidNull" plugin_name="squid" name="Avoid Null" description="Should avoid NULL" status="REMOVED"
-         note_data="[null]" note_user_login="[null]" note_created_at="[null]" description_format="HTML"
-         remediation_function="[null]" def_remediation_function="[null]"
-         remediation_gap_mult="[null]" def_remediation_gap_mult="[null]"
-         remediation_base_effort="[null]" def_remediation_base_effort="[null]"
+  <rules system_tags="[null]"
+         id="2"
+         plugin_rule_key="AvoidNull"
+         plugin_name="squid"
+         name="Avoid Null"
+         description="Should avoid NULL"
+         description_format="HTML"
+         status="REMOVED"
+         def_remediation_function="[null]"
+         def_remediation_gap_mult="[null]"
+         def_remediation_base_effort="[null]"
          gap_description="[null]"
-         created_at="1500000000000" updated_at="1600000000000"
+         created_at="1500000000000"
+         updated_at="1600000000000"
   />
 
 </dataset>
index f4c6a9bc32f0d384c9a72b904cbf7a11615076ae..3d49bf1ac0a870db202eb1de240b7260c22afc0e 100644 (file)
@@ -1,10 +1,24 @@
 <dataset>
 
-  <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="AvoidNull" plugin_name="checkstyle"
-         name="Avoid Null" description="Should avoid NULL" status="READY" description_format="HTML"
-         created_at="1500000000000" updated_at="1600000000000"/>
-  <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="AvoidNull" plugin_name="manual" name="Manual Rule"
-         description="Should not appear" status="READY" description_format="HTML"
-         created_at="1500000000000" updated_at="1600000000000"/>
+  <rules system_tags="[null]"
+         id="1"
+         plugin_rule_key="AvoidNull"
+         plugin_name="checkstyle"
+         name="Avoid Null"
+         description="Should avoid NULL"
+         status="READY"
+         description_format="HTML"
+         created_at="1500000000000"
+         updated_at="1600000000000"/>
+  <rules system_tags="[null]"
+         id="2"
+         plugin_rule_key="AvoidNull"
+         plugin_name="manual"
+         name="Manual Rule"
+         description="Should not appear"
+         status="READY"
+         description_format="HTML"
+         created_at="1500000000000"
+         updated_at="1600000000000"/>
 
 </dataset>
index 65d9b4e5a45c17e239f9cc576611d75bbf2d4c40..f96c135914798359259d63c4ea48729a1e4425e1 100644 (file)
@@ -1,15 +1,35 @@
 <dataset>
 
-  <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="AvoidNull" plugin_name="checkstyle"
-         name="Avoid Null" description="Should avoid NULL" status="READY"
-         created_at="1500000000000" updated_at="1600000000000"/>
-  <rules_parameters id="1" rule_id="1" name="myParameter" param_type="plop" default_value="plouf"
+  <rules system_tags="[null]"
+         id="1"
+         plugin_rule_key="AvoidNull"
+         plugin_name="checkstyle"
+         name="Avoid Null"
+         description="Should avoid NULL"
+         status="READY"
+         created_at="1500000000000"
+         updated_at="1600000000000"/>
+  <rules_parameters id="1"
+                    rule_id="1"
+                    name="myParameter"
+                    param_type="plop"
+                    default_value="plouf"
                     description="My Parameter"/>
 
-  <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="Unused" plugin_name="unused" name="Unused Rule"
-         description="Not used" status="REMOVED"
-         created_at="1500000000000" updated_at="1600000000000"/>
-  <rules_parameters id="2" rule_id="2" name="otherParam" param_type="plop" default_value="plouf"
+  <rules system_tags="[null]"
+         id="2"
+         plugin_rule_key="Unused"
+         plugin_name="unused"
+         name="Unused Rule"
+         description="Not used"
+         status="REMOVED"
+         created_at="1500000000000"
+         updated_at="1600000000000"/>
+  <rules_parameters id="2"
+                    rule_id="2"
+                    name="otherParam"
+                    param_type="plop"
+                    default_value="plouf"
                     description="Other Parameter"/>
 
 </dataset>
index 25f223c5f55b3a3e344e0433fe476948dede443f..2619953014a126a3804cdeb79f3220f1bf71750e 100644 (file)
@@ -10,7 +10,6 @@
          status="READY"
          is_template="[false]"
          template_id="[null]"
-         tags="bug,performance"
          system_tags="cwe"
          created_at="1500000000000"
          updated_at="1600000000000"
@@ -26,7 +25,6 @@
          status="BETA"
          is_template="[false]"
          template_id="[null]"
-         tags="[null]"
          system_tags="[null]"
          created_at="1500000000000"
          updated_at="1600000000000"
@@ -42,7 +40,6 @@
          status="REMOVED"
          is_template="[false]"
          template_id="[null]"
-         tags="[null]"
          system_tags="[null]"
          created_at="1500000000000"
          updated_at="1600000000000"
index b862d51da4395319ff37e1403bb781720d455f0d..eed68c92290efad893b6f1981e799e9921b4e7be 100644 (file)
@@ -1,7 +1,6 @@
 <dataset>
 
-  <rules tags="[null]"
-         system_tags="[null]"
+  <rules system_tags="[null]"
          id="1"
          plugin_rule_key="AvoidNull"
          plugin_name="checkstyle"
index 3907b7d23c6d7185890a8db450b40bb4fbf17bf0..6f7b4c7f679848e03008dd2f10f64a22d6145b46 100644 (file)
@@ -1,8 +1,18 @@
 <dataset>
-  <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="AvoidNull" plugin_name="checkstyle"
-         name="Avoid Null" description="Should avoid NULL" status="READY"
-         created_at="1500000000000" updated_at="1600000000000"/>
+  <rules system_tags="[null]"
+         id="1"
+         plugin_rule_key="AvoidNull"
+         plugin_name="checkstyle"
+         name="Avoid Null"
+         description="Should avoid NULL"
+         status="READY"
+         created_at="1500000000000"
+         updated_at="1600000000000"/>
 
-  <rules_parameters id="1" rule_id="1" name="max" param_type="STRING" default_value="^[a-z]+(\.[a-z][a-z0-9]*)*$"
+  <rules_parameters id="1"
+                    rule_id="1"
+                    name="max"
+                    param_type="STRING"
+                    default_value="^[a-z]+(\.[a-z][a-z0-9]*)*$"
                     description="Regular expression used to check the package names against."/>
 </dataset>
index 2eb61cc702971ce922727f32d6da675cbdeb9e14..26bc299306ce8cc6509a1cb6ff54578911258a94 100644 (file)
@@ -1,7 +1,18 @@
 <dataset>
-  <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="AvoidNull" plugin_name="checkstyle"
-         name="Avoid Null" description="Should avoid NULL" status="READY"
-         created_at="1500000000000" updated_at="1600000000000"/>
+  <rules system_tags="[null]"
+         id="1"
+         plugin_rule_key="AvoidNull"
+         plugin_name="checkstyle"
+         name="Avoid Null"
+         description="Should avoid NULL"
+         status="READY"
+         created_at="1500000000000"
+         updated_at="1600000000000"/>
 
-  <rules_parameters id="1" rule_id="1" name="max" param_type="INTEGER" default_value="30" description="My Parameter"/>
+  <rules_parameters id="1"
+                    rule_id="1"
+                    name="max"
+                    param_type="INTEGER"
+                    default_value="30"
+                    description="My Parameter"/>
 </dataset>
index 5ee08ddf7b90cac190bc64ab6ae5a6eb0850f69d..e000208527b7103002ff44b0a52488463268a15f 100644 (file)
@@ -43,6 +43,7 @@ public class DbVersion64 implements DbVersion {
       .add(1613, "Add index LOADED_TEMPLATES_TYPE", AddIndexLoadedTemplatesType.class)
       .add(1614, "Upgrade loaded template entries for quality profiles", UpgradeQualityTemplateLoadedTemplates.class)
       .add(1615, "Create table RULES_METADATA", CreateRulesMetadata.class)
-      .add(1616, "Populate table RULES_METADATA", PopulateRulesMetadata.class);
+      .add(1616, "Populate table RULES_METADATA", PopulateRulesMetadata.class)
+      .add(1617, "Drop metadata columns from RULES", DropMetadataColumnsFromRules.class);
   }
 }
diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v64/DropMetadataColumnsFromRules.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v64/DropMetadataColumnsFromRules.java
new file mode 100644 (file)
index 0000000..c997165
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+package org.sonar.server.platform.db.migration.version.v64;
+
+import java.sql.SQLException;
+import org.sonar.db.Database;
+import org.sonar.server.platform.db.migration.sql.DropColumnsBuilder;
+import org.sonar.server.platform.db.migration.step.DdlChange;
+
+public class DropMetadataColumnsFromRules extends DdlChange {
+
+  private static final String TABLE_RULES = "rules";
+
+  public DropMetadataColumnsFromRules(Database db) {
+    super(db);
+  }
+
+  @Override
+  public void execute(Context context) throws SQLException {
+    context.execute(new DropColumnsBuilder(
+      getDialect(), TABLE_RULES,
+      "note_data", "note_user_login", "note_created_at", "note_updated_at",
+      "remediation_function", "remediation_gap_mult", "remediation_base_effort",
+      "tags")
+        .build());
+  }
+}
index 4ca458bbdde39ed8a0f24dd7c0a869678d6d425c..727a9de26f4aa347a25fdb6d65f817e1dd135ff0 100644 (file)
@@ -35,7 +35,7 @@ public class DbVersion64Test {
 
   @Test
   public void verify_migration_count() {
-    verifyMigrationCount(underTest, 17);
+    verifyMigrationCount(underTest, 18);
   }
 
 }
diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v64/DropMetadataColumnsFromRulesTest.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v64/DropMetadataColumnsFromRulesTest.java
new file mode 100644 (file)
index 0000000..6834f33
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+package org.sonar.server.platform.db.migration.version.v64;
+
+import java.sql.SQLException;
+import org.junit.Rule;
+import org.junit.Test;
+import org.sonar.db.CoreDbTester;
+
+public class DropMetadataColumnsFromRulesTest {
+
+  private static final String TABLE_RULES = "rules";
+
+  @Rule
+  public CoreDbTester db = CoreDbTester.createForSchema(DropMetadataColumnsFromRulesTest.class, "rules.sql");
+
+  private DropMetadataColumnsFromRules underTest = new DropMetadataColumnsFromRules(db.database());
+
+  @Test
+  public void execute_drops_metadata_columns_from_table_RULES() throws SQLException {
+    underTest.execute();
+
+    db.assertColumnDoesNotExist(TABLE_RULES, "note_data");
+    db.assertColumnDoesNotExist(TABLE_RULES, "note_user_login");
+    db.assertColumnDoesNotExist(TABLE_RULES, "note_created_at");
+    db.assertColumnDoesNotExist(TABLE_RULES, "note_updated_at");
+    db.assertColumnDoesNotExist(TABLE_RULES, "remediation_function");
+    db.assertColumnDoesNotExist(TABLE_RULES, "remediation_gap_mult");
+    db.assertColumnDoesNotExist(TABLE_RULES, "remediation_base_effort");
+    db.assertColumnDoesNotExist(TABLE_RULES, "tags");
+  }
+}
diff --git a/server/sonar-db-migration/src/test/resources/org/sonar/server/platform/db/migration/version/v64/DropMetadataColumnsFromRulesTest/rules.sql b/server/sonar-db-migration/src/test/resources/org/sonar/server/platform/db/migration/version/v64/DropMetadataColumnsFromRulesTest/rules.sql
new file mode 100644 (file)
index 0000000..de12d87
--- /dev/null
@@ -0,0 +1,31 @@
+CREATE TABLE "RULES" (
+  "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
+  "PLUGIN_RULE_KEY" VARCHAR(200) NOT NULL,
+  "PLUGIN_NAME" VARCHAR(255) NOT NULL,
+  "DESCRIPTION" VARCHAR(16777215),
+  "DESCRIPTION_FORMAT" VARCHAR(20),
+  "PRIORITY" INTEGER,
+  "IS_TEMPLATE" BOOLEAN DEFAULT FALSE,
+  "TEMPLATE_ID" INTEGER,
+  "PLUGIN_CONFIG_KEY" VARCHAR(200),
+  "NAME" VARCHAR(200),
+  "STATUS" VARCHAR(40),
+  "LANGUAGE" VARCHAR(20),
+  "NOTE_DATA" CLOB(2147483647),
+  "NOTE_USER_LOGIN" VARCHAR(255),
+  "NOTE_CREATED_AT" TIMESTAMP,
+  "NOTE_UPDATED_AT" TIMESTAMP,
+  "REMEDIATION_FUNCTION" VARCHAR(20),
+  "DEF_REMEDIATION_FUNCTION" VARCHAR(20),
+  "REMEDIATION_GAP_MULT" VARCHAR(20),
+  "DEF_REMEDIATION_GAP_MULT" VARCHAR(20),
+  "REMEDIATION_BASE_EFFORT" VARCHAR(20),
+  "DEF_REMEDIATION_BASE_EFFORT" VARCHAR(20),
+  "GAP_DESCRIPTION" VARCHAR(4000),
+  "TAGS" VARCHAR(4000),
+  "SYSTEM_TAGS" VARCHAR(4000),
+  "RULE_TYPE" TINYINT,
+  "CREATED_AT" BIGINT,
+  "UPDATED_AT" BIGINT
+);
+CREATE UNIQUE INDEX "RULES_REPO_KEY" ON "RULES" ("PLUGIN_NAME", "PLUGIN_RULE_KEY");
index 2c62945895ae7e439ea65aa2373d683ee309349e..fb442813aae2de05c970b676e3f9eab418a93feb 100644 (file)
@@ -1,14 +1,24 @@
 <dataset>
 
-  <rules id="1" plugin_rule_key="S01" plugin_name="xoo" name="name" description="description" status="READY"
-         plugin_config_key="[null]" priority="0" is_template="[true]" language="xoo"  template_id="[null]"
-         note_data="[null]" note_user_login="[null]" note_created_at="[null]" note_updated_at="[null]"
-         remediation_function="LINEAR_OFFSET" def_remediation_function="LINEAR_OFFSET"
-         remediation_coeff="1h" def_remediation_coeff="5d"
-         remediation_offset="5min" def_remediation_offset="10h"
-         effort_to_fix_description="[null]" description_format="MARKDOWN"
-         tags="[null]" system_tags="[null]"
-         created_at="1500000000000" updated_at="1500000000000"
-      />
+  <rules id="1"
+         plugin_rule_key="S01"
+         plugin_name="xoo"
+         name="name"
+         description="description"
+         status="READY"
+         plugin_config_key="[null]"
+         priority="0"
+         is_template="[true]"
+         language="xoo"
+         template_id="[null]"
+         def_remediation_function="LINEAR_OFFSET"
+         def_remediation_coeff="5d"
+         def_remediation_offset="10h"
+         effort_to_fix_description="[null]"
+         description_format="MARKDOWN"
+         system_tags="[null]"
+         created_at="1500000000000"
+         updated_at="1500000000000"
+  />
 
 </dataset>
index c014ac83323171a29d24eb697bfe89eccf0b926d..5398346c73f6df5e1ee5a5136504765f52e1096c 100644 (file)
@@ -1,15 +1,25 @@
 <dataset>
 
-  <rules id="1" plugin_rule_key="S01" plugin_name="xoo" name="name" description="description" status="READY"
-         plugin_config_key="[null]" priority="0" is_template="[true]" language="xoo"  template_id="[null]"
-         note_data="[null]" note_user_login="[null]" note_created_at="[null]" note_updated_at="[null]"
-         remediation_function="LINEAR" def_remediation_function="LINEAR_OFFSET"
-         remediation_gap_mult="1h" def_remediation_gap_mult="5d"
-         remediation_base_effort="5min" def_remediation_base_effort="10h"
-         gap_description="[null]" description_format="MARKDOWN"
-         tags="[null]" system_tags="[null]"
-         created_at="1500000000000" updated_at="1500000000000"
-      />
+  <rules id="1"
+         plugin_rule_key="S01"
+         plugin_name="xoo"
+         name="name"
+         description="description"
+         status="READY"
+         plugin_config_key="[null]"
+         priority="0"
+         is_template="[true]"
+         language="xoo"
+         template_id="[null]"
+         def_remediation_function="LINEAR_OFFSET"
+         def_remediation_gap_mult="5d"
+         def_remediation_base_effort="10h"
+         gap_description="[null]"
+         description_format="MARKDOWN"
+         system_tags="[null]"
+         created_at="1500000000000"
+         updated_at="1500000000000"
+  />
 
   <issues
       id="1"
@@ -39,6 +49,6 @@
       updated_at="1300000000000"
       locations="[null]"
       issue_type="[null]"
-      />
+  />
 
 </dataset>
index 27fe454d76f310e167b5af673378127d1ced72f6..d2b73d2647dafca144fc28ae78c1ed7277a8cf59 100644 (file)
@@ -1,6 +1,5 @@
 <dataset>
   <rules id="1"
-         tags="[null]"
          system_tags="[null]"
          name="Avoid Cycles"
          plugin_rule_key="AvoidCycles"
index 7784843c4a724c7210771875478d6f6dd7ac0798..f3cb6776b5704ca006db695e5909090a8d27635b 100644 (file)
@@ -1,6 +1,5 @@
 <dataset>
   <rules id="1"
-         tags="[null]"
          system_tags="[null]"
          name="Avoid Cycles"
          plugin_rule_key="AvoidCycles"
index b25c4bf8c308d6ba99c5d1245eec348be3f33520..ba40134ef9d5e98ff8af90f3e5f2b6cacf799685 100644 (file)
@@ -1,6 +1,5 @@
 <dataset>
-  <rules tags="[null]"
-         system_tags="[null]"
+  <rules system_tags="[null]"
          id="200"
          name="Avoid Cycles"
          plugin_rule_key="AvoidCycles"
             kee="pom"
             name="pom.xml"/>
 
-  <issues
-    id="1"
-    kee="ABC"
-    resolution="FIXED"
-    status="RESOLVED"
-    severity="BLOCKER"
-    manual_severity="[false]"
-    assignee="guy1"
-    author_login="guy2"
-    checksum="FFFFF"
-    gap="[null]"
-    effort="10"
-    message="[null]"
-    line="444"
-    component_uuid="FILE"
-    project_uuid="PROJECT"
-    rule_id="200"
-    reporter="[null]"
-    issue_attributes="JIRA=http://jira.com"
-    action_plan_key="[null]"
-    tags="tag1,tag2,tag3"
-    created_at="1400000000000"
-    updated_at="1400000000000"
-    issue_creation_date="1115848800000"
-    issue_update_date="1356994800000"
-    issue_close_date="[null]"
-    locations="[null]"
-    issue_type="1"/>
+  <issues id="1"
+          kee="ABC"
+          resolution="FIXED"
+          status="RESOLVED"
+          severity="BLOCKER"
+          manual_severity="[false]"
+          assignee="guy1"
+          author_login="guy2"
+          checksum="FFFFF"
+          gap="[null]"
+          effort="10"
+          message="[null]"
+          line="444"
+          component_uuid="FILE"
+          project_uuid="PROJECT"
+          rule_id="200"
+          reporter="[null]"
+          issue_attributes="JIRA=http://jira.com"
+          action_plan_key="[null]"
+          tags="tag1,tag2,tag3"
+          created_at="1400000000000"
+          updated_at="1400000000000"
+          issue_creation_date="1115848800000"
+          issue_update_date="1356994800000"
+          issue_close_date="[null]"
+          locations="[null]"
+          issue_type="1"/>
 
   <issues
-    id="2"
-    kee="DEF"
-    resolution="[null]"
-    status="OPEN"
-    severity="MAJOR"
-    manual_severity="[false]"
-    assignee="guy2"
-    author_login="[null]"
-    checksum="FFFFF"
-    gap="[null]"
-    effort="15"
-    message="[null]"
-    line="444"
-    component_uuid="ROOT_FILE"
-    project_uuid="PROJECT"
-    rule_id="200"
-    reporter="[null]"
-    issue_attributes="JIRA=http://jira.com"
-    action_plan_key="[null]"
-    tags="[null]"
-    created_at="1400000000000"
-    updated_at="1450000000000"
-    issue_creation_date="1115848800000"
-    issue_update_date="1368828000000"
-    issue_close_date="[null]"
-    locations="[null]"
-    issue_type="1"/>
+      id="2"
+      kee="DEF"
+      resolution="[null]"
+      status="OPEN"
+      severity="MAJOR"
+      manual_severity="[false]"
+      assignee="guy2"
+      author_login="[null]"
+      checksum="FFFFF"
+      gap="[null]"
+      effort="15"
+      message="[null]"
+      line="444"
+      component_uuid="ROOT_FILE"
+      project_uuid="PROJECT"
+      rule_id="200"
+      reporter="[null]"
+      issue_attributes="JIRA=http://jira.com"
+      action_plan_key="[null]"
+      tags="[null]"
+      created_at="1400000000000"
+      updated_at="1450000000000"
+      issue_creation_date="1115848800000"
+      issue_update_date="1368828000000"
+      issue_close_date="[null]"
+      locations="[null]"
+      issue_type="1"/>
 
   <issues
-    id="3"
-    kee="EFG"
-    resolution="[null]"
-    status="OPEN"
-    severity="MAJOR"
-    manual_severity="[false]"
-    assignee="guy2"
-    author_login="[null]"
-    checksum="FFFFF"
-    gap="[null]"
-    effort="15"
-    message="[null]"
-    line="[null]"
-    component_uuid="PROJECT"
-    project_uuid="PROJECT"
-    rule_id="200"
-    reporter="[null]"
-    issue_attributes="JIRA=http://jira.com"
-    action_plan_key="[null]"
-    tags="[null]"
-    created_at="1400000000000"
-    updated_at="1450000000000"
-    issue_creation_date="1115848800000"
-    issue_update_date="1368828000000"
-    issue_close_date="[null]"
-    locations="[null]"
-    issue_type="1"/>
+      id="3"
+      kee="EFG"
+      resolution="[null]"
+      status="OPEN"
+      severity="MAJOR"
+      manual_severity="[false]"
+      assignee="guy2"
+      author_login="[null]"
+      checksum="FFFFF"
+      gap="[null]"
+      effort="15"
+      message="[null]"
+      line="[null]"
+      component_uuid="PROJECT"
+      project_uuid="PROJECT"
+      rule_id="200"
+      reporter="[null]"
+      issue_attributes="JIRA=http://jira.com"
+      action_plan_key="[null]"
+      tags="[null]"
+      created_at="1400000000000"
+      updated_at="1450000000000"
+      issue_creation_date="1115848800000"
+      issue_update_date="1368828000000"
+      issue_close_date="[null]"
+      locations="[null]"
+      issue_type="1"/>
 
   <issues
-    id="4"
-    kee="FGH"
-    resolution="[null]"
-    status="OPEN"
-    severity="MAJOR"
-    manual_severity="[false]"
-    assignee="guy2"
-    author_login="[null]"
-    checksum="FFFFF"
-    gap="[null]"
-    effort="15"
-    message="[null]"
-    line="[null]"
-    component_uuid="MODULE"
-    project_uuid="PROJECT"
-    rule_id="200"
-    reporter="[null]"
-    issue_attributes="JIRA=http://jira.com"
-    action_plan_key="[null]"
-    tags="[null]"
-    created_at="1400000000000"
-    updated_at="1450000000000"
-    issue_creation_date="1115848800000"
-    issue_update_date="1368828000000"
-    issue_close_date="[null]"
-    locations="[null]"
-    issue_type="1"/>
+      id="4"
+      kee="FGH"
+      resolution="[null]"
+      status="OPEN"
+      severity="MAJOR"
+      manual_severity="[false]"
+      assignee="guy2"
+      author_login="[null]"
+      checksum="FFFFF"
+      gap="[null]"
+      effort="15"
+      message="[null]"
+      line="[null]"
+      component_uuid="MODULE"
+      project_uuid="PROJECT"
+      rule_id="200"
+      reporter="[null]"
+      issue_attributes="JIRA=http://jira.com"
+      action_plan_key="[null]"
+      tags="[null]"
+      created_at="1400000000000"
+      updated_at="1450000000000"
+      issue_creation_date="1115848800000"
+      issue_update_date="1368828000000"
+      issue_close_date="[null]"
+      locations="[null]"
+      issue_type="1"/>
 
 </dataset>
index b7765c8a690c4a1ffa574ac4346d125aec25fe23..b49c887546e176c84fe140c281cbd8d3809a55d5 100644 (file)
@@ -1,6 +1,5 @@
 <dataset>
-  <rules tags="[null]"
-         system_tags="[null]"
+  <rules system_tags="[null]"
          id="200"
          name="Avoid Cycles"
          plugin_rule_key="AvoidCycles"
index 64f6bd3d24ae394ce1d2b8b4959fa09170ce1b0b..6364fe7b66203614679ab8fe523e448dcf39f7ce 100644 (file)
@@ -1,6 +1,5 @@
 <dataset>
   <rules id="1"
-         tags="[null]"
          system_tags="[null]"
          name="Avoid Cycles"
          plugin_rule_key="AvoidCycles"
             kee="the_file_1"
             name="TheFile1"/>
 
-  <issues id="1"
-          kee="ABCDE"
-          resolution="FIXED"
-          status="RESOLVED"
-          severity="BLOCKER"
-          manual_severity="[false]"
-          assignee="winner"
-          author_login="[null]"
-          checksum="FFFFF"
-          gap="[null]"
-          effort="[null]"
-          message="[null]"
-          line="444"
-          component_uuid="THE_FILE_1"
-          project_uuid="THE_PROJECT_1"
-          rule_id="1"
-          reporter="[null]"
-          issue_attributes="JIRA=http://jira.com"
-          action_plan_key="[null]"
-          created_at="1500000000000"
-          updated_at="1550000000000"
-          issue_creation_date="1115848800000"
-          issue_update_date="1368828000000"
-          issue_close_date="[null]"
-          locations="[null]"
-          issue_type="1"
+  <issues
+      id="1"
+      kee="ABCDE"
+      resolution="FIXED"
+      status="RESOLVED"
+      severity="BLOCKER"
+      manual_severity="[false]"
+      assignee="winner"
+      author_login="[null]"
+      checksum="FFFFF"
+      gap="[null]"
+      effort="[null]"
+      message="[null]"
+      line="444"
+      component_uuid="THE_FILE_1"
+      project_uuid="THE_PROJECT_1"
+      rule_id="1"
+      reporter="[null]"
+      issue_attributes="JIRA=http://jira.com"
+      action_plan_key="[null]"
+      created_at="1500000000000"
+      updated_at="1550000000000"
+      issue_creation_date="1115848800000"
+      issue_update_date="1368828000000"
+      issue_close_date="[null]"
+      locations="[null]"
+      issue_type="1"
   />
 
   <issues id="2"
index cc7c0e8bc5636776035e382624fbe0de7378cc75..76fe1f7c612d4aaa91b2bd80629fba093f20e1d2 100644 (file)
@@ -1,6 +1,5 @@
 <dataset>
-  <rules tags="[null]"
-         system_tags="[null]"
+  <rules system_tags="[null]"
          id="200"
          name="Avoid Cycles"
          plugin_rule_key="AvoidCycles"
             name="Action"/>
 
   <issues
-    id="1"
-    kee="ABC"
-    resolution="FIXED"
-    status="RESOLVED"
-    severity="BLOCKER"
-    manual_severity="[false]"
-    assignee="guy1"
-    author_login="guy2"
-    checksum="FFFFF"
-    gap="2"
-    effort="10"
-    message="[null]"
-    line="444"
-    component_uuid="FILE1"
-    project_uuid="PROJECT1"
-    rule_id="200"
-    reporter="[null]"
-    issue_attributes="JIRA=http://jira.com"
-    action_plan_key="PLAN1"
-    tags="tag1,tag2,tag3"
-    created_at="1400000000000"
-    updated_at="1400000000000"
-    issue_creation_date="1115848800000"
-    issue_update_date="1356994800000"
-    issue_close_date="[null]"
-    locations="[null]"
-    issue_type="2"
+      id="1"
+      kee="ABC"
+      resolution="FIXED"
+      status="RESOLVED"
+      severity="BLOCKER"
+      manual_severity="[false]"
+      assignee="guy1"
+      author_login="guy2"
+      checksum="FFFFF"
+      gap="2"
+      effort="10"
+      message="[null]"
+      line="444"
+      component_uuid="FILE1"
+      project_uuid="PROJECT1"
+      rule_id="200"
+      reporter="[null]"
+      issue_attributes="JIRA=http://jira.com"
+      action_plan_key="PLAN1"
+      tags="tag1,tag2,tag3"
+      created_at="1400000000000"
+      updated_at="1400000000000"
+      issue_creation_date="1115848800000"
+      issue_update_date="1356994800000"
+      issue_close_date="[null]"
+      locations="[null]"
+      issue_type="2"
   />
 
 </dataset>
index 298a31dd5360bf37212885ea87a7b18124fc920f..173a7baf3c6415fb35af0b6d5b70d9d293e83417 100644 (file)
@@ -1,6 +1,5 @@
 <dataset>
-  <rules tags="[null]"
-         system_tags="[null]"
+  <rules system_tags="[null]"
          id="200"
          name="Avoid Cycles"
          plugin_rule_key="AvoidCycles"
index 170a15ced6ff581527adface9a24ea2f7ff0477f..1733b52abe4f46e85d7a3ad00f5989f24159c769 100644 (file)
@@ -24,8 +24,7 @@
              version="[null]"
   />
 
-  <rules tags="[null]"
-         system_tags="[null]"
+  <rules system_tags="[null]"
          id="1"
          plugin_rule_key="NewRuleKey"
          plugin_name="plugin"
          is_template="[true]"
          language="dart"
          template_id="3"
-         note_data="[null]"
-         note_user_login="[null]"
-         note_created_at="[null]"
-         note_updated_at="[null]"
-         remediation_function="LINEAR"
          def_remediation_function="LINEAR_OFFSET"
-         remediation_gap_mult="1h"
          def_remediation_gap_mult="5d"
-         remediation_base_effort="5min"
          def_remediation_base_effort="10h"
          gap_description="squid.S115.effortToFix"
          description_format="MARKDOWN"
index 80edf1f90356f9e757087f6b14f0f1ba50985dff..c0d3dfcafa522171b56e5f68a3611ee747f7d288 100644 (file)
@@ -1,13 +1,34 @@
 <dataset>
 
-  <rules id="10" name="Null Pointer" plugin_name="xoo" plugin_rule_key="S001"
-         plugin_config_key="S1" description_format="HTML" description="S001 desc" language="xoo"
-         priority="4" status="READY" is_template="[false]" template_id="[null]"
-         tags="bug,performance" system_tags="cwe"
-         created_at="1500000000000" updated_at="1600000000000"/>
+  <rules id="10"
+         name="Null Pointer"
+         plugin_name="xoo"
+         plugin_rule_key="S001"
+         plugin_config_key="S1"
+         description_format="HTML"
+         description="S001 desc"
+         language="xoo"
+         priority="4"
+         status="READY"
+         is_template="[false]"
+         template_id="[null]"
+         system_tags="cwe"
+         created_at="1500000000000"
+         updated_at="1600000000000"/>
 
-  <rules_profiles id="100" name="Sonar Way" organization_uuid="org-123" kee="sonar-way" language="xoo" parent_kee="[null]" is_default="[false]"/>
+  <rules_profiles id="100"
+                  name="Sonar Way"
+                  organization_uuid="org-123"
+                  kee="sonar-way"
+                  language="xoo"
+                  parent_kee="[null]"
+                  is_default="[false]"/>
 
-  <active_rules id="1" profile_id="100" rule_id="10" failure_level="3" inheritance="[null]"
-                created_at="1500000000000" updated_at="1600000000000"/>
+  <active_rules id="1"
+                profile_id="100"
+                rule_id="10"
+                failure_level="3"
+                inheritance="[null]"
+                created_at="1500000000000"
+                updated_at="1600000000000"/>
 </dataset>
index 52b6bca6dfcd5ece26d0564084bc6f06577f00f7..b2dc134a2b8cf3f062f1cb8f6c9f7ef3acafb0f7 100644 (file)
@@ -1,20 +1,52 @@
 <dataset>
 
-  <rules id="10" name="Null Pointer" plugin_rule_key="S001" plugin_name="xoo"
-         plugin_config_key="S1" description_format="HTML" description="S001 desc" language="xoo"
-         priority="4" status="READY" is_template="[false]" template_id="[null]"
-         tags="bug,performance" system_tags="cwe"
-         created_at="1500000000000" updated_at="1600000000000"/>
+  <rules id="10"
+         name="Null Pointer"
+         plugin_rule_key="S001"
+         plugin_name="xoo"
+         plugin_config_key="S1"
+         description_format="HTML"
+         description="S001 desc"
+         language="xoo"
+         priority="4"
+         status="READY"
+         is_template="[false]"
+         template_id="[null]"
+         system_tags="cwe"
+         created_at="1500000000000"
+         updated_at="1600000000000"/>
 
-  <rules_profiles id="1" name="Parent" organization_uuid="org-123" kee="parent" language="xoo" parent_kee="[null]" is_default="[false]"/>
+  <rules_profiles id="1"
+                  name="Parent"
+                  organization_uuid="org-123"
+                  kee="parent"
+                  language="xoo"
+                  parent_kee="[null]"
+                  is_default="[false]"/>
 
-  <rules_profiles id="2" name="Child" organization_uuid="org-123" kee="child" language="xoo" parent_kee="parent" is_default="[false]"/>
+  <rules_profiles id="2"
+                  name="Child"
+                  organization_uuid="org-123"
+                  kee="child"
+                  language="xoo"
+                  parent_kee="parent"
+                  is_default="[false]"/>
 
-  <active_rules id="1" profile_id="2" rule_id="10" failure_level="4" inheritance="INHERITED"
-                created_at="1500000000000" updated_at="1600000000000"/>
+  <active_rules id="1"
+                profile_id="2"
+                rule_id="10"
+                failure_level="4"
+                inheritance="INHERITED"
+                created_at="1500000000000"
+                updated_at="1600000000000"/>
 
   <!-- Parent of Active rule 1 -->
-  <active_rules id="2" profile_id="1" rule_id="10" failure_level="0" inheritance="[null]"
-                created_at="1500000000000" updated_at="1600000000000"/>
+  <active_rules id="2"
+                profile_id="1"
+                rule_id="10"
+                failure_level="0"
+                inheritance="[null]"
+                created_at="1500000000000"
+                updated_at="1600000000000"/>
 
 </dataset>
index 9becffa199fee8e4128372bc412f3011f185872a..93db43f64a5ee2de8b485325812870db8de84dec 100644 (file)
@@ -1,20 +1,52 @@
 <dataset>
 
-  <rules id="10" name="Null Pointer" plugin_rule_key="S001" plugin_name="xoo"
-         plugin_config_key="S1" description_format="HTML" description="S001 desc" language="xoo"
-         priority="4" status="READY" is_template="[false]" template_id="[null]"
-         tags="bug,performance" system_tags="cwe"
-         created_at="1500000000000" updated_at="1600000000000"/>
+  <rules id="10"
+         name="Null Pointer"
+         plugin_rule_key="S001"
+         plugin_name="xoo"
+         plugin_config_key="S1"
+         description_format="HTML"
+         description="S001 desc"
+         language="xoo"
+         priority="4"
+         status="READY"
+         is_template="[false]"
+         template_id="[null]"
+         system_tags="cwe"
+         created_at="1500000000000"
+         updated_at="1600000000000"/>
 
-  <rules_profiles id="1" name="Parent" organization_uuid="org-123" kee="parent" language="xoo" parent_kee="[null]" is_default="[false]"/>
+  <rules_profiles id="1"
+                  name="Parent"
+                  organization_uuid="org-123"
+                  kee="parent"
+                  language="xoo"
+                  parent_kee="[null]"
+                  is_default="[false]"/>
 
-  <rules_profiles id="2" name="Child" organization_uuid="org-123" kee="child" language="xoo" parent_kee="parent" is_default="[false]"/>
+  <rules_profiles id="2"
+                  name="Child"
+                  organization_uuid="org-123"
+                  kee="child"
+                  language="xoo"
+                  parent_kee="parent"
+                  is_default="[false]"/>
 
-  <active_rules id="1" profile_id="2" rule_id="10" failure_level="2" inheritance="OVERRIDES"
-                created_at="1500000000000" updated_at="1600000000000"/>
+  <active_rules id="1"
+                profile_id="2"
+                rule_id="10"
+                failure_level="2"
+                inheritance="OVERRIDES"
+                created_at="1500000000000"
+                updated_at="1600000000000"/>
 
   <!-- Parent of Active rule 1 -->
-  <active_rules id="2" profile_id="1" rule_id="10" failure_level="0" inheritance="[null]"
-                created_at="1500000000000" updated_at="1600000000000"/>
+  <active_rules id="2"
+                profile_id="1"
+                rule_id="10"
+                failure_level="0"
+                inheritance="[null]"
+                created_at="1500000000000"
+                updated_at="1600000000000"/>
 
 </dataset>
index 80edf1f90356f9e757087f6b14f0f1ba50985dff..c0d3dfcafa522171b56e5f68a3611ee747f7d288 100644 (file)
@@ -1,13 +1,34 @@
 <dataset>
 
-  <rules id="10" name="Null Pointer" plugin_name="xoo" plugin_rule_key="S001"
-         plugin_config_key="S1" description_format="HTML" description="S001 desc" language="xoo"
-         priority="4" status="READY" is_template="[false]" template_id="[null]"
-         tags="bug,performance" system_tags="cwe"
-         created_at="1500000000000" updated_at="1600000000000"/>
+  <rules id="10"
+         name="Null Pointer"
+         plugin_name="xoo"
+         plugin_rule_key="S001"
+         plugin_config_key="S1"
+         description_format="HTML"
+         description="S001 desc"
+         language="xoo"
+         priority="4"
+         status="READY"
+         is_template="[false]"
+         template_id="[null]"
+         system_tags="cwe"
+         created_at="1500000000000"
+         updated_at="1600000000000"/>
 
-  <rules_profiles id="100" name="Sonar Way" organization_uuid="org-123" kee="sonar-way" language="xoo" parent_kee="[null]" is_default="[false]"/>
+  <rules_profiles id="100"
+                  name="Sonar Way"
+                  organization_uuid="org-123"
+                  kee="sonar-way"
+                  language="xoo"
+                  parent_kee="[null]"
+                  is_default="[false]"/>
 
-  <active_rules id="1" profile_id="100" rule_id="10" failure_level="3" inheritance="[null]"
-                created_at="1500000000000" updated_at="1600000000000"/>
+  <active_rules id="1"
+                profile_id="100"
+                rule_id="10"
+                failure_level="3"
+                inheritance="[null]"
+                created_at="1500000000000"
+                updated_at="1600000000000"/>
 </dataset>
index dbb7ec73ccaf2bf7c0e61e260a10d97c0ce2d236..8ffde1cefe0f8dad1309ecf159af2daf5db8ffa0 100644 (file)
@@ -1,35 +1,84 @@
 <dataset>
 
-  <rules id="10" name="Null Pointer" plugin_rule_key="S001"
-         plugin_config_key="S1" plugin_name="xoo"
-         description_format="HTML" description="S001 desc" language="xoo"
-         priority="4" status="READY"
-         is_template="[false]" template_id="[null]"
-         tags="bug,performance" system_tags="cwe"
-         created_at="1500000000000" updated_at="1600000000000"/>
+  <rules id="10"
+         name="Null Pointer"
+         plugin_rule_key="S001"
+         plugin_config_key="S1"
+         plugin_name="xoo"
+         description_format="HTML"
+         description="S001 desc"
+         language="xoo"
+         priority="4"
+         status="READY"
+         is_template="[false]"
+         template_id="[null]"
+         system_tags="cwe"
+         created_at="1500000000000"
+         updated_at="1600000000000"/>
 
-  <rules id="11" name="Slow" plugin_rule_key="S002"
-         plugin_config_key="S2" plugin_name="xoo"
-         description_format="MARKDOWN" description="*S002 desc*" language="xoo"
-         priority="3" status="BETA"
-         is_template="[true]" template_id="[null]"
-         tags="[null]" system_tags="[null]"
-         created_at="2000000000000" updated_at="2100000000000"/>
+  <rules id="11"
+         name="Slow"
+         plugin_rule_key="S002"
+         plugin_config_key="S2"
+         plugin_name="xoo"
+         description_format="MARKDOWN"
+         description="*S002 desc*"
+         language="xoo"
+         priority="3"
+         status="BETA"
+         is_template="[true]"
+         template_id="[null]"
+         system_tags="[null]"
+         created_at="2000000000000"
+         updated_at="2100000000000"/>
 
-  <rules_profiles id="1" name="Parent" organization_uuid="org-123" kee="parent" language="xoo" parent_kee="[null]" is_default="[false]"/>
+  <rules_profiles id="1"
+                  name="Parent"
+                  organization_uuid="org-123"
+                  kee="parent"
+                  language="xoo"
+                  parent_kee="[null]"
+                  is_default="[false]"/>
 
-  <rules_profiles id="2" name="Child" organization_uuid="org-123" kee="child" language="xoo" parent_kee="parent" is_default="[false]"/>
+  <rules_profiles id="2"
+                  name="Child"
+                  organization_uuid="org-123"
+                  kee="child"
+                  language="xoo"
+                  parent_kee="parent"
+                  is_default="[false]"/>
 
-  <active_rules id="1" profile_id="2" rule_id="10" failure_level="4" inheritance="INHERITED"
-                created_at="1500000000000" updated_at="1600000000000"/>
+  <active_rules id="1"
+                profile_id="2"
+                rule_id="10"
+                failure_level="4"
+                inheritance="INHERITED"
+                created_at="1500000000000"
+                updated_at="1600000000000"/>
 
   <!-- Parent of Active rule 1 -->
-  <active_rules id="2" profile_id="1" rule_id="10" failure_level="0" inheritance="[null]"
-                created_at="1700000000000" updated_at="1800000000000"/>
+  <active_rules id="2"
+                profile_id="1"
+                rule_id="10"
+                failure_level="0"
+                inheritance="[null]"
+                created_at="1700000000000"
+                updated_at="1800000000000"/>
 
-  <rules_profiles id="3" name="Sonar Way" organization_uuid="org-123" kee="sonar-way" language="xoo" parent_kee="[null]" is_default="[false]"/>
+  <rules_profiles id="3"
+                  name="Sonar Way"
+                  organization_uuid="org-123"
+                  kee="sonar-way"
+                  language="xoo"
+                  parent_kee="[null]"
+                  is_default="[false]"/>
 
-  <active_rules id="3" profile_id="3" rule_id="11" failure_level="3" inheritance="[null]"
-                created_at="2000000000000" updated_at="2100000000000"/>
+  <active_rules id="3"
+                profile_id="3"
+                rule_id="11"
+                failure_level="3"
+                inheritance="[null]"
+                created_at="2000000000000"
+                updated_at="2100000000000"/>
 
 </dataset>