]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5064 Remove active rule notes
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Mon, 12 May 2014 23:05:13 +0000 (01:05 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Mon, 12 May 2014 23:05:13 +0000 (01:05 +0200)
46 files changed:
sonar-batch/src/test/resources/org/sonar/batch/rule/ActiveRulesProviderTest/shared.xml
sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java
sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql
sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl
sonar-core/src/main/resources/org/sonar/core/qualityprofile/db/ActiveRuleMapper.xml
sonar-core/src/test/java/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest.java
sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete-result.xml
sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_from_profile-result.xml
sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_from_rule-result.xml
sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_parameter-result.xml
sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_parameters-result.xml
sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_parameters_from_profile_id-result.xml
sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_parameters_from_profile_id.xml
sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/insert-result.xml
sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/shared.xml
sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/update-result.xml
sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRule.java
sonar-server/src/main/java/org/sonar/server/qualityprofile/ActiveRuleDocument.java
sonar-server/src/main/java/org/sonar/server/qualityprofile/ESActiveRule.java
sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileActiveRuleOperations.java
sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileRule.java
sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfiles.java
sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_active_rule_note.html.erb [deleted file]
sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_rule.html.erb
sonar-server/src/main/webapp/WEB-INF/db/migrate/536_remove_active_rule_notes.rb [new file with mode: 0644]
sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileActiveRuleOperationsTest.java
sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfilesTest.java
sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldActivateInChildren-result.xml
sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldChangeParent-result.xml
sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldDeactivateInChildren-result.xml
sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldNotDeactivateOverridingChildren-result.xml
sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldRemoveParent-result.xml
sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldSetParent-result.xml
sonar-server/src/test/resources/org/sonar/server/qualityprofile/RuleChangeTest/removeActivatedRules-result.xml
sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete-result.xml
sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_from_profile-result.xml
sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_from_rule-result.xml
sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_parameter-result.xml
sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_parameters-result.xml
sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_parameters_from_profile_id-result.xml
sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_parameters_from_profile_id.xml
sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/insert-result.xml
sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/insert_parameter.xml
sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/shared.xml
sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/update-result.xml

index 2c4953c0dc901aa6a3d523fdb1fabbb1d2539987..695222a8c53f70b6cc7b92ba5eee219944092543 100644 (file)
                   used_profile="[false]"/>
 
   <!-- java -->
-  <active_rules id="1" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"
-                note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="john" note_data="other note"/>
+  <active_rules id="1" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"/>
 
   <active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" rules_parameter_key="max" value="20"/>
   <active_rule_parameters id="2" active_rule_id="1" rules_parameter_id="2" rules_parameter_key="format" value="html"/>
 
   <!-- php -->
-  <active_rules id="2" profile_id="3" rule_id="100" failure_level="4" inheritance="[null]"
-                note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="john" note_data="other note"/>
+  <active_rules id="2" profile_id="3" rule_id="100" failure_level="4" inheritance="[null]"/>
 </dataset>
index 97b010a611e3df42277065818abc50f3e0a3925c..2b125c1ff7a14f7f6b367cb530c13512cedcc5e3 100644 (file)
@@ -33,7 +33,7 @@ import java.util.List;
  */
 public class DatabaseVersion implements BatchComponent, ServerComponent {
 
-  public static final int LAST_VERSION = 535;
+  public static final int LAST_VERSION = 536;
 
   public static enum Status {
     UP_TO_DATE, REQUIRES_UPGRADE, REQUIRES_DOWNGRADE, FRESH_INSTALL
index 1851f63e3a758ced517a0881d89fed8bea4af925..e6e974e9d54464c344cc1b01152736dba7936f4b 100644 (file)
@@ -231,6 +231,7 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('532');
 INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('533');
 INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('534');
 INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('535');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('536');
 
 INSERT INTO USERS(ID, LOGIN, NAME, EMAIL, CRYPTED_PASSWORD, SALT, CREATED_AT, UPDATED_AT, REMEMBER_TOKEN, REMEMBER_TOKEN_EXPIRES_AT) VALUES (1, 'admin', 'Administrator', '', 'a373a0e667abb2604c1fd571eb4ad47fe8cc0878', '48bc4b0d93179b5103fd3885ea9119498e9d161b', '2011-09-26 22:27:48.0', '2011-09-26 22:27:48.0', null, null);
 ALTER TABLE USERS ALTER COLUMN ID RESTART WITH 2;
index c5244ccd5fff65f120999dce3810101165221c56..7871f4f5e6bf8361555fa13eb6025917a7a72bf7 100644 (file)
@@ -317,11 +317,7 @@ CREATE TABLE "ACTIVE_RULES" (
   "PROFILE_ID" INTEGER NOT NULL,
   "RULE_ID" INTEGER NOT NULL,
   "FAILURE_LEVEL" INTEGER NOT NULL,
-  "INHERITANCE" VARCHAR(10),
-  "NOTE_CREATED_AT" TIMESTAMP,
-  "NOTE_UPDATED_AT" TIMESTAMP,
-  "NOTE_USER_LOGIN" VARCHAR(40),
-  "NOTE_DATA" CLOB(2147483647)
+  "INHERITANCE" VARCHAR(10)
 );
 
 CREATE TABLE "NOTIFICATIONS" (
index 2a7835f9f7e895bc8dff9b27ebe6a2d480836803..93d62d979d4dceb7d923ad0a15c4143d1b370c8a 100644 (file)
@@ -9,10 +9,6 @@
     a.rule_id as ruleId,
     a.failure_level as severity,
     a.inheritance as inheritance,
-    a.note_data as noteData,
-    a.note_user_login as noteUserLogin,
-    a.note_updated_at as noteUpdatedAt,
-    a.note_created_at as noteCreatedAt,
     active_rule_parent.id as parentId
   </sql>
 
@@ -23,8 +19,8 @@
   </sql>
 
   <insert id="insert" parameterType="ActiveRule" keyColumn="id" useGeneratedKeys="true" keyProperty="id">
-    INSERT INTO active_rules (profile_id, rule_id, failure_level, inheritance, note_created_at, note_updated_at, note_user_login, note_data)
-    VALUES (#{profileId}, #{ruleId}, #{severity}, #{inheritance}, #{noteCreatedAt}, #{noteUpdatedAt}, #{noteUserLogin}, #{noteData})
+    INSERT INTO active_rules (profile_id, rule_id, failure_level, inheritance)
+    VALUES (#{profileId}, #{ruleId}, #{severity}, #{inheritance})
   </insert>
 
   <update id="update" parameterType="ActiveRule">
     profile_id=#{profileId},
     rule_id=#{ruleId},
     failure_level=#{severity},
-    inheritance=#{inheritance},
-    note_created_at=#{noteCreatedAt},
-    note_updated_at=#{noteUpdatedAt},
-    note_user_login=#{noteUserLogin},
-    note_data=#{noteData}
+    inheritance=#{inheritance}
     WHERE id=#{id}
   </update>
 
index 6a846805aaa774781ac599d4d95107ee73a39960..86dbf2ea4612486f08d5e84a8d15cc6cbd60e168 100644 (file)
@@ -26,7 +26,6 @@ import com.google.common.collect.Iterables;
 import org.junit.Before;
 import org.junit.Test;
 import org.sonar.api.rule.Severity;
-import org.sonar.api.utils.DateUtils;
 import org.sonar.core.persistence.AbstractDaoTestCase;
 
 import java.util.List;
@@ -66,8 +65,7 @@ public class ActiveRuleDaoTest extends AbstractDaoTestCase {
       .setProfileId(1)
       .setRuleId(10)
       .setSeverity(Severity.BLOCKER)
-      .setInheritance(null)
-      .setNoteData("text");
+      .setInheritance(null);
 
     dao.update(dto);
 
@@ -111,10 +109,6 @@ public class ActiveRuleDaoTest extends AbstractDaoTestCase {
     assertThat(result.getRulId()).isEqualTo(10);
     assertThat(result.getSeverityString()).isEqualTo(Severity.MAJOR);
     assertThat(result.getInheritance()).isEqualTo("INHERITED");
-    assertThat(result.getNoteData()).isEqualTo("some note");
-    assertThat(result.getNoteUserLogin()).isEqualTo("henry");
-    assertThat(result.getNoteCreatedAt()).isEqualTo(DateUtils.parseDate("2013-12-18"));
-    assertThat(result.getNoteUpdatedAt()).isEqualTo(DateUtils.parseDate("2013-12-18"));
   }
 
   @Test
@@ -138,10 +132,6 @@ public class ActiveRuleDaoTest extends AbstractDaoTestCase {
     assertThat(result.getRulId()).isEqualTo(10);
     assertThat(result.getSeverityString()).isEqualTo(Severity.MAJOR);
     assertThat(result.getInheritance()).isEqualTo("INHERITED");
-    assertThat(result.getNoteData()).isEqualTo("some note");
-    assertThat(result.getNoteUserLogin()).isEqualTo("henry");
-    assertThat(result.getNoteCreatedAt()).isEqualTo(DateUtils.parseDate("2013-12-18"));
-    assertThat(result.getNoteUpdatedAt()).isEqualTo(DateUtils.parseDate("2013-12-18"));
   }
 
   @Test
@@ -284,8 +274,8 @@ public class ActiveRuleDaoTest extends AbstractDaoTestCase {
     assertThat(dao.selectAllParams()).hasSize(3);
   }
 
-  private ActiveRuleDto find(final Integer id, List<ActiveRuleDto> dtos){
-    return Iterables.find(dtos, new Predicate<ActiveRuleDto>(){
+  private ActiveRuleDto find(final Integer id, List<ActiveRuleDto> dtos) {
+    return Iterables.find(dtos, new Predicate<ActiveRuleDto>() {
       @Override
       public boolean apply(ActiveRuleDto input) {
         return input.getId().equals(id);
index 39e1decb6d15bbbc5cafa79c522e44f9329718b7..29697429a4b690d43d35c94924d6adcb3d0c8318 100644 (file)
@@ -1,12 +1,9 @@
 <dataset>
 
   <!--<active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"-->
-                <!--note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="some note"/>-->
 
-  <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"
-                note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="john" note_data="other note"/>
+  <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"/>
 
-  <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"
-                note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="other note"/>
+  <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"/>
 
 </dataset>
index 231e470df28a5364bf1a90e7373351c478aa45a3..e9fbac550332681a04c034e094cb80d322629a54 100644 (file)
@@ -1,12 +1,9 @@
 <dataset>
 
-  <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"
-    note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="some note"/>
+  <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"/>
 
   <!--<active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"-->
-    <!--note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="john" note_data="other note"/>-->
 
   <!--<active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"-->
-    <!--note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="other note"/>-->
 
 </dataset>
index 4f066dfeaae84bd32b12d9d64032ba1d0d6c6e1b..7e8d5ddfecc6dde49ad3f51a86922fc83836b166 100644 (file)
@@ -1,12 +1,9 @@
 <dataset>
 
-  <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"
-    note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="some note"/>
+  <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"/>
 
-  <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"
-    note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="john" note_data="other note"/>
+  <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"/>
 
-  <!--<active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"-->
-    <!--note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="other note"/>-->
+  <!--<active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"/>-->
 
 </dataset>
index 66bf84129e467cc261b8e29dcc49315e57ae2c1d..3057a933a8e6454c4b8cd31c5c7af8cdf3d48caf 100644 (file)
@@ -1,10 +1,8 @@
 <dataset>
 
-  <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"
-    note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]"/>
+  <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"/>
 
-  <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"
-                note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]"/>
+  <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"/>
 
   <!--<active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" rules_parameter_key="max" value="20"/>-->
   <active_rule_parameters id="2" active_rule_id="1" rules_parameter_id="2" rules_parameter_key="format" value="html"/>
index 4b0e2e7e0e244fa5888bef647457cf7256503d84..d8bb5660f2890cbe94448ed2f5e41413b85e8f95 100644 (file)
@@ -1,10 +1,8 @@
 <dataset>
 
-  <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"
-    note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]"/>
+  <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"/>
 
-  <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"
-                note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]"/>
+  <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"/>
 
   <!--<active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" rules_parameter_key="max" value="20"/>-->
   <!--<active_rule_parameters id="2" active_rule_id="1" rules_parameter_id="2" rules_parameter_key="format" value="html"/>-->
index a77383cece4fe026cf554e9a7777fb8763aeefb3..0bd84f428eaf250b0002ed31f496d74175afef95 100644 (file)
@@ -1,14 +1,11 @@
 <dataset>
 
-  <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"
-                note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="some note"/>
+  <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"/>
 
   <!-- Parent of Active rule 1 -->
-  <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"
-                note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="john" note_data="other note"/>
+  <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"/>
 
-  <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"
-                note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="other note"/>
+  <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"/>
 
   <active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" rules_parameter_key="max" value="20"/>
   <active_rule_parameters id="2" active_rule_id="1" rules_parameter_id="2" rules_parameter_key="format" value="html"/>
index 148ce414a9af07a1c9784f505e71f4f3d33b1b3c..d7a92243391f704bbebfa145a8e73c90c7b40e46 100644 (file)
@@ -1,14 +1,11 @@
 <dataset>
 
-  <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"
-    note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="some note"/>
+  <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"/>
 
   <!-- Parent of Active rule 1 -->
-  <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"
-    note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="john" note_data="other note"/>
+  <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"/>
 
-  <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"
-    note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="other note"/>
+  <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"/>
 
   <active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" rules_parameter_key="max" value="20"/>
   <active_rule_parameters id="2" active_rule_id="1" rules_parameter_id="2" rules_parameter_key="format" value="html"/>
index ee595acf1d80c8f94a22167af25440677744a4c5..0a98d012fad5433eff6fb57406bd70df4192ce95 100644 (file)
@@ -1,6 +1,5 @@
 <dataset>
 
-  <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"
-    note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]"/>
+  <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"/>
 
 </dataset>
index 768b91b204678500a4639f999cbb3993d505e389..55259929055e9de8351e6ffe0e3f101e522a1526 100644 (file)
@@ -1,14 +1,11 @@
 <dataset>
 
-  <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"
-    note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="some note"/>
+  <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"/>
 
   <!-- Parent of Active rule 1 -->
-  <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"
-    note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="john" note_data="other note"/>
+  <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"/>
 
-  <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"
-    note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="other note"/>
+  <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"/>
 
   <active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" rules_parameter_key="max" value="20"/>
   <active_rule_parameters id="2" active_rule_id="1" rules_parameter_id="2" rules_parameter_key="format" value="html"/>
index e0c60d70e890a63ae682b2f6a24648efa9421281..d30e3009c23ce1c77836d9bbf93a58bbe7dec440 100644 (file)
@@ -1,12 +1,9 @@
 <dataset>
 
-  <active_rules id="1" profile_id="1" rule_id="10" failure_level="4" inheritance="[null]"
-                note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="text"/>
+  <active_rules id="1" profile_id="1" rule_id="10" failure_level="4" inheritance="[null]"/>
 
-  <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"
-                note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="john" note_data="other note"/>
+  <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"/>
 
-  <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"
-                note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="other note"/>
+  <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"/>
 
 </dataset>
index 4bee3f81fa3c443514f0a7cba6a540ee1983d0cc..175ca5f1a13d297e4f743a0d87dc9161f8164264 100644 (file)
@@ -25,6 +25,7 @@ import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.builder.ToStringBuilder;
 import org.sonar.api.profiles.RulesProfile;
 
+import javax.annotation.CheckForNull;
 import javax.persistence.*;
 
 import java.util.ArrayList;
@@ -64,21 +65,6 @@ public class ActiveRule implements Cloneable {
   @Column(name = "inheritance", updatable = true, nullable = true)
   private String inheritance;
 
-  @Lob
-  @Column(name = "note_data", updatable = true, nullable = true)
-  private String noteData;
-
-  @Column(name = "note_user_login", updatable = true, nullable = true)
-  private String noteUserLogin;
-
-  @Temporal(TemporalType.TIMESTAMP)
-  @Column(name = "note_created_at", updatable = true, nullable = true)
-  private Date noteCreatedAt;
-
-  @Temporal(TemporalType.TIMESTAMP)
-  @Column(name = "note_updated_at", updatable = true, nullable = true)
-  private Date noteUpdatedAt;
-
   /**
    * @deprecated visibility should be reduced to protected or package
    */
@@ -252,30 +238,42 @@ public class ActiveRule implements Cloneable {
 
   /**
    * @since 4.2
+   * @deprecated in 4.4. Feature dropped.
    */
+  @CheckForNull
+  @Deprecated
   public String getNoteData() {
-    return noteData;
+    return null;
   }
 
   /**
    * @since 4.2
+   * @deprecated in 4.4. Feature dropped.
    */
+  @CheckForNull
+  @Deprecated
   public String getNoteUserLogin() {
-    return noteUserLogin;
+    return null;
   }
 
   /**
    * @since 4.2
+   * @deprecated in 4.4. Feature dropped.
    */
+  @CheckForNull
+  @Deprecated
   public Date getNoteCreatedAt() {
-    return noteCreatedAt;
+    return null;
   }
 
   /**
    * @since 4.2
+   * @deprecated in 4.4. Feature dropped.
    */
+  @CheckForNull
+  @Deprecated
   public Date getNoteUpdatedAt() {
-    return noteUpdatedAt;
+    return null;
   }
 
   @Override
index ef4822649e4cf0caecf8d25a549b2cf095cda52d..a7aef2a98139f931329d4ca6322d42e95c238e03 100644 (file)
@@ -29,12 +29,6 @@ public class ActiveRuleDocument {
   public static final String FIELD_ACTIVE_RULE_PARENT_ID = "activeRuleParentId";
   public static final String FIELD_PARAMS = "params";
 
-  public static final String FIELD_NOTE = "note";
-  public static final String FIELD_NOTE_DATA = "data";
-  public static final String FIELD_NOTE_USER_LOGIN = "userLogin";
-  public static final String FIELD_NOTE_CREATED_AT = "createdAt";
-  public static final String FIELD_NOTE_UPDATED_AT = "updatedAt";
-
   public static final String FIELD_PARAM_KEY = "key";
   public static final String FIELD_PARAM_VALUE = "value";
 
index 053facc9c25004c40d932d2e9e8746d28e252420..49664923678bfa4c7ac111dbc44412bb1cd6641b 100644 (file)
@@ -202,14 +202,6 @@ public class ESActiveRule {
       .field(ActiveRuleDocument.FIELD_SEVERITY, activeRule.getSeverityString())
       .field(ActiveRuleDocument.FIELD_PROFILE_ID, activeRule.getProfileId())
       .field(ActiveRuleDocument.FIELD_INHERITANCE, activeRule.getInheritance());
-    if (activeRule.getNoteData() != null || activeRule.getNoteUserLogin() != null) {
-      document.startObject(RuleDocument.FIELD_NOTE)
-        .field(ActiveRuleDocument.FIELD_NOTE_DATA, activeRule.getNoteData())
-        .field(ActiveRuleDocument.FIELD_NOTE_USER_LOGIN, activeRule.getNoteUserLogin())
-        .field(ActiveRuleDocument.FIELD_NOTE_CREATED_AT, activeRule.getNoteCreatedAt())
-        .field(ActiveRuleDocument.FIELD_NOTE_UPDATED_AT, activeRule.getNoteUpdatedAt())
-        .endObject();
-    }
     if (!params.isEmpty()) {
       document.startArray(ActiveRuleDocument.FIELD_PARAMS);
       for (ActiveRuleParamDto param : params) {
index 4eb5b5f8d79248bfa11b17ac3bed75a205f3aa79..d99ae6e504a0a00c9ab1158064840f0a5e8186f3 100644 (file)
@@ -360,51 +360,6 @@ public class QProfileActiveRuleOperations implements ServerComponent {
     }
   }
 
-  public void updateActiveRuleNote(int activeRuleId, String note, UserSession userSession) {
-    validatePermission(userSession);
-    SqlSession session = myBatis.openSession(false);
-
-    try {
-      ActiveRuleDto activeRule = findActiveRuleNotNull(activeRuleId, session);
-      String sanitizedNote = Strings.emptyToNull(note);
-      if (sanitizedNote != null) {
-        Date now = new Date(system.now());
-        if (activeRule.getNoteData() == null) {
-          activeRule.setNoteCreatedAt(now);
-          activeRule.setNoteUserLogin(userSession.login());
-        }
-        activeRule.setNoteUpdatedAt(now);
-        activeRule.setNoteData(note);
-        activeRuleDao.update(activeRule, session);
-        session.commit();
-
-        reindexActiveRule(activeRule, session);
-      }
-    } finally {
-      MyBatis.closeQuietly(session);
-    }
-  }
-
-  public void deleteActiveRuleNote(int activeRuleId, UserSession userSession) {
-    validatePermission(userSession);
-
-    SqlSession session = myBatis.openSession(false);
-    try {
-      ActiveRuleDto activeRule = findActiveRuleNotNull(activeRuleId, session);
-
-      activeRule.setNoteData(null);
-      activeRule.setNoteUserLogin(null);
-      activeRule.setNoteCreatedAt(null);
-      activeRule.setNoteUpdatedAt(null);
-      activeRuleDao.update(activeRule);
-      session.commit();
-
-      reindexActiveRule(activeRule, session);
-    } finally {
-      MyBatis.closeQuietly(session);
-    }
-  }
-
   private void notifyParamsDeleted(ActiveRuleDto activeRule, List<ActiveRuleParamDto> params, SqlSession session, UserSession userSession) {
     ProfilesManager.RuleInheritanceActions actions = new ProfilesManager.RuleInheritanceActions();
     for (ActiveRuleParamDto activeRuleParam : params) {
index 4b34fa8ff05dfaa87bd87b7ee8a69c2a7c6728e1..a9ecd599970d7e9e98c4395ac1550391b004fde5 100644 (file)
@@ -46,7 +46,6 @@ public class QProfileRule {
   private final Integer activeRuleParentId;
   private final String severity;
   private final String inheritance;
-  private final RuleNote activeRuleNote;
   private final List<QProfileRuleParam> params;
 
   // TODO move this in a parser class
@@ -56,25 +55,12 @@ public class QProfileRule {
       activeRuleId = null;
       severity = (String) ruleSource.get(ActiveRuleDocument.FIELD_SEVERITY);
       inheritance = null;
-      activeRuleNote = null;
       activeRuleParentId = null;
     } else {
       activeRuleId = (Integer) activeRuleSource.get(ActiveRuleDocument.FIELD_ID);
       severity = (String) activeRuleSource.get(ActiveRuleDocument.FIELD_SEVERITY);
       inheritance = (String) activeRuleSource.get(ActiveRuleDocument.FIELD_INHERITANCE);
       activeRuleParentId = (Integer) activeRuleSource.get(ActiveRuleDocument.FIELD_ACTIVE_RULE_PARENT_ID);
-
-      if (activeRuleSource.containsKey(ActiveRuleDocument.FIELD_NOTE)) {
-        Map<String, Object> ruleNoteDocument = (Map<String, Object>) activeRuleSource.get(ActiveRuleDocument.FIELD_NOTE);
-        activeRuleNote = new RuleNote(
-          (String) ruleNoteDocument.get(ActiveRuleDocument.FIELD_NOTE_DATA),
-          (String) ruleNoteDocument.get(ActiveRuleDocument.FIELD_NOTE_USER_LOGIN),
-          RuleDocumentParser.parseOptionalDate(ActiveRuleDocument.FIELD_NOTE_CREATED_AT, ruleNoteDocument),
-          RuleDocumentParser.parseOptionalDate(ActiveRuleDocument.FIELD_NOTE_UPDATED_AT, ruleNoteDocument)
-        );
-      } else {
-        activeRuleNote = null;
-      }
     }
 
     params = Lists.newArrayList();
@@ -196,11 +182,6 @@ public class QProfileRule {
     return params;
   }
 
-  @CheckForNull
-  public RuleNote activeRuleNote() {
-    return activeRuleNote;
-  }
-
   @Override
   public String toString() {
     return new ReflectionToStringBuilder(this).toString();
index 7589d21cd66c0ffe18001fdf445b53e3d9f38e70..767092262dd1bd75dac8907eac6c75c1d95ab569 100644 (file)
@@ -230,14 +230,6 @@ public class QProfiles implements ServerComponent {
     activeRuleOperations.revertActiveRule(activeRuleId, UserSession.get());
   }
 
-  public void updateActiveRuleNote(int activeRuleId, String note) {
-    activeRuleOperations.updateActiveRuleNote(activeRuleId, note, UserSession.get());
-  }
-
-  public void deleteActiveRuleNote(int activeRuleId) {
-    activeRuleOperations.deleteActiveRuleNote(activeRuleId, UserSession.get());
-  }
-
   @CheckForNull
   public QProfileRule parentProfileRule(QProfileRule rule) {
     return rules.findParentProfileRule(rule);
index 96d071981ed297bf7a4ad3eb60e8faa100f5f814..ed0967e36ec3c0ded506d7ce71f5978129c8dec7 100644 (file)
@@ -320,32 +320,6 @@ class RulesConfigurationController < ApplicationController
     render :partial => 'rule_note', :locals => {:rule => rule}
   end
 
-
-  def update_active_rule_note
-    verify_post_request
-    require_parameters :active_rule_id, :note
-
-    rule = nil
-    call_backend do
-      Internal.quality_profiles.updateActiveRuleNote(params[:active_rule_id].to_i, params[:note])
-      rule = Internal.quality_profiles.findByActiveRuleId(params[:active_rule_id].to_i)
-    end
-    render :partial => 'active_rule_note', :locals => {:rule => rule}
-  end
-
-
-  def delete_active_rule_note
-    verify_post_request
-    require_parameters :active_rule_id
-
-    rule = nil
-    call_backend do
-      Internal.quality_profiles.deleteActiveRuleNote(params[:active_rule_id].to_i)
-      rule = Internal.quality_profiles.findByActiveRuleId(params[:active_rule_id].to_i)
-    end
-    render :partial => 'active_rule_note', :locals => {:rule => rule}
-  end
-
   def show_select_tags
     rule = Internal.quality_profiles.findByRule(params[:rule_id].to_i)
     tags = tag_selection_for_rule(rule)
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_active_rule_note.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_active_rule_note.html.erb
deleted file mode 100644 (file)
index c18b599..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-<% #locals = rule, profile
-  note = rule.activeRuleNote
-  active_note_detail_div_id = "and_" + rule.activeRuleId.to_s
-  add_active_note_button_id = "aanb_" + rule.activeRuleId.to_s
-  edit_active_note_link_id = "eanl_" + rule.activeRuleId.to_s
-  delete_active_note_link_id = "danl_" + rule.activeRuleId.to_s
-  active_note_form_div_id = "anf_" + rule.activeRuleId.to_s
-  active_note_textarea_id = "ant_" + rule.activeRuleId.to_s
-  submit_active_note_update_button_id = "sanub_" + rule.activeRuleId.to_s
-%>
-
-<div id="<%= active_note_detail_div_id -%>">
-  <% if !note.nil? %>
-    <blockquote class="spacer-bottom">
-      <cite>
-        <b><%= User.find_active_by_login(note.userLogin).name -%></b> (<%= distance_of_time_in_words_to_now(Time.at(note.updatedAt.time/1000)) -%>)&nbsp;
-        <% if profiles_administrator? %>
-          | &nbsp;
-          <a href="#" id="<%= edit_active_note_link_id -%>" class="link-action"
-             onclick="$j('#<%= active_note_detail_div_id -%>').hide();$j('#<%= active_note_form_div_id -%>').show();$j('#<%= active_note_textarea_id -%>').focus();return false;"><%= message('edit') %></a>
-          &nbsp;
-          <a class="link-action"
-             onclick="if(confirm('<%= escape_javascript(message('rules_configuration.confirm_delete_note')) -%>')){
-                             $j.ajax({
-                                       url: '<%=ApplicationController.root_context-%>/rules_configuration/delete_active_rule_note?active_rule_id=<%=rule.activeRuleId-%>',
-                                       type: 'post',
-                                       success:function(response){$j('#active_rule_note_<%= rule.activeRuleId -%>').html(response);}
-                                     });};return false;"
-             href="#!"><%=message('delete')-%></a>
-        <% end %>
-      </cite>
-      <p><%= html_text(note.data) -%></p>
-    </blockquote>
-  <% elsif profiles_administrator? %>
-    <a href="#" onclick="$j('#<%= active_note_form_div_id -%>').show();$j('#<%= active_note_detail_div_id -%>').hide();$j('#<%= active_note_textarea_id -%>').focus(); return false;"
-       class="link-action spacer-right" id="<%= add_active_note_button_id -%>"><%= message('rules_configuration.add_note') -%></a>
-  <% end %>
-</div>
-
-<% if profiles_administrator? %>
-  <form onsubmit="$j.ajax({
-                            url:'<%= ApplicationController.root_context -%>/rules_configuration/update_active_rule_note?active_rule_id=<%=rule.activeRuleId-%>',
-                            data: $j(this).serialize(),
-                            type:'post',
-                            success:function(response){$j('#active_rule_note_<%= rule.activeRuleId -%>').html(response);}
-                          });
-                  return false;"
-          method="post"
-          action="<%= ApplicationController.root_context -%>/rules_configuration//update_active_rule_note?active_rule_id=<%=rule.activeRuleId-%>">
-  <table id="<%= active_note_form_div_id -%>" style="display: none" class="admin table width100">
-    <tbody>
-      <tr>
-        <td class="width100" colspan="2">
-          <textarea name="note" id="<%= active_note_textarea_id -%>" rows="10" style="width:100%"
-                    onkeyup="if (this.value=='') $j('#<%= submit_active_note_update_button_id -%>').prop('disabled', true); else $j('#<%= submit_active_note_update_button_id -%>').prop('disabled', false);"><%= h(plain_text(note.data)) unless note.nil? -%></textarea>
-        </td>
-      </tr>
-    <tr>
-      <td>
-        <input type="submit" value="<%= note ? message('update_verb') : message('rules_configuration.add_note') -%>" name="submit-active-note" id="<%= submit_active_note_update_button_id -%>" disabled="disabled"/>
-        <a href="#" onclick="$j('#<%= active_note_detail_div_id -%>').show();$j('#<%= active_note_form_div_id -%>').hide();return false;"><%= message('cancel') %></a>
-      </td>
-      <td align="right">
-        <%= render :partial => 'markdown/tips' -%>
-      </td>
-    </tr>
-    </tbody>
-  </table>
-  </form>
-<% end %>
index 98cce3c05f3d2434041f168b7d09e6d46cfd426d..028c44403a0c3956e2d83fa17ad43b770c7b7144 100644 (file)
       </table>
     <% end %>
 
-    <% if is_activated %>
-      <div id="active_rule_note_<%= rule.activeRuleId -%>">
-        <%= render :partial => 'active_rule_note', :locals => {:rule => rule} %>
-      </div>
-    <% end %>
-
     <% if profiles_administrator? %>
       <% if rule.template? %>
         <%= link_to message('rules_configuration.copy_rule'), {:action => 'new', :id => profile.id, :rule_id => rule.id}, :id => "copy-#{u rule_key(rule)}", :class => 'link-action spacer-right' %>
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/536_remove_active_rule_notes.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/536_remove_active_rule_notes.rb
new file mode 100644 (file)
index 0000000..e83a678
--- /dev/null
@@ -0,0 +1,34 @@
+#
+# SonarQube, open source software quality management tool.
+# Copyright (C) 2008-2014 SonarSource
+# mailto:contact AT sonarsource DOT com
+#
+# SonarQube 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.
+#
+# SonarQube 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.
+#
+
+#
+# SonarQube 4.4
+# SONAR-5064
+#
+class RemoveActiveRuleNotes < ActiveRecord::Migration
+
+  def self.up
+    remove_column('active_rules', 'note_created_at')
+    remove_column('active_rules', 'note_updated_at')
+    remove_column('active_rules', 'note_user_login')
+    remove_column('active_rules', 'note_data')
+  end
+  
+end
index e1daed22d34a07b9c1521127ed84d4c48f5d4870..ad57a647b2f95bb8ad7770defa739f21a0a008e6 100644 (file)
@@ -595,93 +595,4 @@ public class QProfileActiveRuleOperationsTest {
     verifyZeroInteractions(profilesManager);
     verifyZeroInteractions(esActiveRule);
   }
-
-  @Test
-  public void update_active_rule_note_when_no_existing_note() throws Exception {
-    ActiveRuleDto activeRule = new ActiveRuleDto().setId(5).setProfileId(1).setRuleId(10).setSeverity(Severity.MINOR).setNoteCreatedAt(null).setNoteData(null);
-    when(activeRuleDao.selectById(5, session)).thenReturn(activeRule);
-
-    List<ActiveRuleParamDto> activeRuleParams = newArrayList(new ActiveRuleParamDto());
-    when(activeRuleDao.selectParamsByActiveRuleId(eq(5), eq(session))).thenReturn(activeRuleParams);
-
-    long now = System.currentTimeMillis();
-    doReturn(now).when(system).now();
-
-    operations.updateActiveRuleNote(5, "My note", authorizedUserSession);
-
-    ArgumentCaptor<ActiveRuleDto> argumentCaptor = ArgumentCaptor.forClass(ActiveRuleDto.class);
-    verify(activeRuleDao).update(argumentCaptor.capture(), eq(session));
-    assertThat(argumentCaptor.getValue().getNoteData()).isEqualTo("My note");
-    assertThat(argumentCaptor.getValue().getNoteUserLogin()).isEqualTo("nicolas");
-    assertThat(argumentCaptor.getValue().getNoteCreatedAt().getTime()).isEqualTo(now);
-    assertThat(argumentCaptor.getValue().getNoteUpdatedAt().getTime()).isEqualTo(now);
-
-    verify(session).commit();
-    verify(esActiveRule).save(eq(activeRule), eq(activeRuleParams));
-  }
-
-  @Test
-  public void not_update_rule_note_when_empty_note() throws Exception {
-    ActiveRuleDto activeRule = new ActiveRuleDto().setId(5).setProfileId(1).setRuleId(10).setSeverity(Severity.MINOR).setNoteCreatedAt(null).setNoteData(null);
-    when(activeRuleDao.selectById(5, session)).thenReturn(activeRule);
-
-    operations.updateActiveRuleNote(5, "", authorizedUserSession);
-
-    verify(activeRuleDao, never()).update(any(ActiveRuleDto.class), eq(session));
-    verify(session, never()).commit();
-    verifyZeroInteractions(esActiveRule);
-  }
-
-  @Test
-  public void update_active_rule_note_when_already_note() throws Exception {
-    Date createdAt = DateUtils.parseDate("2013-12-20");
-    ActiveRuleDto activeRule = new ActiveRuleDto().setId(5).setProfileId(1).setRuleId(10).setSeverity(Severity.MINOR)
-      .setNoteCreatedAt(createdAt).setNoteData("My previous note").setNoteUserLogin("nicolas");
-    when(activeRuleDao.selectById(5, session)).thenReturn(activeRule);
-
-    List<ActiveRuleParamDto> activeRuleParams = newArrayList(new ActiveRuleParamDto());
-    when(activeRuleDao.selectParamsByActiveRuleId(eq(5), eq(session))).thenReturn(activeRuleParams);
-
-    long now = System.currentTimeMillis();
-    doReturn(now).when(system).now();
-
-    operations.updateActiveRuleNote(5, "My new note", MockUserSession.create().setLogin("guy").setName("Guy").setGlobalPermissions(GlobalPermissions.QUALITY_PROFILE_ADMIN));
-
-    ArgumentCaptor<ActiveRuleDto> argumentCaptor = ArgumentCaptor.forClass(ActiveRuleDto.class);
-    verify(activeRuleDao).update(argumentCaptor.capture(), eq(session));
-    assertThat(argumentCaptor.getValue().getNoteData()).isEqualTo("My new note");
-    assertThat(argumentCaptor.getValue().getNoteUserLogin()).isEqualTo("nicolas");
-    assertThat(argumentCaptor.getValue().getNoteCreatedAt()).isEqualTo(createdAt);
-    assertThat(argumentCaptor.getValue().getNoteUpdatedAt().getTime()).isEqualTo(now);
-
-    verify(session).commit();
-    verify(esActiveRule).save(eq(activeRule), eq(activeRuleParams));
-  }
-
-  @Test
-  public void delete_active_rule_note() throws Exception {
-    Date createdAt = DateUtils.parseDate("2013-12-20");
-    ActiveRuleDto activeRule = new ActiveRuleDto().setId(5).setProfileId(1).setRuleId(10).setSeverity(Severity.MINOR)
-      .setNoteData("My note").setNoteUserLogin("nicolas").setNoteCreatedAt(createdAt).setNoteUpdatedAt(createdAt);
-    when(activeRuleDao.selectById(5, session)).thenReturn(activeRule);
-
-    List<ActiveRuleParamDto> activeRuleParams = newArrayList(new ActiveRuleParamDto());
-    when(activeRuleDao.selectParamsByActiveRuleId(eq(5), eq(session))).thenReturn(activeRuleParams);
-
-    long now = System.currentTimeMillis();
-    doReturn(now).when(system).now();
-
-    operations.deleteActiveRuleNote(5, authorizedUserSession);
-
-    ArgumentCaptor<ActiveRuleDto> argumentCaptor = ArgumentCaptor.forClass(ActiveRuleDto.class);
-    verify(activeRuleDao).update(argumentCaptor.capture());
-    assertThat(argumentCaptor.getValue().getNoteData()).isNull();
-    assertThat(argumentCaptor.getValue().getNoteUserLogin()).isNull();
-    assertThat(argumentCaptor.getValue().getNoteCreatedAt()).isNull();
-    assertThat(argumentCaptor.getValue().getNoteUpdatedAt()).isNull();
-
-    verify(session).commit();
-    verify(esActiveRule).save(eq(activeRule), eq(activeRuleParams));
-  }
-
 }
index a30ee1ceaf86b23d8e724a24dc538766ebb78ece..8838e37ef3627a37a67c86cabbac3c8bfa1133ad 100644 (file)
@@ -326,18 +326,6 @@ public class QProfilesTest {
     verify(activeRuleOperations).revertActiveRule(eq(50), any(UserSession.class));
   }
 
-  @Test
-  public void create_active_rule_note() throws Exception {
-    qProfiles.updateActiveRuleNote(50, "My note");
-    verify(activeRuleOperations).updateActiveRuleNote(eq(50), eq("My note"), any(UserSession.class));
-  }
-
-  @Test
-  public void delete_active_rule_note() throws Exception {
-    qProfiles.deleteActiveRuleNote(50);
-    verify(activeRuleOperations).deleteActiveRuleNote(eq(50), any(UserSession.class));
-  }
-
   @Test
   public void count_active_rules() throws Exception {
     qProfiles.countActiveRules(10);
index 414d5bb632478a184fc0da893890e7ff5b8a4456..0abf30a764d203947b1d19d1a826b5af1bdbc82e 100644 (file)
@@ -9,12 +9,10 @@
 
   <rules_profiles id="2" version="2" used_profile="false" name="child" language="java" parent_name="parent" />
 
-  <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"
-    note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]" />
+  <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"/>
   <active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" rules_parameter_key="param1" value="30"/>
 
-  <active_rules id="2" profile_id="2" rule_id="1" failure_level="2" inheritance="INHERITED"
-    note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]" />
+  <active_rules id="2" profile_id="2" rule_id="1" failure_level="2" inheritance="INHERITED" />
   <active_rule_parameters id="2" active_rule_id="2" rules_parameter_id="1" rules_parameter_key="param1" value="30"/>
 
 </dataset>
index d6989307b66a13658e3796742c197d34add20252..c3ae4eace67dc4398b597c3b8e24b08d235298eb 100644 (file)
 
   <rules_profiles id="3" version="2" used_profile="false" name="child" language="java" parent_name="new_parent" />
 
-  <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"
-    note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]" />
+  <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"/>
 
-  <active_rules id="2" profile_id="2" rule_id="2" failure_level="2" inheritance="[null]"
-    note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]" />
+  <active_rules id="2" profile_id="2" rule_id="2" failure_level="2" inheritance="[null]" />
 
-  <active_rules id="4" profile_id="3" rule_id="2" failure_level="2" inheritance="INHERITED"
-    note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]" />
+  <active_rules id="4" profile_id="3" rule_id="2" failure_level="2" inheritance="INHERITED" />
 
 </dataset>
index fa429c2f63c9df3a37934446a5b3883ce737b029..a8ec4a1ce2baef12b832fe84749fc77e934d2e17 100644 (file)
@@ -7,7 +7,6 @@
 
   <rules_profiles id="2" version="2" used_profile="false" name="child" language="java" parent_name="parent" />
 
-  <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"
-    note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]" />
+  <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"/>
 
 </dataset>
index b5b657f7dccef55a5726d157004c58cc8d7d67ce..4b6b7956e78a47a1d92947b5ada4af29e1afa4b0 100644 (file)
@@ -7,10 +7,8 @@
 
   <rules_profiles id="2" version="1" used_profile="true" name="child" language="java" parent_name="parent" />
 
-  <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"
-    note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]" />
+  <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"/>
 
-  <active_rules id="2" profile_id="2" rule_id="1" failure_level="2" inheritance="[null]"
-    note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]" />
+  <active_rules id="2" profile_id="2" rule_id="1" failure_level="2" inheritance="[null]"/>
 
 </dataset>
index e9b31aeabab7ef6e5ed73fd8236b3ae00a634cc0..917389cb977119f0ea8cbcf3d49373a5ccd1d6eb 100644 (file)
@@ -7,7 +7,6 @@
 
   <rules_profiles id="2" version="2" used_profile="false" name="child" language="java" parent_name="[null]" />
 
-  <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"
-    note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]" />
+  <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"/>
 
 </dataset>
index 2731d011132ca88761e2a0ed0f2eae20b164b857..23842c2d8f96fb17b33d58ccc01b1e0c7c4df7ee 100644 (file)
@@ -7,10 +7,8 @@
 
   <rules_profiles id="2" version="2" used_profile="false" name="child" language="java" parent_name="parent" />
 
-  <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"
-    note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]" />
+  <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"/>
 
-  <active_rules id="2" profile_id="2" rule_id="1" failure_level="2" inheritance="INHERITED"
-    note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]" />
+  <active_rules id="2" profile_id="2" rule_id="1" failure_level="2" inheritance="INHERITED"/>
 
 </dataset>
index 3f4e28b174de8ed773125eb507a3acd512828e7b..bc09b586a0f97c5b822cc13f023729844a506013 100644 (file)
@@ -3,7 +3,6 @@
   <active_rule_changes id="1" username="[null]" profile_id="1" profile_version="2" rule_id="1" enabled="false" old_severity="2" new_severity="[null]"/>
   <active_rule_changes id="2" username="[null]" profile_id="2" profile_version="2" rule_id="1" enabled="false" old_severity="2" new_severity="[null]"/>
 
-  <active_rules id="3" profile_id="2" rule_id="2" failure_level="2" inheritance="[null]"
-    note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]" />
+  <active_rules id="3" profile_id="2" rule_id="2" failure_level="2" inheritance="[null]"/>
 
 </dataset>
index 39e1decb6d15bbbc5cafa79c522e44f9329718b7..e106bb1434c8daf8b133544451f3fabf05200857 100644 (file)
@@ -1,12 +1,9 @@
 <dataset>
 
   <!--<active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"-->
-                <!--note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="some note"/>-->
 
-  <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"
-                note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="john" note_data="other note"/>
+  <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]" />
 
-  <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"
-                note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="other note"/>
+  <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"/>
 
 </dataset>
index 231e470df28a5364bf1a90e7373351c478aa45a3..e9fbac550332681a04c034e094cb80d322629a54 100644 (file)
@@ -1,12 +1,9 @@
 <dataset>
 
-  <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"
-    note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="some note"/>
+  <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"/>
 
   <!--<active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"-->
-    <!--note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="john" note_data="other note"/>-->
 
   <!--<active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"-->
-    <!--note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="other note"/>-->
 
 </dataset>
index 4f066dfeaae84bd32b12d9d64032ba1d0d6c6e1b..fa2ce3f2fb840cdbb561540718e741d22857ec5c 100644 (file)
@@ -1,12 +1,9 @@
 <dataset>
 
-  <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"
-    note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="some note"/>
+  <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"/>
 
-  <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"
-    note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="john" note_data="other note"/>
+  <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"/>
 
   <!--<active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"-->
-    <!--note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="other note"/>-->
 
 </dataset>
index 66bf84129e467cc261b8e29dcc49315e57ae2c1d..3057a933a8e6454c4b8cd31c5c7af8cdf3d48caf 100644 (file)
@@ -1,10 +1,8 @@
 <dataset>
 
-  <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"
-    note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]"/>
+  <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"/>
 
-  <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"
-                note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]"/>
+  <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"/>
 
   <!--<active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" rules_parameter_key="max" value="20"/>-->
   <active_rule_parameters id="2" active_rule_id="1" rules_parameter_id="2" rules_parameter_key="format" value="html"/>
index 4b0e2e7e0e244fa5888bef647457cf7256503d84..d8bb5660f2890cbe94448ed2f5e41413b85e8f95 100644 (file)
@@ -1,10 +1,8 @@
 <dataset>
 
-  <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"
-    note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]"/>
+  <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"/>
 
