Browse Source

SONAR-11524 textfield for deprecated module-lvl properties

Add a project-level textfield property in UI that aggregates all previous module-level properties.
tags/7.6
Michal Duda 5 years ago
parent
commit
be6d8e2b07

+ 1
- 1
server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java View File

@@ -123,7 +123,7 @@ public class ComputeEngineContainerImplTest {
+ 26 // level 1
+ 60 // content of DaoModule
+ 3 // content of EsModule
+ 54 // content of CorePropertyDefinitions
+ 55 // content of CorePropertyDefinitions
+ 1 // StopFlagContainer
);
assertThat(

+ 1
- 1
server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v76/MigrateModuleProperties.java View File

@@ -31,7 +31,7 @@ import org.sonar.server.platform.db.migration.step.Upsert;
@SupportsBlueGreen
public class MigrateModuleProperties extends DataChange {

protected static final String NEW_PROPERTY_NAME = "sonar.modules.archivedSettings";
protected static final String NEW_PROPERTY_NAME = "sonar.subproject.settings.archived";

private final System2 system2;


+ 10
- 0
sonar-core/src/main/java/org/sonar/core/config/CorePropertyDefinitions.java View File

@@ -62,6 +62,16 @@ public class CorePropertyDefinitions {
defs.addAll(ScannerProperties.all());

defs.addAll(asList(
PropertyDefinition.builder(CoreProperties.MODULE_LEVEL_ARCHIVED_SETTINGS)
.name("Archived Sub-Projects Settings")
.description("DEPRECATED - Recap of the properties that were previously configured at sub-project / module level. " +
"These properties are not used anymore and should now be configured at project level. " +
"Set this parameter to empty to prevent the analysis from displaying a warning.")
.category(CoreProperties.CATEGORY_GENERAL)
.subCategory(CoreProperties.SUBCATEGORY_MODULES)
.onlyOnQualifiers(Qualifiers.PROJECT)
.type(PropertyType.TEXT)
.build(),
PropertyDefinition.builder(CoreProperties.SERVER_BASE_URL)
.name("Server base URL")
.description("HTTP URL of this SonarQube server, such as <i>http://yourhost.yourdomain/sonar</i>. This value is used i.e. to create links in emails.")

+ 1
- 0
sonar-core/src/main/resources/org/sonar/l10n/core.properties View File

@@ -874,6 +874,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.subProjects=Sub-projects
property.category.organizations=Organizations
property.category.security=Security
property.category.security.encryption=Encryption

+ 1
- 1
sonar-core/src/test/java/org/sonar/core/config/CorePropertyDefinitionsTest.java View File

@@ -30,7 +30,7 @@ public class CorePropertyDefinitionsTest {
@Test
public void all() {
List<PropertyDefinition> defs = CorePropertyDefinitions.all();
assertThat(defs).hasSize(54);
assertThat(defs).hasSize(55);
}

@Test

+ 6
- 1
sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java View File

@@ -44,6 +44,11 @@ public interface CoreProperties {
*/
String SUBCATEGORY_DATABASE_CLEANER = "databaseCleaner";

/**
* @since 7.6
*/
String SUBCATEGORY_MODULES = "subProjects";

/**
* @since 4.0
*/
@@ -530,5 +535,5 @@ public interface CoreProperties {
/**
* @since 7.6
*/
String MODULE_LEVEL_ARCHIVED_SETTINGS = "sonar.modules.archivedSettings";
String MODULE_LEVEL_ARCHIVED_SETTINGS = "sonar.subproject.settings.archived";
}

+ 2
- 2
sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/ProjectServerSettingsProvider.java View File

@@ -33,8 +33,8 @@ public class ProjectServerSettingsProvider extends ProviderAdapter {

private static final Logger LOG = Loggers.get(ProjectConfigurationProvider.class);

private static final String MODULE_LEVEL_ARCHIVED_SETTINGS_WARNING = "Please migrate all the properties listed in " +
"`sonar.module.removedProperties` setting to appriopriate project level setting.";
private static final String MODULE_LEVEL_ARCHIVED_SETTINGS_WARNING = String.format("Please configure the settings listed in " +
"`%s` at project level and remove that setting to prevent the analysis from displaying a warning.", CoreProperties.MODULE_LEVEL_ARCHIVED_SETTINGS);

private ProjectServerSettings singleton = null;


Loading…
Cancel
Save