aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/VariationDecorator.java16
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/ViolationPersisterDecorator.java2
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/ViolationTrackingDecorator.java2
-rw-r--r--plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shared.xml4
-rw-r--r--plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shouldCopyPermanentIdFromReferenceViolation-result.xml6
-rw-r--r--plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shouldSaveViolations-result.xml10
-rw-r--r--plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/api/PurgeUtilsTest/purgeSnapshots-result.xml16
-rw-r--r--plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/api/PurgeUtilsTest/purgeSnapshots.xml16
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/DefaultTimeMachine.java4
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/components/PastMeasuresLoader.java8
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/index/MeasurePersister.java2
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/components/PastMeasuresLoaderTest.java8
-rw-r--r--sonar-batch/src/test/resources/org/sonar/batch/index/MeasurePersisterTest/shared.xml2
-rw-r--r--sonar-batch/src/test/resources/org/sonar/batch/index/MeasurePersisterTest/shouldDelaySaving-result.xml6
-rw-r--r--sonar-batch/src/test/resources/org/sonar/batch/index/MeasurePersisterTest/shouldInsertMeasure-result.xml4
-rw-r--r--sonar-batch/src/test/resources/org/sonar/batch/index/MeasurePersisterTest/shouldNotDelaySavingWithDatabaseOnlyMeasure-result.xml6
-rw-r--r--sonar-batch/src/test/resources/org/sonar/batch/index/MeasurePersisterTest/shouldUpdateMeasure-result.xml2
-rw-r--r--sonar-core/src/main/java/org/sonar/jpa/entity/SchemaMigration.java2
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/persistence/rows-derby.sql3
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/persistence/schema-derby.ddl4
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteSnapshot-result.xml4
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteSnapshot.xml10
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot-result.xml10
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot.xml10
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldPurgeSnapshot-result.xml8
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldPurgeSnapshot.xml8
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/database/model/MeasureModel.java14
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/database/model/RuleFailureModel.java12
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/measures/Measure.java14
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/measures/MeasuresFilters.java3
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/measures/RuleMeasure.java6
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/rules/Violation.java10
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/measures/MeasureTest.java6
-rw-r--r--sonar-server/src/main/java/org/sonar/server/filters/FilterExecutor.java2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/api/resources_controller.rb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/api/timemachine_controller.rb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/components_controller.rb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/timemachine_controller.rb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/helpers/components_helper.rb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/models/drilldown.rb4
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/models/filter_context.rb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/models/project.rb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/models/snapshot.rb14
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/models/trends_chart.rb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/256_add_measures_person.rb (renamed from sonar-server/src/main/webapp/WEB-INF/db/migrate/256_add_measures_committer.rb)4
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/263_replace_rule_failures_committer_by_person.rb31
46 files changed, 171 insertions, 138 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/VariationDecorator.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/VariationDecorator.java
index dab6531f557..049bedc4a56 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/VariationDecorator.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/VariationDecorator.java
@@ -98,10 +98,10 @@ public class VariationDecorator implements Decorator {
// compare with past measure
Integer metricId = (measure.getMetric().getId() != null ? measure.getMetric().getId() : metricFinder.findByKey(measure.getMetric().getKey()).getId());
Integer characteristicId = (measure.getCharacteristic() != null ? measure.getCharacteristic().getId() : null);
- String committer = measure.getCommitter();
+ Integer personId = measure.getPersonId();
Integer ruleId = (measure instanceof RuleMeasure ? ((RuleMeasure)measure).getRule().getId() : null);
- Object[] pastMeasure = pastMeasuresByKey.get(new MeasureKey(metricId, characteristicId, committer, ruleId));
+ Object[] pastMeasure = pastMeasuresByKey.get(new MeasureKey(metricId, characteristicId, personId, ruleId));
if (updateVariation(measure, pastMeasure, index)) {
context.saveMeasure(measure);
}
@@ -125,20 +125,20 @@ public class VariationDecorator implements Decorator {
static final class MeasureKey {
int metricId;
Integer characteristicId;
- String committer;
+ Integer personId;
Integer ruleId;
MeasureKey(Object[] pastFields) {
metricId = PastMeasuresLoader.getMetricId(pastFields);
characteristicId = PastMeasuresLoader.getCharacteristicId(pastFields);
- committer = PastMeasuresLoader.getCommitter(pastFields);
+ personId = PastMeasuresLoader.getPersonId(pastFields);
ruleId = PastMeasuresLoader.getRuleId(pastFields);
}
- MeasureKey(int metricId, Integer characteristicId, String committer, Integer ruleId) {
+ MeasureKey(int metricId, Integer characteristicId, Integer personId, Integer ruleId) {
this.metricId = metricId;
this.characteristicId = characteristicId;
- this.committer = committer;
+ this.personId = personId;
this.ruleId = ruleId;
}
@@ -157,7 +157,7 @@ public class VariationDecorator implements Decorator {
if (characteristicId != null ? !characteristicId.equals(that.characteristicId) : that.characteristicId != null) {
return false;
}
- if (committer != null ? !committer.equals(that.committer) : that.committer != null) {
+ if (personId != null ? !personId.equals(that.personId) : that.personId != null) {
return false;
}
if (ruleId != null ? !ruleId.equals(that.ruleId) : that.ruleId != null) {
@@ -170,7 +170,7 @@ public class VariationDecorator implements Decorator {
public int hashCode() {
int result = metricId;
result = 31 * result + (characteristicId != null ? characteristicId.hashCode() : 0);
- result = 31 * result + (committer != null ? committer.hashCode() : 0);
+ result = 31 * result + (personId != null ? personId.hashCode() : 0);
result = 31 * result + (ruleId != null ? ruleId.hashCode() : 0);
return result;
}
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/ViolationPersisterDecorator.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/ViolationPersisterDecorator.java
index 189f72718b9..5a610cbc539 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/ViolationPersisterDecorator.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/ViolationPersisterDecorator.java
@@ -96,7 +96,7 @@ public class ViolationPersisterDecorator implements Decorator {
model.setChecksum(violation.getChecksum());
model.setCreatedAt(violation.getCreatedAt());
model.setSwitchedOff(violation.isSwitchedOff());
- model.setCommitter(violation.getCommitter());
+ model.setPersonId(violation.getPersonId());
return model;
}
}
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/ViolationTrackingDecorator.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/ViolationTrackingDecorator.java
index b1ce4bbc982..dd175ec7a65 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/ViolationTrackingDecorator.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/ViolationTrackingDecorator.java
@@ -211,7 +211,7 @@ public class ViolationTrackingDecorator implements Decorator {
newViolation.setCreatedAt(pastViolation.getCreatedAt());
newViolation.setPermanentId(pastViolation.getPermanentId());
newViolation.setSwitchedOff(pastViolation.isSwitchedOff());
- newViolation.setCommitter(pastViolation.getCommitter());
+ newViolation.setPersonId(pastViolation.getPersonId());
newViolation.setNew(false);
pastViolationsByRule.remove(newViolation.getRule().getId(), pastViolation);
violationMap.put(newViolation, pastViolation);
diff --git a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shared.xml b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shared.xml
index 039debd839a..af40b4e9924 100644
--- a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shared.xml
+++ b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shared.xml
@@ -22,7 +22,7 @@
status="U" islast="false" depth="3"/>
<rule_failures switched_off="false" permanent_id="1" ID="1" SNAPSHOT_ID="1000" RULE_ID="30" FAILURE_LEVEL="3" MESSAGE="old message" LINE="10" COST="[null]"
- created_at="2008-11-01 13:58:00.00" checksum="[null]" committer="[null]"/>
+ created_at="2008-11-01 13:58:00.00" checksum="[null]" person_id="[null]"/>
<rule_failures switched_off="true" permanent_id="2" ID="2" SNAPSHOT_ID="1000" RULE_ID="30" FAILURE_LEVEL="3" MESSAGE="old message" LINE="10" COST="[null]"
- created_at="2008-11-01 13:58:00.00" checksum="[null]" committer="[null]"/>
+ created_at="2008-11-01 13:58:00.00" checksum="[null]" person_id="[null]"/>
</dataset>
diff --git a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shouldCopyPermanentIdFromReferenceViolation-result.xml b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shouldCopyPermanentIdFromReferenceViolation-result.xml
index 5ea2a38f4a1..c194c9d12f6 100644
--- a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shouldCopyPermanentIdFromReferenceViolation-result.xml
+++ b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shouldCopyPermanentIdFromReferenceViolation-result.xml
@@ -22,10 +22,10 @@
status="U" islast="false" depth="3"/>
<rule_failures switched_off="false" permanent_id="1" ID="1" SNAPSHOT_ID="1000" RULE_ID="30" FAILURE_LEVEL="3" MESSAGE="old message" LINE="10" COST="[null]"
- created_at="2008-11-01 13:58:00.00" checksum="[null]" committer="[null]"/>
+ created_at="2008-11-01 13:58:00.00" checksum="[null]" person_id="[null]"/>
<rule_failures switched_off="true" permanent_id="2" ID="2" SNAPSHOT_ID="1000" RULE_ID="30" FAILURE_LEVEL="3" MESSAGE="old message" LINE="10" COST="[null]"
- created_at="2008-11-01 13:58:00.00" checksum="[null]" committer="[null]"/>
+ created_at="2008-11-01 13:58:00.00" checksum="[null]" person_id="[null]"/>
<rule_failures switched_off="false" permanent_id="1" ID="3" SNAPSHOT_ID="1000" RULE_ID="30" FAILURE_LEVEL="2" MESSAGE="new message" LINE="[null]" COST="[null]"
- created_at="[null]" checksum="[null]" committer="[null]"/>
+ created_at="[null]" checksum="[null]" person_id="[null]"/>
</dataset>
diff --git a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shouldSaveViolations-result.xml b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shouldSaveViolations-result.xml
index cb141d795df..869a9459c80 100644
--- a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shouldSaveViolations-result.xml
+++ b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shouldSaveViolations-result.xml
@@ -21,13 +21,13 @@
status="U" islast="false" depth="3"/>
<rule_failures switched_off="false" permanent_id="1" ID="1" SNAPSHOT_ID="1000" RULE_ID="30" FAILURE_LEVEL="3" MESSAGE="old message" LINE="10" COST="[null]"
- created_at="2008-11-01 13:58:00.00" checksum="[null]" committer="[null]"/>
+ created_at="2008-11-01 13:58:00.00" checksum="[null]" person_id="[null]"/>
<rule_failures switched_off="true" permanent_id="2" ID="2" SNAPSHOT_ID="1000" RULE_ID="30" FAILURE_LEVEL="3" MESSAGE="old message" LINE="10" COST="[null]"
- created_at="2008-11-01 13:58:00.00" checksum="[null]" committer="[null]"/>
+ created_at="2008-11-01 13:58:00.00" checksum="[null]" person_id="[null]"/>
<rule_failures switched_off="false" permanent_id="3" ID="3" SNAPSHOT_ID="1000" RULE_ID="30" FAILURE_LEVEL="3" MESSAGE="the message" LINE="20" COST="55.6"
- created_at="2010-12-25 00:00:00.00" checksum="checksum" committer="[null]"/>
+ created_at="2010-12-25 00:00:00.00" checksum="checksum" person_id="[null]"/>
<rule_failures switched_off="false" permanent_id="4" ID="4" SNAPSHOT_ID="1000" RULE_ID="30" FAILURE_LEVEL="3" MESSAGE="[null]" LINE="50" COST="80" created_at="[null]"
- checksum="[null]" committer="[null]"/>
+ checksum="[null]" person_id="[null]"/>
<rule_failures switched_off="true" permanent_id="5" ID="5" SNAPSHOT_ID="1000" RULE_ID="31" FAILURE_LEVEL="1" MESSAGE="[null]" LINE="[null]" COST="[null]" created_at="[null]"
- checksum="[null]" committer="[null]"/>
+ checksum="[null]" person_id="[null]"/>
</dataset>
diff --git a/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/api/PurgeUtilsTest/purgeSnapshots-result.xml b/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/api/PurgeUtilsTest/purgeSnapshots-result.xml
index daa989bd2ad..3fd471af8ce 100644
--- a/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/api/PurgeUtilsTest/purgeSnapshots-result.xml
+++ b/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/api/PurgeUtilsTest/purgeSnapshots-result.xml
@@ -61,18 +61,18 @@
<rule_failures switched_off="[null]" permanent_id="[null]" ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00"
- checksum="[null]" committer="[null]"/>
+ checksum="[null]" person_id="[null]"/>
<rule_failures switched_off="[null]" permanent_id="[null]" ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00"
- checksum="[null]" committer="[null]"/>
- <!--<rule_failures switched_off="[null]" permanent_id="[null]" ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]" committer="[null]" />-->
- <!--<rule_failures switched_off="[null]" permanent_id="[null]" ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]" committer="[null]" />-->
+ checksum="[null]" person_id="[null]"/>
+ <!--<rule_failures switched_off="[null]" permanent_id="[null]" ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]" person_id="[null]" />-->
+ <!--<rule_failures switched_off="[null]" permanent_id="[null]" ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]" person_id="[null]" />-->
<project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
rule_priority="[null]"
alert_text="[null]" ID="1" VALUE="10.0" METRIC_ID="1" SNAPSHOT_ID="1" rules_category_id="[null]"
RULE_ID="1"
- committer="[null]"
+ person_id="[null]"
text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
alert_status="[null]" description="[null]"/>
@@ -80,7 +80,7 @@
rule_priority="[null]"
alert_text="[null]" ID="2" VALUE="10.0" METRIC_ID="1" SNAPSHOT_ID="2" rules_category_id="[null]"
RULE_ID="1"
- committer="[null]"
+ person_id="[null]"
text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
alert_status="[null]" description="[null]"/>
@@ -88,7 +88,7 @@
<!--rule_priority="[null]"-->
<!--alert_text="[null]" ID="3" VALUE="10.0" METRIC_ID="1" SNAPSHOT_ID="3" rules_category_id="[null]"-->
<!--RULE_ID="1"-->
- <!--committer="[null]"-->
+ <!--person_id="[null]"-->
<!--text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"-->
<!--alert_status="[null]" description="[null]"/>-->
@@ -96,7 +96,7 @@
<!--rule_priority="[null]"-->
<!--alert_text="[null]" ID="4" VALUE="10.0" METRIC_ID="1" SNAPSHOT_ID="4" rules_category_id="[null]"-->
<!--RULE_ID="1"-->
- <!--committer="[null]"-->
+ <!--person_id="[null]"-->
<!--text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"-->
<!--alert_status="[null]" description="[null]"/>-->
diff --git a/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/api/PurgeUtilsTest/purgeSnapshots.xml b/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/api/PurgeUtilsTest/purgeSnapshots.xml
index 9d20d5a0f09..fb0c0b5e52e 100644
--- a/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/api/PurgeUtilsTest/purgeSnapshots.xml
+++ b/plugins/sonar-dbcleaner-plugin/src/test/resources/org/sonar/plugins/dbcleaner/api/PurgeUtilsTest/purgeSnapshots.xml
@@ -65,20 +65,20 @@
<rule_failures switched_off="[null]" permanent_id="[null]" ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00"
- checksum="[null]" committer="[null]"/>
+ checksum="[null]" person_id="[null]"/>
<rule_failures switched_off="[null]" permanent_id="[null]" ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00"
- checksum="[null]" committer="[null]"/>
+ checksum="[null]" person_id="[null]"/>
<rule_failures switched_off="[null]" permanent_id="[null]" ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00"
- checksum="[null]" committer="[null]"/>
+ checksum="[null]" person_id="[null]"/>
<rule_failures switched_off="[null]" permanent_id="[null]" ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00"
- checksum="[null]" committer="[null]"/>
+ checksum="[null]" person_id="[null]"/>
<project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
rule_priority="[null]"
alert_text="[null]" ID="1" VALUE="10.0" METRIC_ID="1" SNAPSHOT_ID="1" rules_category_id="[null]"
RULE_ID="1"
- committer="[null]"
+ person_id="[null]"
text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
alert_status="[null]" description="[null]"/>
@@ -86,7 +86,7 @@
rule_priority="[null]"
alert_text="[null]" ID="2" VALUE="10.0" METRIC_ID="1" SNAPSHOT_ID="2" rules_category_id="[null]"
RULE_ID="1"
- committer="[null]"
+ person_id="[null]"
text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
alert_status="[null]" description="[null]"/>
@@ -94,7 +94,7 @@
rule_priority="[null]"
alert_text="[null]" ID="3" VALUE="10.0" METRIC_ID="1" SNAPSHOT_ID="3" rules_category_id="[null]"
RULE_ID="1"
- committer="[null]"
+ person_id="[null]"
text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
alert_status="[null]" description="[null]"/>
@@ -102,7 +102,7 @@
rule_priority="[null]"
alert_text="[null]" ID="4" VALUE="10.0" METRIC_ID="1" SNAPSHOT_ID="4" rules_category_id="[null]"
RULE_ID="1"
- committer="[null]"
+ person_id="[null]"
text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
alert_status="[null]" description="[null]"/>
diff --git a/sonar-batch/src/main/java/org/sonar/batch/DefaultTimeMachine.java b/sonar-batch/src/main/java/org/sonar/batch/DefaultTimeMachine.java
index 326dfbb9b2d..c96674fd8b5 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/DefaultTimeMachine.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/DefaultTimeMachine.java
@@ -100,7 +100,7 @@ public class DefaultTimeMachine implements TimeMachine {
params.put("lib", Qualifiers.LIBRARY);
sb.append(" AND m.characteristic IS NULL");
- sb.append(" AND m.committer IS NULL");
+ sb.append(" AND m.personId IS NULL");
sb.append(" AND m.ruleId IS NULL AND m.rulePriority IS NULL");
if (!metricIds.isEmpty()) {
sb.append(" AND m.metricId IN (:metricIds) ");
@@ -162,7 +162,7 @@ public class DefaultTimeMachine implements TimeMachine {
measure.setVariation5(model.getVariationValue5());
measure.setUrl(model.getUrl());
measure.setCharacteristic(model.getCharacteristic());
- measure.setCommitter(model.getCommitter());
+ measure.setPersonId(model.getPersonId());
return measure;
}
}
diff --git a/sonar-batch/src/main/java/org/sonar/batch/components/PastMeasuresLoader.java b/sonar-batch/src/main/java/org/sonar/batch/components/PastMeasuresLoader.java
index 7b2560a3e28..2d2725cae50 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/components/PastMeasuresLoader.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/components/PastMeasuresLoader.java
@@ -65,7 +65,7 @@ public class PastMeasuresLoader implements BatchExtension {
}
public List<Object[]> getPastMeasures(String resourceKey, Snapshot projectPastSnapshot) {
- String sql = "select m.metric_id, m.characteristic_id, m.committer, m.rule_id, m.value from project_measures m, snapshots s" +
+ String sql = "select m.metric_id, m.characteristic_id, m.person_id, m.rule_id, m.value from project_measures m, snapshots s" +
" where m.snapshot_id=s.id and m.metric_id in (:metricIds) " +
" and (s.root_snapshot_id=:rootSnapshotId or s.id=:rootSnapshotId) " +
" and s.status=:status and s.project_id=(select p.id from projects p where p.kee=:resourceKey and p.qualifier<>:lib)";
@@ -89,8 +89,10 @@ public class PastMeasuresLoader implements BatchExtension {
return number != null ? number.intValue() : null;
}
- public static String getCommitter(Object[] row) {
- return (String) row[2];
+ public static Integer getPersonId(Object[] row) {
+ // can be BigDecimal on Oracle
+ Number number = (Number) row[2];
+ return number != null ? number.intValue() : null;
}
public static Integer getRuleId(Object[] row) {
diff --git a/sonar-batch/src/main/java/org/sonar/batch/index/MeasurePersister.java b/sonar-batch/src/main/java/org/sonar/batch/index/MeasurePersister.java
index 8552118e54c..ddc1df16b7e 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/index/MeasurePersister.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/index/MeasurePersister.java
@@ -150,7 +150,7 @@ public final class MeasurePersister {
merge.setVariationValue5(measure.getVariation5());
merge.setUrl(measure.getUrl());
merge.setCharacteristic(measure.getCharacteristic());
- merge.setCommitter(measure.getCommitter());
+ merge.setPersonId(measure.getPersonId());
if (measure.getValue() != null) {
merge.setValue(measure.getValue().doubleValue());
} else {
diff --git a/sonar-batch/src/test/java/org/sonar/batch/components/PastMeasuresLoaderTest.java b/sonar-batch/src/test/java/org/sonar/batch/components/PastMeasuresLoaderTest.java
index 5c4e9638507..44d004adecd 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/components/PastMeasuresLoaderTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/components/PastMeasuresLoaderTest.java
@@ -52,13 +52,13 @@ public class PastMeasuresLoaderTest extends AbstractDbUnitTestCase {
Object[] pastMeasure = measures.get(0);
assertThat(PastMeasuresLoader.getMetricId(pastMeasure), is(1));
assertThat(PastMeasuresLoader.getCharacteristicId(pastMeasure), nullValue());
- assertThat(PastMeasuresLoader.getCommitter(pastMeasure), nullValue());
+ assertThat(PastMeasuresLoader.getPersonId(pastMeasure), nullValue());
assertThat(PastMeasuresLoader.getValue(pastMeasure), is(5.0));
pastMeasure = measures.get(1);
assertThat(PastMeasuresLoader.getMetricId(pastMeasure), is(2));
assertThat(PastMeasuresLoader.getCharacteristicId(pastMeasure), nullValue());
- assertThat(PastMeasuresLoader.getCommitter(pastMeasure), nullValue());
+ assertThat(PastMeasuresLoader.getPersonId(pastMeasure), nullValue());
assertThat(PastMeasuresLoader.getValue(pastMeasure), is(60.0));
}
@@ -76,13 +76,13 @@ public class PastMeasuresLoaderTest extends AbstractDbUnitTestCase {
Object[] pastMeasure = measures.get(0);
assertThat(PastMeasuresLoader.getMetricId(pastMeasure), is(1));
assertThat(PastMeasuresLoader.getCharacteristicId(pastMeasure), nullValue());
- assertThat(PastMeasuresLoader.getCommitter(pastMeasure), nullValue());
+ assertThat(PastMeasuresLoader.getPersonId(pastMeasure), nullValue());
assertThat(PastMeasuresLoader.getValue(pastMeasure), is(60.0));
pastMeasure = measures.get(1);
assertThat(PastMeasuresLoader.getMetricId(pastMeasure), is(2));
assertThat(PastMeasuresLoader.getCharacteristicId(pastMeasure), nullValue());
- assertThat(PastMeasuresLoader.getCommitter(pastMeasure), nullValue());
+ assertThat(PastMeasuresLoader.getPersonId(pastMeasure), nullValue());
assertThat(PastMeasuresLoader.getValue(pastMeasure), is(80.0));
}
diff --git a/sonar-batch/src/test/resources/org/sonar/batch/index/MeasurePersisterTest/shared.xml b/sonar-batch/src/test/resources/org/sonar/batch/index/MeasurePersisterTest/shared.xml
index b3e9936d13b..2b8c2b91a70 100644
--- a/sonar-batch/src/test/resources/org/sonar/batch/index/MeasurePersisterTest/shared.xml
+++ b/sonar-batch/src/test/resources/org/sonar/batch/index/MeasurePersisterTest/shared.xml
@@ -33,7 +33,7 @@
<project_measures id="1" VALUE="60" METRIC_ID="2" SNAPSHOT_ID="3001" alert_text="[null]" RULES_CATEGORY_ID="[null]"
RULE_ID="[null]" text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
alert_status="[null]" description="[null]" rule_priority="[null]" characteristic_id="[null]" url="[null]"
- committer="[null]"
+ person_id="[null]"
variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"/>
</dataset>
diff --git a/sonar-batch/src/test/resources/org/sonar/batch/index/MeasurePersisterTest/shouldDelaySaving-result.xml b/sonar-batch/src/test/resources/org/sonar/batch/index/MeasurePersisterTest/shouldDelaySaving-result.xml
index cca7f553c6a..b6f2c36971e 100644
--- a/sonar-batch/src/test/resources/org/sonar/batch/index/MeasurePersisterTest/shouldDelaySaving-result.xml
+++ b/sonar-batch/src/test/resources/org/sonar/batch/index/MeasurePersisterTest/shouldDelaySaving-result.xml
@@ -33,20 +33,20 @@
<project_measures id="1" VALUE="60" METRIC_ID="2" SNAPSHOT_ID="3001" alert_text="[null]" RULES_CATEGORY_ID="[null]"
RULE_ID="[null]" text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
alert_status="[null]" description="[null]" rule_priority="[null]" characteristic_id="[null]" url="[null]"
- committer="[null]"
+ person_id="[null]"
variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"/>
<project_measures id="2" VALUE="1234.0" METRIC_ID="1" SNAPSHOT_ID="3001" alert_text="[null]"
RULES_CATEGORY_ID="[null]"
RULE_ID="[null]" text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
alert_status="[null]" description="[null]" rule_priority="[null]" characteristic_id="[null]" url="[null]"
- committer="[null]"
+ person_id="[null]"
variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"/>
<project_measures id="3" VALUE="50.0" METRIC_ID="1" SNAPSHOT_ID="3002" alert_text="[null]" RULES_CATEGORY_ID="[null]"
RULE_ID="[null]" text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
alert_status="[null]" description="[null]" rule_priority="[null]" characteristic_id="[null]" url="[null]"
- committer="[null]"
+ person_id="[null]"
variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"/>
diff --git a/sonar-batch/src/test/resources/org/sonar/batch/index/MeasurePersisterTest/shouldInsertMeasure-result.xml b/sonar-batch/src/test/resources/org/sonar/batch/index/MeasurePersisterTest/shouldInsertMeasure-result.xml
index 65045ce8147..933b0fff827 100644
--- a/sonar-batch/src/test/resources/org/sonar/batch/index/MeasurePersisterTest/shouldInsertMeasure-result.xml
+++ b/sonar-batch/src/test/resources/org/sonar/batch/index/MeasurePersisterTest/shouldInsertMeasure-result.xml
@@ -33,13 +33,13 @@
<project_measures id="1" VALUE="60" METRIC_ID="2" SNAPSHOT_ID="3001" alert_text="[null]" RULES_CATEGORY_ID="[null]"
RULE_ID="[null]" text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
alert_status="[null]" description="[null]" rule_priority="[null]" characteristic_id="[null]" url="[null]"
- committer="[null]"
+ person_id="[null]"
variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"/>
<project_measures id="2" VALUE="1234.0" METRIC_ID="1" SNAPSHOT_ID="3001" alert_text="[null]" RULES_CATEGORY_ID="[null]"
RULE_ID="[null]" text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
alert_status="[null]" description="[null]" rule_priority="[null]" characteristic_id="[null]" url="[null]"
- committer="[null]"
+ person_id="[null]"
variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"/>
</dataset>
diff --git a/sonar-batch/src/test/resources/org/sonar/batch/index/MeasurePersisterTest/shouldNotDelaySavingWithDatabaseOnlyMeasure-result.xml b/sonar-batch/src/test/resources/org/sonar/batch/index/MeasurePersisterTest/shouldNotDelaySavingWithDatabaseOnlyMeasure-result.xml
index 087482acc04..edc7e905a03 100644
--- a/sonar-batch/src/test/resources/org/sonar/batch/index/MeasurePersisterTest/shouldNotDelaySavingWithDatabaseOnlyMeasure-result.xml
+++ b/sonar-batch/src/test/resources/org/sonar/batch/index/MeasurePersisterTest/shouldNotDelaySavingWithDatabaseOnlyMeasure-result.xml
@@ -33,20 +33,20 @@
<project_measures id="1" VALUE="60" METRIC_ID="2" SNAPSHOT_ID="3001" alert_text="[null]" RULES_CATEGORY_ID="[null]"
RULE_ID="[null]" text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
alert_status="[null]" description="[null]" rule_priority="[null]" characteristic_id="[null]" url="[null]"
- committer="[null]"
+ person_id="[null]"
variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"/>
<project_measures id="2" VALUE="1234.0" METRIC_ID="1" SNAPSHOT_ID="3001" alert_text="[null]" RULES_CATEGORY_ID="[null]"
RULE_ID="[null]" text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
alert_status="[null]" description="[null]" rule_priority="[null]" characteristic_id="[null]" url="[null]"
- committer="[null]"
+ person_id="[null]"
variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"/>
<!-- delayed -->
<!--<project_measures id="3" VALUE="50.0" METRIC_ID="1" SNAPSHOT_ID="3002" alert_text="[null]" RULES_CATEGORY_ID="[null]"-->
<!--RULE_ID="[null]" text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"-->
<!--alert_status="[null]" description="[null]" rule_priority="[null]" characteristic_id="[null]" url="[null]"-->
- <!--committer="[null]"-->
+ <!--person_id="[null]"-->
<!--variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"/>-->
diff --git a/sonar-batch/src/test/resources/org/sonar/batch/index/MeasurePersisterTest/shouldUpdateMeasure-result.xml b/sonar-batch/src/test/resources/org/sonar/batch/index/MeasurePersisterTest/shouldUpdateMeasure-result.xml
index d36cda4f4a2..4758f158973 100644
--- a/sonar-batch/src/test/resources/org/sonar/batch/index/MeasurePersisterTest/shouldUpdateMeasure-result.xml
+++ b/sonar-batch/src/test/resources/org/sonar/batch/index/MeasurePersisterTest/shouldUpdateMeasure-result.xml
@@ -33,7 +33,7 @@
<project_measures id="1" VALUE="12.5" METRIC_ID="2" SNAPSHOT_ID="3001" alert_text="[null]" RULES_CATEGORY_ID="[null]"
RULE_ID="[null]" text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
alert_status="[null]" description="[null]" rule_priority="[null]" characteristic_id="[null]" url="[null]"
- committer="[null]"
+ person_id="[null]"
variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"/>
</dataset>
diff --git a/sonar-core/src/main/java/org/sonar/jpa/entity/SchemaMigration.java b/sonar-core/src/main/java/org/sonar/jpa/entity/SchemaMigration.java
index 610d9586c5a..9c79cdab541 100644
--- a/sonar-core/src/main/java/org/sonar/jpa/entity/SchemaMigration.java
+++ b/sonar-core/src/main/java/org/sonar/jpa/entity/SchemaMigration.java
@@ -34,7 +34,7 @@ public class SchemaMigration {
public final static int VERSION_UNKNOWN = -1;
- public static final int LAST_VERSION = 262;
+ public static final int LAST_VERSION = 263;
public static final int VERSION_2_13 = 241;
public final static String TABLE_NAME = "schema_migrations";
diff --git a/sonar-core/src/main/resources/org/sonar/core/persistence/rows-derby.sql b/sonar-core/src/main/resources/org/sonar/core/persistence/rows-derby.sql
index 1038bf1ddc2..814ce5a3896 100644
--- a/sonar-core/src/main/resources/org/sonar/core/persistence/rows-derby.sql
+++ b/sonar-core/src/main/resources/org/sonar/core/persistence/rows-derby.sql
@@ -126,7 +126,6 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('139');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('140');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('141');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('142');
-INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('150');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('151');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('160');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('162');
@@ -138,7 +137,6 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('168');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('169');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('170');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('180');
-INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('181');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('190');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('191');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('200');
@@ -180,6 +178,7 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('259');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('260');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('261');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('262');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('263');
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;
diff --git a/sonar-core/src/main/resources/org/sonar/core/persistence/schema-derby.ddl b/sonar-core/src/main/resources/org/sonar/core/persistence/schema-derby.ddl
index e301e098883..76401c8acc2 100644
--- a/sonar-core/src/main/resources/org/sonar/core/persistence/schema-derby.ddl
+++ b/sonar-core/src/main/resources/org/sonar/core/persistence/schema-derby.ddl
@@ -269,7 +269,7 @@ CREATE TABLE "PROJECT_MEASURES" (
"DESCRIPTION" VARCHAR(4000),
"RULE_PRIORITY" INTEGER,
"CHARACTERISTIC_ID" INTEGER,
- "COMMITTER" VARCHAR(100),
+ "PERSON_ID" INTEGER,
"VARIATION_VALUE_1" DECIMAL(30,20),
"VARIATION_VALUE_2" DECIMAL(30,20),
"VARIATION_VALUE_3" DECIMAL(30,20),
@@ -435,7 +435,7 @@ CREATE TABLE "RULE_FAILURES" (
"CHECKSUM" VARCHAR(1000),
"PERMANENT_ID" INTEGER,
"SWITCHED_OFF" BOOLEAN,
- "COMMITTER" VARCHAR(100)
+ "PERSON_ID" INTEGER
);
CREATE TABLE "METRICS" (
diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteSnapshot-result.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteSnapshot-result.xml
index 4d1a6497fbd..6734c0522a8 100644
--- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteSnapshot-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteSnapshot-result.xml
@@ -17,14 +17,14 @@
<rule_failures switched_off="[null]" permanent_id="[null]" ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2"
MESSAGE="msg1" LINE="[null]" COST="[null]"
created_at="2008-12-02 13:58:00.00"
- checksum="[null]" committer="[null]"/>
+ checksum="[null]" person_id="[null]"/>
<project_measures ID="1" characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]"
variation_value_3="[null]" variation_value_4="[null]"
variation_value_5="[null]"
rule_priority="[null]"
alert_text="[null]" VALUE="10.0" METRIC_ID="1" SNAPSHOT_ID="1" rules_category_id="[null]"
RULE_ID="1"
- committer="[null]"
+ person_id="[null]"
text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
alert_status="[null]" description="[null]"/>
<measure_data id="1" measure_id="1" snapshot_id="1" data="[null]"/>
diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteSnapshot.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteSnapshot.xml
index 44e7dc5dcda..61ebfe5caab 100644
--- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteSnapshot.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteSnapshot.xml
@@ -15,14 +15,14 @@
<rule_failures switched_off="[null]" permanent_id="[null]" ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2"
MESSAGE="msg1" LINE="[null]" COST="[null]"
created_at="2008-12-02 13:58:00.00"
- checksum="[null]" committer="[null]"/>
+ checksum="[null]" person_id="[null]"/>
<project_measures ID="1" characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]"
variation_value_3="[null]" variation_value_4="[null]"
variation_value_5="[null]"
rule_priority="[null]"
alert_text="[null]" VALUE="10.0" METRIC_ID="1" SNAPSHOT_ID="1" rules_category_id="[null]"
RULE_ID="1"
- committer="[null]"
+ person_id="[null]"
text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
alert_status="[null]" description="[null]"/>
<measure_data id="1" measure_id="1" snapshot_id="1" data="[null]"/>
@@ -48,18 +48,18 @@
<rule_failures switched_off="[null]" permanent_id="[null]" ID="3" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2"
MESSAGE="msg3" LINE="[null]" COST="[null]"
created_at="2008-12-02 13:58:00.00"
- checksum="[null]" committer="[null]"/>
+ checksum="[null]" person_id="[null]"/>
<rule_failures switched_off="[null]" permanent_id="[null]" ID="4" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2"
MESSAGE="msg4" LINE="[null]" COST="[null]"
created_at="2008-12-02 13:58:00.00"
- checksum="[null]" committer="[null]"/>
+ checksum="[null]" person_id="[null]"/>
<project_measures ID="2" characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]"
variation_value_3="[null]" variation_value_4="[null]"
variation_value_5="[null]"
rule_priority="[null]"
alert_text="[null]" VALUE="10.0" METRIC_ID="1" SNAPSHOT_ID="5" rules_category_id="[null]"
RULE_ID="1"
- committer="[null]"
+ person_id="[null]"
text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
alert_status="[null]" description="[null]"/>
<measure_data id="2" measure_id="2" snapshot_id="5" data="[null]"/>
diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot-result.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot-result.xml
index dcfd0d0df95..d264293021c 100644
--- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot-result.xml
@@ -32,7 +32,7 @@
variation_value_4="[null]"
variation_value_5="[null]" rule_priority="[null]" alert_text="[null]" value="10.0"
rules_category_id="[null]"
- committer="[null]"
+ person_id="[null]"
text_value="[null]" tendency="[null]" measure_date="[null]" alert_status="[null]"
description="[null]"/>
@@ -42,7 +42,7 @@
variation_value_4="[null]"
variation_value_5="[null]" rule_priority="[null]" alert_text="[null]" VALUE="10.0"
rules_category_id="[null]"
- committer="[null]"
+ person_id="[null]"
text_value="[null]" tendency="[null]" measure_date="[null]" alert_status="[null]"
description="[null]"/>-->
@@ -52,7 +52,7 @@
variation_value_4="[null]"
variation_value_5="[null]" rule_priority="[null]" alert_text="[null]" value="10.0"
rules_category_id="[null]"
- committer="[null]"
+ person_id="[null]"
text_value="[null]" tendency="[null]" measure_date="[null]" alert_status="[null]"
description="[null]"/>
@@ -62,7 +62,7 @@
variation_value_4="[null]"
variation_value_5="[null]" rule_priority="[null]" alert_text="[null]" VALUE="10.0"
rules_category_id="[null]"
- committer="[null]"
+ person_id="[null]"
text_value="[null]" tendency="[null]" measure_date="[null]" alert_status="[null]"
description="[null]"/>-->
@@ -72,7 +72,7 @@
variation_value_4="[null]"
variation_value_5="[null]" rule_priority="[null]" alert_text="[null]" VALUE="10.0"
rules_category_id="[null]"
- committer="[null]"
+ person_id="[null]"
text_value="[null]" tendency="[null]" measure_date="[null]" alert_status="[null]"
description="[null]"/>-->
</dataset>
diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot.xml
index ca84cdee1af..b9fddbbc0c9 100644
--- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot.xml
@@ -32,7 +32,7 @@
variation_value_4="[null]"
variation_value_5="[null]" rule_priority="[null]" alert_text="[null]" value="10.0"
rules_category_id="[null]"
- committer="[null]"
+ person_id="[null]"
text_value="[null]" tendency="[null]" measure_date="[null]" alert_status="[null]"
description="[null]"/>
@@ -42,7 +42,7 @@
variation_value_4="[null]"
variation_value_5="[null]" rule_priority="[null]" alert_text="[null]" value="10.0"
rules_category_id="[null]"
- committer="[null]"
+ person_id="[null]"
text_value="[null]" tendency="[null]" measure_date="[null]" alert_status="[null]"
description="[null]"/>
@@ -52,7 +52,7 @@
variation_value_4="[null]"
variation_value_5="[null]" rule_priority="[null]" alert_text="[null]" value="10.0"
rules_category_id="[null]"
- committer="[null]"
+ person_id="[null]"
text_value="[null]" tendency="[null]" measure_date="[null]" alert_status="[null]"
description="[null]"/>
@@ -62,7 +62,7 @@
variation_value_4="[null]"
variation_value_5="[null]" rule_priority="[null]" alert_text="[null]" value="10.0"
rules_category_id="[null]"
- committer="[null]"
+ person_id="[null]"
text_value="[null]" tendency="[null]" measure_date="[null]" alert_status="[null]"
description="[null]"/>
@@ -72,7 +72,7 @@
variation_value_4="[null]"
variation_value_5="[null]" rule_priority="[null]" alert_text="[null]" value="10.0"
rules_category_id="[null]"
- committer="[null]"
+ person_id="[null]"
text_value="[null]" tendency="[null]" measure_date="[null]" alert_status="[null]"
description="[null]"/>
</dataset>
diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldPurgeSnapshot-result.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldPurgeSnapshot-result.xml
index c3a2cd2aeff..b8af6c0b035 100644
--- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldPurgeSnapshot-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldPurgeSnapshot-result.xml
@@ -24,12 +24,12 @@ Note that measures, events and reviews are not deleted.
<!--switched_off="[null]" permanent_id="[null]" RULE_ID="1" FAILURE_LEVEL="2"-->
<!--MESSAGE="msg1" LINE="[null]" COST="[null]"-->
<!--created_at="2008-12-02 13:58:00.00"-->
- <!--checksum="[null]" committer="[null]"/>-->
+ <!--checksum="[null]" person_id="[null]"/>-->
<project_measures ID="1" project_id="1" SNAPSHOT_ID="1" RULE_ID="[null]" characteristic_id="[null]"
url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]"
variation_value_5="[null]" rule_priority="[null]" alert_text="[null]" VALUE="10.0" METRIC_ID="1" rules_category_id="[null]"
- committer="[null]"
+ person_id="[null]"
text_value="[null]" tendency="[null]" measure_date="[null]" alert_status="[null]" description="[null]"/>
<measure_data id="1" measure_id="1" snapshot_id="1" data="[null]"/>
@@ -70,12 +70,12 @@ Note that measures, events and reviews are not deleted.
switched_off="[null]" permanent_id="[null]" RULE_ID="1" FAILURE_LEVEL="2"
MESSAGE="msg1" LINE="[null]" COST="[null]"
created_at="2008-12-02 13:58:00.00"
- checksum="[null]" committer="[null]"/>
+ checksum="[null]" person_id="[null]"/>
<project_measures ID="2" project_id="2" SNAPSHOT_ID="2" RULE_ID="[null]" characteristic_id="[null]"
url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]"
variation_value_5="[null]" rule_priority="[null]" alert_text="[null]" VALUE="10.0" METRIC_ID="1" rules_category_id="[null]"
- committer="[null]"
+ person_id="[null]"
text_value="[null]" tendency="[null]" measure_date="[null]" alert_status="[null]" description="[null]"/>
<measure_data id="2" measure_id="2" snapshot_id="2" data="[null]"/>
diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldPurgeSnapshot.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldPurgeSnapshot.xml
index e0132f542ed..ef7489378b9 100644
--- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldPurgeSnapshot.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldPurgeSnapshot.xml
@@ -16,12 +16,12 @@
switched_off="[null]" permanent_id="[null]" RULE_ID="1" FAILURE_LEVEL="2"
MESSAGE="msg1" LINE="[null]" COST="[null]"
created_at="2008-12-02 13:58:00.00"
- checksum="[null]" committer="[null]"/>
+ checksum="[null]" person_id="[null]"/>
<project_measures ID="1" project_id="1" SNAPSHOT_ID="1" RULE_ID="[null]" characteristic_id="[null]"
url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]"
variation_value_5="[null]" rule_priority="[null]" alert_text="[null]" VALUE="10.0" METRIC_ID="1" rules_category_id="[null]"
- committer="[null]"
+ person_id="[null]"
text_value="[null]" tendency="[null]" measure_date="[null]" alert_status="[null]" description="[null]"/>
<measure_data id="1" measure_id="1" snapshot_id="1" data="[null]"/>
@@ -63,12 +63,12 @@
switched_off="[null]" permanent_id="[null]" RULE_ID="1" FAILURE_LEVEL="2"
MESSAGE="msg1" LINE="[null]" COST="[null]"
created_at="2008-12-02 13:58:00.00"
- checksum="[null]" committer="[null]"/>
+ checksum="[null]" person_id="[null]"/>
<project_measures ID="2" project_id="2" SNAPSHOT_ID="2" RULE_ID="[null]" characteristic_id="[null]"
url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]"
variation_value_5="[null]" rule_priority="[null]" alert_text="[null]" VALUE="10.0" METRIC_ID="1" rules_category_id="[null]"
- committer="[null]"
+ person_id="[null]"
text_value="[null]" tendency="[null]" measure_date="[null]" alert_status="[null]" description="[null]"/>
<measure_data id="2" measure_id="2" snapshot_id="2" data="[null]"/>
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/database/model/MeasureModel.java b/sonar-plugin-api/src/main/java/org/sonar/api/database/model/MeasureModel.java
index f63e730af76..d30464595b2 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/database/model/MeasureModel.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/database/model/MeasureModel.java
@@ -116,8 +116,8 @@ public class MeasureModel implements Cloneable {
@JoinColumn(name = "characteristic_id")
private Characteristic characteristic;
- @Column(name = "committer", updatable = true, nullable = true, length = 100)
- private String committer;
+ @Column(name = "person_id", updatable = true, nullable = true)
+ private Integer personId;
public Long getId() {
return id;
@@ -522,12 +522,12 @@ public class MeasureModel implements Cloneable {
return this;
}
- public String getCommitter() {
- return committer;
+ public Integer getPersonId() {
+ return personId;
}
- public MeasureModel setCommitter(String committer) {
- this.committer = committer;
+ public MeasureModel setPersonId(Integer i) {
+ this.personId = i;
return this;
}
@@ -552,7 +552,7 @@ public class MeasureModel implements Cloneable {
clone.setMeasureDate(getMeasureDate());
clone.setUrl(getUrl());
clone.setCharacteristic(getCharacteristic());
- clone.setCommitter(getCommitter());
+ clone.setPersonId(getPersonId());
return clone;
}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/database/model/RuleFailureModel.java b/sonar-plugin-api/src/main/java/org/sonar/api/database/model/RuleFailureModel.java
index a59c76b1b4c..467abf96283 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/database/model/RuleFailureModel.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/database/model/RuleFailureModel.java
@@ -67,8 +67,8 @@ public class RuleFailureModel extends BaseIdentifiable {
@Column(name = "switched_off", updatable = true, nullable = true)
private Boolean switchedOff = Boolean.FALSE;
- @Column(name = "committer", updatable = true, nullable = true, length = 100)
- private String committer;
+ @Column(name = "person_id", updatable = true, nullable = true)
+ private Integer personId;
public String getMessage() {
return message;
@@ -173,12 +173,12 @@ public class RuleFailureModel extends BaseIdentifiable {
return this;
}
- public String getCommitter() {
- return committer;
+ public Integer getPersonId() {
+ return personId;
}
- public RuleFailureModel setCommitter(String committer) {
- this.committer = committer;
+ public RuleFailureModel setPersonId(Integer i) {
+ this.personId = i;
return this;
}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/measures/Measure.java b/sonar-plugin-api/src/main/java/org/sonar/api/measures/Measure.java
index f5017c7b625..ca3a6f4ffe0 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/measures/Measure.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/measures/Measure.java
@@ -53,7 +53,7 @@ public class Measure {
protected Double variation1, variation2, variation3, variation4, variation5;
protected String url;
protected Characteristic characteristic;
- protected String committer;
+ protected Integer personId;
protected PersistenceMode persistenceMode = PersistenceMode.FULL;
public Measure(String metricKey) {
@@ -596,16 +596,16 @@ public class Measure {
* @since 2.14
*/
@Beta
- public String getCommitter() {
- return committer;
+ public Integer getPersonId() {
+ return personId;
}
/**
* @since 2.14
*/
@Beta
- public Measure setCommitter(String committer) {
- this.committer = committer;
+ public Measure setPersonId(Integer i) {
+ this.personId = i;
return this;
}
@@ -625,7 +625,7 @@ public class Measure {
if (characteristic != null ? !characteristic.equals(measure.characteristic) : measure.characteristic != null) {
return false;
}
- if (committer != null ? !committer.equals(measure.committer) : measure.committer != null) {
+ if (personId != null ? !personId.equals(measure.personId) : measure.personId != null) {
return false;
}
return true;
@@ -635,7 +635,7 @@ public class Measure {
public int hashCode() {
int result = metricKey != null ? metricKey.hashCode() : 0;
result = 31 * result + (characteristic != null ? characteristic.hashCode() : 0);
- result = 31 * result + (committer != null ? committer.hashCode() : 0);
+ result = 31 * result + (personId != null ? personId.hashCode() : 0);
return result;
}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/measures/MeasuresFilters.java b/sonar-plugin-api/src/main/java/org/sonar/api/measures/MeasuresFilters.java
index bf4e1964f15..0eb8c454d42 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/measures/MeasuresFilters.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/measures/MeasuresFilters.java
@@ -58,7 +58,7 @@ public final class MeasuresFilters {
if (measure.getClass().equals(Measure.class) &&
measure.getMetricKey().equals(metricKey) &&
measure.getCharacteristic() == null &&
- measure.getCommitter() == null) {
+ measure.getPersonId() == null) {
return measure;
}
}
@@ -77,6 +77,7 @@ public final class MeasuresFilters {
for (Measure measure : measures) {
if (measure.getClass().equals(Measure.class) &&
measure.getMetric().equals(metric) &&
+ measure.getPersonId() == null &&
measure.getCharacteristic() != null &&
measure.getCharacteristic().equals(characteristic)) {
return measure;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/measures/RuleMeasure.java b/sonar-plugin-api/src/main/java/org/sonar/api/measures/RuleMeasure.java
index 409fc34b730..d155b8fe42d 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/measures/RuleMeasure.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/measures/RuleMeasure.java
@@ -113,7 +113,7 @@ public class RuleMeasure extends Measure {
RuleMeasure other = (RuleMeasure) obj;
return new EqualsBuilder()
.append(getMetric(), other.getMetric())
- .append(committer, other.committer)
+ .append(personId, other.personId)
.append(rule, other.rule)
.isEquals();
}
@@ -127,7 +127,7 @@ public class RuleMeasure extends Measure {
public int hashCode() {
return new HashCodeBuilder(17, 37)
.append(getMetric())
- .append(committer)
+ .append(personId)
.append(rule)
.toHashCode();
}
@@ -137,7 +137,7 @@ public class RuleMeasure extends Measure {
return new ToStringBuilder(this)
.append("id", getId())
.append("metric", metric)
- .append("committer", committer)
+ .append("personId", personId)
.append("rule", rule)
.append("value", value)
.append("data", data)
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/rules/Violation.java b/sonar-plugin-api/src/main/java/org/sonar/api/rules/Violation.java
index 0b139cc94fc..b4c7765e67d 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/rules/Violation.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/rules/Violation.java
@@ -42,7 +42,7 @@ public class Violation {
private boolean isNew = false;
private boolean isManual = false;
private Integer permanentId;
- private String committer;
+ private Integer personId;
/**
* Creates of a violation from a rule. Will need to define the resource later on
@@ -319,8 +319,8 @@ public class Violation {
/**
* @since 2.13
*/
- public String getCommitter() {
- return committer;
+ public Integer getPersonId() {
+ return personId;
}
/**
@@ -328,8 +328,8 @@ public class Violation {
*
* @since 2.13
*/
- public Violation setCommitter(String committer) {
- this.committer = committer;
+ public Violation setPersonId(Integer i) {
+ this.personId = i;
return this;
}
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/measures/MeasureTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/measures/MeasureTest.java
index 60d1276e4cd..6f4d8f89a12 100644
--- a/sonar-plugin-api/src/test/java/org/sonar/api/measures/MeasureTest.java
+++ b/sonar-plugin-api/src/test/java/org/sonar/api/measures/MeasureTest.java
@@ -129,18 +129,18 @@ public class MeasureTest {
assertThat(measure1.hashCode(), equalTo(measure2.hashCode()));
// different committer
- measure1.setCommitter("simon");
+ measure1.setPersonId(1);
assertThat(measure1.equals(measure2), is(false));
assertThat(measure2.equals(measure1), is(false));
assertThat(measure1.hashCode(), not(equalTo(measure2.hashCode())));
- measure2.setCommitter("evgeny");
+ measure2.setPersonId(2);
assertThat(measure1.equals(measure2), is(false));
assertThat(measure2.equals(measure1), is(false));
assertThat(measure1.hashCode(), not(equalTo(measure2.hashCode())));
// same committer
- measure2.setCommitter("simon");
+ measure2.setPersonId(1);
assertThat(measure1.equals(measure2), is(true));
assertThat(measure2.equals(measure1), is(true));
assertThat(measure1.hashCode(), equalTo(measure2.hashCode()));
diff --git a/sonar-server/src/main/java/org/sonar/server/filters/FilterExecutor.java b/sonar-server/src/main/java/org/sonar/server/filters/FilterExecutor.java
index 6dba0c4fa01..11c44f424e6 100644
--- a/sonar-server/src/main/java/org/sonar/server/filters/FilterExecutor.java
+++ b/sonar-server/src/main/java/org/sonar/server/filters/FilterExecutor.java
@@ -149,7 +149,7 @@ public class FilterExecutor implements ServerComponent {
}
sql.append(" pm.rule_id IS NULL AND pm.rule_priority IS NULL");
sql.append(" AND pm.characteristic_id IS NULL");
- sql.append(" AND pm.committer IS NULL");
+ sql.append(" AND pm.person_id IS NULL");
sql.append(" AND ");
}
sql.append(" s.status=:status AND s.islast=:islast ");
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/resources_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/resources_controller.rb
index 5bd4492f3e3..c250dd6cc94 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/resources_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/resources_controller.rb
@@ -97,7 +97,7 @@ class Api::ResourcesController < Api::ApiController
end
end
- measures_conditions << 'project_measures.committer IS NULL'
+ measures_conditions << 'project_measures.person_id IS NULL'
add_rule_filters(measures_conditions, measures_values)
add_characteristic_filters(measures_conditions, measures_values)
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/timemachine_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/timemachine_controller.rb
index 15eaea9188c..09ea92f6d6c 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/timemachine_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/timemachine_controller.rb
@@ -73,7 +73,7 @@ class Api::TimemachineController < Api::ApiController
@measures_by_sid={}
unless @metrics.empty?
- sql_conditions = ['snapshots.project_id=:rid AND snapshots.status=:status AND project_measures.rules_category_id IS NULL AND project_measures.rule_id IS NULL AND project_measures.rule_priority IS NULL AND project_measures.committer IS NULL']
+ sql_conditions = ['snapshots.project_id=:rid AND snapshots.status=:status AND project_measures.rules_category_id IS NULL AND project_measures.rule_id IS NULL AND project_measures.rule_priority IS NULL AND project_measures.person_id IS NULL']
sql_values = {:rid => @resource.id, :status => Snapshot::STATUS_PROCESSED}
if params[:fromDateTime]
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/components_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/components_controller.rb
index 30d5cab8b47..92c1b0bb427 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/components_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/components_controller.rb
@@ -99,7 +99,7 @@ class ComponentsController < ApplicationController
'rule_id' => nil,
'rule_priority' => nil,
'characteristic_id' => nil,
- 'committer' => nil}))
+ 'person_id' => nil}))
end
measures
else
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/timemachine_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/timemachine_controller.rb
index afe14e3e89a..0fa2ae57dad 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/timemachine_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/timemachine_controller.rb
@@ -53,7 +53,7 @@ class TimemachineController < ApplicationController
snapshot_by_id[s.id]=s
end
- measures=ProjectMeasure.find(:all, :conditions => {:rule_id => nil, :rule_priority => nil, :snapshot_id => @sids, :characteristic_id => nil, :committer => nil})
+ measures=ProjectMeasure.find(:all, :conditions => {:rule_id => nil, :rule_priority => nil, :snapshot_id => @sids, :characteristic_id => nil, :person_id => nil})
rows_by_metric_id={}
@rows=[]
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/components_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/components_helper.rb
index f40ff1a93b8..0e9a8f5e5b0 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/components_helper.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/components_helper.rb
@@ -67,7 +67,7 @@ module ComponentsHelper
return nil if items.nil?
items.each do |item|
metric = Metric.by_name(metric_name)
- return item if (item && metric && item.metric_id==metric.id && item.rule_priority.nil? && item.characteristic_id.nil? && item.committer.nil?)
+ return item if (item && metric && item.metric_id==metric.id && item.rule_priority.nil? && item.characteristic_id.nil? && item.person_id.nil?)
end
nil
end
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/drilldown.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/drilldown.rb
index 55bebdb4a2c..e9c14fce882 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/models/drilldown.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/models/drilldown.rb
@@ -92,10 +92,10 @@ class DrilldownColumn
end
if options[:committer]
- conditions += ' AND project_measures.committer=:committer'
+ conditions += ' AND project_measures.person_id=:committer'
condition_values[:committer]=options[:committer]
else
- conditions += ' AND project_measures.committer IS NULL'
+ conditions += ' AND project_measures.person_id IS NULL'
end
@measures=ProjectMeasure.find(:all,
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/filter_context.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/filter_context.rb
index b272ec46372..bc7b8524922 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/models/filter_context.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/models/filter_context.rb
@@ -55,7 +55,7 @@
# load measures
#
if @metric_ids.size>0
- measures=ProjectMeasure.find(:all, :conditions => ['rule_priority is null and rule_id is null and characteristic_id is null and committer is null and snapshot_id in (?)', @page_sids])
+ measures=ProjectMeasure.find(:all, :conditions => ['rule_priority is null and rule_id is null and characteristic_id is null and person_id is null and snapshot_id in (?)', @page_sids])
measures.each do |m|
snapshot=@snapshots_by_id[m.snapshot_id]
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/project.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/project.rb
index 3b75256abfd..14c9c288ec4 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/models/project.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/models/project.rb
@@ -100,7 +100,7 @@ class Project < ActiveRecord::Base
" s.status='%s' and " +
' s.project_id=%s and m.metric_id=%s ', Snapshot::STATUS_PROCESSED, self.id, metric_id]) +
' and m.rule_id IS NULL and m.rule_priority IS NULL' +
- ' and m.committer IS NULL' +
+ ' and m.person_id IS NULL' +
' order by s.created_at'
create_chart_measures(Project.connection.select_all(sql), 'created_at', 'value')
end
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/snapshot.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/snapshot.rb
index 872efacc480..9742751a355 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/models/snapshot.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/models/snapshot.rb
@@ -27,10 +27,10 @@ class Snapshot < ActiveRecord::Base
belongs_to :root_snapshot, :class_name => 'Snapshot', :foreign_key => 'root_snapshot_id'
belongs_to :characteristic
- has_many :measures, :class_name => 'ProjectMeasure', :conditions => 'rule_id IS NULL AND characteristic_id IS NULL AND committer IS NULL'
- has_many :rulemeasures, :class_name => 'ProjectMeasure', :conditions => 'rule_id IS NOT NULL AND characteristic_id IS NULL AND committer IS NULL', :include => 'rule'
- has_many :characteristic_measures, :class_name => 'ProjectMeasure', :conditions => 'rule_id IS NULL AND characteristic_id IS NOT NULL AND committer IS NULL'
- has_many :committer_measures, :class_name => 'ProjectMeasure', :conditions => 'rule_id IS NULL AND characteristic_id IS NULL AND committer IS NOT NULL'
+ has_many :measures, :class_name => 'ProjectMeasure', :conditions => 'rule_id IS NULL AND characteristic_id IS NULL AND person_id IS NULL'
+ has_many :rulemeasures, :class_name => 'ProjectMeasure', :conditions => 'rule_id IS NOT NULL AND characteristic_id IS NULL AND person_id IS NULL', :include => 'rule'
+ has_many :characteristic_measures, :class_name => 'ProjectMeasure', :conditions => 'rule_id IS NULL AND characteristic_id IS NOT NULL AND person_id IS NULL'
+ has_many :person_measures, :class_name => 'ProjectMeasure', :conditions => 'rule_id IS NULL AND characteristic_id IS NULL AND person_id IS NOT NULL'
has_many :events, :dependent => :destroy, :order => 'event_date DESC'
has_one :source, :class_name => 'SnapshotSource', :dependent => :destroy
@@ -164,9 +164,9 @@ class Snapshot < ActiveRecord::Base
metric ? measures_hash[metric.id] : nil
end
- def committer_measure(metric, committer)
- committer_measures.each do |m|
- return m if m.metric_id==metric.id && m.committer==committer
+ def person_measure(metric, person_id)
+ person_measures.each do |m|
+ return m if m.metric_id==metric.id && m.person_id==person_id
end
nil
end
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/trends_chart.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/trends_chart.rb
index 2893d2bc46e..0780d64a390 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/models/trends_chart.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/models/trends_chart.rb
@@ -47,7 +47,7 @@ class TrendsChart
" and s.status=? " +
" and s.project_id=? " +
" and m.metric_id in (?) " +
- " and m.rule_priority is null and m.characteristic_id is null and m.committer is null"
+ " and m.rule_priority is null and m.characteristic_id is null and m.person_id is null"
if (options[:from])
sql += ' and s.created_at>=?'
end
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/256_add_measures_committer.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/256_add_measures_person.rb
index c15f450e7b4..88df6ccc464 100644
--- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/256_add_measures_committer.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/256_add_measures_person.rb
@@ -21,10 +21,10 @@
#
# Sonar 2.14
#
-class AddMeasuresCommitter < ActiveRecord::Migration
+class AddMeasuresPerson < ActiveRecord::Migration
def self.up
- add_column 'project_measures', 'committer', :string, :null => true, :limit => 100
+ add_column 'project_measures', 'person_id', :integer, :null => true
end
end
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/263_replace_rule_failures_committer_by_person.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/263_replace_rule_failures_committer_by_person.rb
new file mode 100644
index 00000000000..f14d99d4ac5
--- /dev/null
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/263_replace_rule_failures_committer_by_person.rb
@@ -0,0 +1,31 @@
+#
+# Sonar, entreprise quality control tool.
+# Copyright (C) 2008-2012 SonarSource
+# mailto:contact AT sonarsource DOT com
+#
+# Sonar 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.
+#
+# Sonar 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 Sonar; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
+#
+
+#
+# Sonar 2.14
+#
+class ReplaceRuleFailuresCommitterByPerson < ActiveRecord::Migration
+
+ def self.up
+ remove_column 'rule_failures', 'committer'
+ add_column 'rule_failures', 'person_id', :integer, :null => true
+ end
+
+end