-  <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"
-                note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]"/>
+  <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"/>
 
   <!--<active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" rules_parameter_key="max" value="20"/>-->
   <!--<active_rule_parameters id="2" active_rule_id="1" rules_parameter_id="2" rules_parameter_key="format" value="html"/>-->
index a77383cece4fe026cf554e9a7777fb8763aeefb3..0bd84f428eaf250b0002ed31f496d74175afef95 100644 (file)
@@ -1,14 +1,11 @@
 <dataset>
 
-  <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"
-                note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="some note"/>
+  <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"/>
 
   <!-- Parent of Active rule 1 -->
-  <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"
-                note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="john" note_data="other note"/>
+  <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"/>
 
-  <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"
-                note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="other note"/>
+  <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"/>
 
   <active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" rules_parameter_key="max" value="20"/>
   <active_rule_parameters id="2" active_rule_id="1" rules_parameter_id="2" rules_parameter_key="format" value="html"/>
index 148ce414a9af07a1c9784f505e71f4f3d33b1b3c..d7a92243391f704bbebfa145a8e73c90c7b40e46 100644 (file)
@@ -1,14 +1,11 @@
 <dataset>
 
-  <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"
-    note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="some note"/>
+  <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"/>
 
   <!-- Parent of Active rule 1 -->
