aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2021-04-01 15:57:52 -0500
committersonartech <sonartech@sonarsource.com>2021-04-08 20:03:55 +0000
commit8d1f3d7bd9b1b52eeed1bb0413ea307a3e6934ee (patch)
treefca1ceb8e30616329452807b58dec3d9ef83da57 /sonar-core
parent0fe9175b3a6e5960f33843a06725f48eaf36193a (diff)
downloadsonarqube-8d1f3d7bd9b1b52eeed1bb0413ea307a3e6934ee.tar.gz
sonarqube-8d1f3d7bd9b1b52eeed1bb0413ea307a3e6934ee.zip
SONAR-10485 Provide a way to always enforce coverage and duplication Quality Gate conditions
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/config/CorePropertyDefinitions.java11
-rw-r--r--sonar-core/src/main/resources/org/sonar/l10n/core.properties3
-rw-r--r--sonar-core/src/test/java/org/sonar/core/config/CorePropertyDefinitionsTest.java2
3 files changed, 14 insertions, 2 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/config/CorePropertyDefinitions.java b/sonar-core/src/main/java/org/sonar/core/config/CorePropertyDefinitions.java
index 8fb44a8b270..77e216a3fd0 100644
--- a/sonar-core/src/main/java/org/sonar/core/config/CorePropertyDefinitions.java
+++ b/sonar-core/src/main/java/org/sonar/core/config/CorePropertyDefinitions.java
@@ -159,6 +159,17 @@ public class CorePropertyDefinitions {
.type(PropertyType.USER_LOGIN)
.build(),
+ // QUALITY GATE
+ PropertyDefinition.builder(CoreProperties.QUALITY_GATE_IGNORE_SMALL_CHANGES)
+ .name("Ignore duplication and coverage on small changes")
+ .description("Quality Gate conditions about duplications in new code and coverage on new code are ignored until the number of new lines is at least 20.")
+ .category(CoreProperties.CATEGORY_GENERAL)
+ .subCategory(CoreProperties.SUBCATEGORY_QUALITY_GATE)
+ .onQualifiers(Qualifiers.PROJECT)
+ .type(BOOLEAN)
+ .defaultValue(Boolean.toString(true))
+ .build(),
+
// CPD
PropertyDefinition.builder(CoreProperties.CPD_CROSS_PROJECT)
.defaultValue(Boolean.toString(false))
diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties
index 26ae1fdc0af..82d61c9092f 100644
--- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties
+++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties
@@ -1195,6 +1195,7 @@ property.category.general.localization=Localization
property.category.general.databaseCleaner=Database Cleaner
property.category.general.looknfeel=Look & Feel
property.category.general.issues=Issues
+property.category.general.qualityGate=Quality Gate
property.category.general.subProjects=Sub-projects
property.category.almintegration=ALM Integrations
property.category.almintegration.github=GitHub Authentication
@@ -2891,7 +2892,7 @@ overview.quality_gate_code_clean=Your code is clean!
overview.quality_gate_all_conditions_passed=All conditions passed.
overview.you_should_define_quality_gate=You should define a quality gate on this project.
overview.quality_gate.ignored_conditions=Some Quality Gate conditions on New Code were ignored because of the small number of New Lines
-overview.quality_gate.ignored_conditions.tooltip=At the start of a new code period, if very few lines have been added or modified, it might be difficult to reach the desired level of code coverage or duplications. To prevent Quality Gate failure when there's little that can be done about it, Quality Gate conditions about duplications in new code and coverage on new code are ignored until the number of new lines is at least 20.
+overview.quality_gate.ignored_conditions.tooltip=At the start of a new code period, if very few lines have been added or modified, it might be difficult to reach the desired level of code coverage or duplications. To prevent Quality Gate failure when there's little that can be done about it, Quality Gate conditions about duplications in new code and coverage on new code are ignored until the number of new lines is at least 20. An administrator can disable this in the general settings.
overview.quality_gate.conditions_on_new_code=Only conditions on new code that are defined in the Quality Gate are checked. See the {link} associated to the project for details.
overview.quality_profiles=Quality Profiles used
overview.new_code_period_x=New Code: {0}
diff --git a/sonar-core/src/test/java/org/sonar/core/config/CorePropertyDefinitionsTest.java b/sonar-core/src/test/java/org/sonar/core/config/CorePropertyDefinitionsTest.java
index b8eaf30a2bc..0079520e18f 100644
--- a/sonar-core/src/test/java/org/sonar/core/config/CorePropertyDefinitionsTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/config/CorePropertyDefinitionsTest.java
@@ -30,7 +30,7 @@ public class CorePropertyDefinitionsTest {
@Test
public void all() {
List<PropertyDefinition> defs = CorePropertyDefinitions.all();
- assertThat(defs).hasSize(55);
+ assertThat(defs).hasSize(56);
}
@Test