aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2011-06-15 10:55:55 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2011-06-15 10:56:24 +0200
commit1063d63ad0fef20b898376d4465e4c88cc061c1b (patch)
treee02735640b26715c8aae7396e3cf3e0cba3e93e4 /plugins
parenteb3c0dc7dec66ad446e41a8291836af352bbc819 (diff)
downloadsonarqube-1063d63ad0fef20b898376d4465e4c88cc061c1b.tar.gz
sonarqube-1063d63ad0fef20b898376d4465e4c88cc061c1b.zip
SONAR-2505 core components which write to database are disabled on dry runs
Diffstat (limited to 'plugins')
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/AsynchronousMeasuresSensor.java2
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/CloseReviewsDecorator.java2
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/VersionEventsSensor.java2
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/NewCoverageFileAnalyzer.java2
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/NewViolationsDecorator.java2
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/TendencyDecorator.java2
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/TimeMachineConfigurationPersister.java2
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/VariationDecorator.java2
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/ViolationPersisterDecorator.java2
-rw-r--r--plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/runner/PurgeRunner.java2
10 files changed, 20 insertions, 0 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/AsynchronousMeasuresSensor.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/AsynchronousMeasuresSensor.java
index e3f1a8c8726..3a23449aec9 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/AsynchronousMeasuresSensor.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/AsynchronousMeasuresSensor.java
@@ -22,11 +22,13 @@ package org.sonar.plugins.core.sensors;
import org.sonar.api.batch.Phase;
import org.sonar.api.batch.Sensor;
import org.sonar.api.batch.SensorContext;
+import org.sonar.core.NotDryRun;
import org.sonar.jpa.dao.AsyncMeasuresService;
import org.sonar.api.database.model.Snapshot;
import org.sonar.api.resources.Project;
import org.sonar.api.resources.ResourceUtils;
+@NotDryRun
@Phase(name = Phase.Name.PRE)
public class AsynchronousMeasuresSensor implements Sensor {
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/CloseReviewsDecorator.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/CloseReviewsDecorator.java
index 49ee853d902..f0fe71402de 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/CloseReviewsDecorator.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/CloseReviewsDecorator.java
@@ -33,10 +33,12 @@ import org.sonar.api.resources.Project;
import org.sonar.api.resources.Resource;
import org.sonar.api.resources.ResourceUtils;
import org.sonar.batch.index.ResourcePersister;
+import org.sonar.core.NotDryRun;
/**
* Decorator that currently only closes a review when its corresponding violation has been fixed.
*/
+@NotDryRun
@DependsUpon(DecoratorBarriers.END_OF_VIOLATION_TRACKING)
public class CloseReviewsDecorator implements Decorator {
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/VersionEventsSensor.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/VersionEventsSensor.java
index 555d53e80b2..21f9489dbce 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/VersionEventsSensor.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/VersionEventsSensor.java
@@ -25,9 +25,11 @@ import org.sonar.api.batch.Event;
import org.sonar.api.batch.Sensor;
import org.sonar.api.batch.SensorContext;
import org.sonar.api.resources.Project;
+import org.sonar.core.NotDryRun;
import java.util.Iterator;
+@NotDryRun
public class VersionEventsSensor implements Sensor {
private static final String SNAPSHOT_SUFFIX = "-SNAPSHOT";
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/NewCoverageFileAnalyzer.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/NewCoverageFileAnalyzer.java
index 78a988d6d16..5686c6d4ecc 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/NewCoverageFileAnalyzer.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/NewCoverageFileAnalyzer.java
@@ -33,6 +33,7 @@ import org.sonar.api.resources.Scopes;
import org.sonar.api.utils.KeyValueFormat;
import org.sonar.batch.components.PastSnapshot;
import org.sonar.batch.components.TimeMachineConfiguration;
+import org.sonar.core.NotDryRun;
import java.util.Arrays;
import java.util.Date;
@@ -42,6 +43,7 @@ import java.util.Map;
/**
* @since 2.7
*/
+@NotDryRun
@DependedUpon(DecoratorBarriers.END_OF_TIME_MACHINE)
public final class NewCoverageFileAnalyzer implements Decorator {
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/NewViolationsDecorator.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/NewViolationsDecorator.java
index 5df64a2b139..358c3394edc 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/NewViolationsDecorator.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/NewViolationsDecorator.java
@@ -32,9 +32,11 @@ import org.sonar.api.rules.RulePriority;
import org.sonar.api.rules.Violation;
import org.sonar.batch.components.PastSnapshot;
import org.sonar.batch.components.TimeMachineConfiguration;
+import org.sonar.core.NotDryRun;
import java.util.*;
+@NotDryRun
@DependsUpon(DecoratorBarriers.END_OF_VIOLATION_TRACKING)
public class NewViolationsDecorator implements Decorator {
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/TendencyDecorator.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/TendencyDecorator.java
index 0758fdeb57d..ade65afb788 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/TendencyDecorator.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/TendencyDecorator.java
@@ -32,9 +32,11 @@ import org.sonar.api.resources.Project;
import org.sonar.api.resources.Resource;
import org.sonar.api.resources.Scopes;
import org.sonar.batch.components.TimeMachineConfiguration;
+import org.sonar.core.NotDryRun;
import java.util.List;
+@NotDryRun
@DependedUpon(DecoratorBarriers.END_OF_TIME_MACHINE)
public class TendencyDecorator implements Decorator {
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/TimeMachineConfigurationPersister.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/TimeMachineConfigurationPersister.java
index 092f59bed7a..889a9010d78 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/TimeMachineConfigurationPersister.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/TimeMachineConfigurationPersister.java
@@ -28,9 +28,11 @@ import org.sonar.api.resources.Resource;
import org.sonar.api.resources.ResourceUtils;
import org.sonar.batch.components.PastSnapshot;
import org.sonar.batch.components.TimeMachineConfiguration;
+import org.sonar.core.NotDryRun;
import java.util.List;
+@NotDryRun
public final class TimeMachineConfigurationPersister implements Decorator {
private TimeMachineConfiguration configuration;
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 9a5eac592ad..1fe3ec56cc1 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
@@ -30,11 +30,13 @@ import org.sonar.api.resources.Scopes;
import org.sonar.batch.components.PastMeasuresLoader;
import org.sonar.batch.components.PastSnapshot;
import org.sonar.batch.components.TimeMachineConfiguration;
+import org.sonar.core.NotDryRun;
import java.util.Collection;
import java.util.List;
import java.util.Map;
+@NotDryRun
@DependedUpon(DecoratorBarriers.END_OF_TIME_MACHINE)
public class VariationDecorator implements Decorator {
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 0126aad1045..b14e7649670 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
@@ -44,7 +44,9 @@ import org.sonar.batch.index.ViolationPersister;
import com.google.common.collect.LinkedHashMultimap;
import com.google.common.collect.Lists;
import com.google.common.collect.Multimap;
+import org.sonar.core.NotDryRun;
+@NotDryRun
@DependsUpon({ DecoratorBarriers.END_OF_VIOLATIONS_GENERATION, DecoratorBarriers.START_VIOLATION_TRACKING })
@DependedUpon(DecoratorBarriers.END_OF_VIOLATION_TRACKING)
public class ViolationPersisterDecorator implements Decorator {
diff --git a/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/runner/PurgeRunner.java b/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/runner/PurgeRunner.java
index 3cfb209410d..12542a55a22 100644
--- a/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/runner/PurgeRunner.java
+++ b/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/runner/PurgeRunner.java
@@ -27,10 +27,12 @@ import org.sonar.api.database.DatabaseSession;
import org.sonar.api.database.model.Snapshot;
import org.sonar.api.resources.Project;
import org.sonar.api.utils.TimeProfiler;
+import org.sonar.core.NotDryRun;
import org.sonar.plugins.dbcleaner.api.Purge;
import javax.persistence.Query;
+@NotDryRun
public final class PurgeRunner implements PostJob {
private DatabaseSession session;