-  <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"
-    note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="john" note_data="other note"/>
+  <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"/>
 
-  <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"
-    note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="other note"/>
+  <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"/>
 
   <active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" rules_parameter_key="max" value="20"/>
   <active_rule_parameters id="2" active_rule_id="1" rules_parameter_id="2" rules_parameter_key="format" value="html"/>
index ee595acf1d80c8f94a22167af25440677744a4c5..0a98d012fad5433eff6fb57406bd70df4192ce95 100644 (file)
@@ -1,6 +1,5 @@
 <dataset>
 
-  <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"
-    note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]"/>
+  <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"/>
 
 </dataset>
index 4f5c6f53de69a8ea7c6720ccf996bcab54f82d4c..17c001f0fb30cc46162fcbdebaeb744927910088 100644 (file)
@@ -1,8 +1,7 @@
 <dataset>
     <rules_parameters id="1" rule_id="10" name="max" param_type="INTEGER" default_value="30" description="My Parameter"/>
 
-    <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"
-                  note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="some note"/>
+    <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"/>
 
     <rules tags="[null]" system_tags="[null]" id="10" plugin_rule_key="Parent1" plugin_name="checkstyle" name="Parent Rule 1" description="Parent Rule 1" status="READY"
            plugin_config_key="Parent1" priority="2" cardinality="SINGLE" language="golo" created_at="1981-10-24 15:20:00" />
index b62e04058642ff311040b1c73f847398513fe1cb..44f40f5b46fbab60a8f60b176fb26aff5360665f 100644 (file)
@@ -5,15 +5,12 @@
     <rules tags="[null]" system_tags="[null]" id="11" plugin_rule_key="Parent2" plugin_name="checkstyle" name="Parent Rule 2" description="Parent Rule 2" status="READY"
            plugin_config_key="Parent1" priority="2" cardinality="SINGLE" language="golo" created_at="1981-10-24 15:20:00" />
 
-    <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"
-    note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="some note"/>
+    <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"/>
 
   <!-- Parent of Active rule 1 -->
-  <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"
-    note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="john" note_data="other note"/>
+  <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"/>
 
-  <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"
-    note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="other note"/>
+  <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"/>
 
   <active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" rules_parameter_key="max" value="20"/>
   <active_rule_parameters id="2" active_rule_id="1" rules_parameter_id="2" rules_parameter_key="format" value="html"/>
index e0c60d70e890a63ae682b2f6a24648efa9421281..d30e3009c23ce1c77836d9bbf93a58bbe7dec440 100644 (file)
@@ -1,12 +1,9 @@
 <dataset>
 
-  <active_rules id="1" profile_id="1" rule_id="10" failure_level="4" inheritance="[null]"
-                note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="text"/>
+  <active_rules id="1" profile_id="1" rule_id="10" failure_level="4" inheritance="[null]"/>
 
-  <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"
-                note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="john" note_data="other note"/>
+  <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"/>
 
-  <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"
-                note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="other note"/>
+  <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"/>
 
 </dataset>