From: Sébastien Lesaint Date: Thu, 25 Aug 2016 15:34:06 +0000 (+0200) Subject: SONAR-7841 remove property sonar.ce.maxLogsPerTask X-Git-Tag: 6.1-RC1~277 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=df1ae26b7c9377da6b5403c6a03083b0707d8d8c;p=sonarqube.git SONAR-7841 remove property sonar.ce.maxLogsPerTask --- diff --git a/server/sonar-ce/src/main/java/org/sonar/ce/container/ComputeEngineContainerImpl.java b/server/sonar-ce/src/main/java/org/sonar/ce/container/ComputeEngineContainerImpl.java index 73e12ff3671..3bca9c88431 100644 --- a/server/sonar-ce/src/main/java/org/sonar/ce/container/ComputeEngineContainerImpl.java +++ b/server/sonar-ce/src/main/java/org/sonar/ce/container/ComputeEngineContainerImpl.java @@ -46,7 +46,6 @@ import org.sonar.ce.CeTaskCommonsModule; import org.sonar.ce.db.ReadOnlyPropertiesDao; import org.sonar.ce.es.EsIndexerEnabler; import org.sonar.ce.platform.ComputeEngineExtensionInstaller; -import org.sonar.ce.property.CePropertyDefinitions; import org.sonar.ce.settings.ComputeEngineSettings; import org.sonar.ce.user.CeUserSession; import org.sonar.core.component.DefaultResourceTypes; @@ -156,7 +155,6 @@ public class ComputeEngineContainerImpl implements ComputeEngineContainer { .add(props.rawProperties()) .add(level1Components()) .add(toArray(CorePropertyDefinitions.all())) - .add(toArray(CePropertyDefinitions.all())) .add(toArray(ClusterProperties.definitions())); configureFromModules(this.level1); this.level1.startComponents(); diff --git a/server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java b/server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java index ed1a0ceb7c3..d1fa5e075d2 100644 --- a/server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java +++ b/server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java @@ -105,7 +105,7 @@ public class ComputeEngineContainerImplTest { ); assertThat(picoContainer.getParent().getParent().getParent().getComponentAdapters()).hasSize( COMPONENTS_IN_LEVEL_1_AT_CONSTRUCTION - + 26 // level 1 + + 25 // level 1 + 48 // content of DaoModule + 2 // content of EsSearchModule + 54 // content of CorePropertyDefinitions diff --git a/server/sonar-server/src/main/java/org/sonar/ce/log/CeLogging.java b/server/sonar-server/src/main/java/org/sonar/ce/log/CeLogging.java index 79feb74989b..cfab63533d0 100644 --- a/server/sonar-server/src/main/java/org/sonar/ce/log/CeLogging.java +++ b/server/sonar-server/src/main/java/org/sonar/ce/log/CeLogging.java @@ -46,7 +46,6 @@ public class CeLogging { static final String MDC_CE_ACTIVITY_FLAG = "ceActivityFlag"; static final String MDC_CE_TASK_UUID = "ceTaskUuid"; - public static final String MAX_LOGS_PROPERTY = "sonar.ce.maxLogsPerTask"; public void initForTask(CeTask task) { MDC.put(MDC_CE_TASK_UUID, task.getUuid()); diff --git a/server/sonar-server/src/main/java/org/sonar/ce/property/CePropertyDefinitions.java b/server/sonar-server/src/main/java/org/sonar/ce/property/CePropertyDefinitions.java deleted file mode 100644 index 9ad2dc1662e..00000000000 --- a/server/sonar-server/src/main/java/org/sonar/ce/property/CePropertyDefinitions.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program 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. - * - * This program 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. - */ -package org.sonar.ce.property; - -import java.util.List; -import org.sonar.api.CoreProperties; -import org.sonar.api.PropertyType; -import org.sonar.api.config.PropertyDefinition; -import org.sonar.ce.log.CeLogging; - -import static java.util.Arrays.asList; - -public class CePropertyDefinitions { - private CePropertyDefinitions() { - // only statics - } - - public static List all() { - return asList( - PropertyDefinition.builder(CeLogging.MAX_LOGS_PROPERTY) - .name("Compute Engine Log Retention") - .description("Number of tasks to keep logs for a given project. Once the number of logs exceeds this limit, oldest logs are purged.") - .type(PropertyType.INTEGER) - .defaultValue("10") - .category(CoreProperties.CATEGORY_GENERAL) - .build()); - } -} diff --git a/server/sonar-server/src/main/java/org/sonar/ce/property/package-info.java b/server/sonar-server/src/main/java/org/sonar/ce/property/package-info.java deleted file mode 100644 index 58c72408e54..00000000000 --- a/server/sonar-server/src/main/java/org/sonar/ce/property/package-info.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program 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. - * - * This program 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. - */ -@ParametersAreNonnullByDefault -package org.sonar.ce.property; - -import javax.annotation.ParametersAreNonnullByDefault; diff --git a/server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel1.java b/server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel1.java index fc9045a70f3..0bc71db5cfa 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel1.java +++ b/server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel1.java @@ -28,7 +28,6 @@ import org.sonar.api.internal.SonarRuntimeImpl; import org.sonar.api.utils.System2; import org.sonar.api.utils.Version; import org.sonar.api.utils.internal.TempFolderCleaner; -import org.sonar.ce.property.CePropertyDefinitions; import org.sonar.core.config.CorePropertyDefinitions; import org.sonar.core.util.UuidFactoryImpl; import org.sonar.db.DaoModule; @@ -122,7 +121,6 @@ public class PlatformLevel1 extends PlatformLevel { // Classes kept for backward compatibility of plugins/libs (like sonar-license) that are directly calling classes from the core org.sonar.core.properties.PropertiesDao.class); addAll(CorePropertyDefinitions.all()); - addAll(CePropertyDefinitions.all()); // cluster addAll(ClusterProperties.definitions()); diff --git a/server/sonar-server/src/test/java/org/sonar/ce/property/CePropertyDefinitionsTest.java b/server/sonar-server/src/test/java/org/sonar/ce/property/CePropertyDefinitionsTest.java deleted file mode 100644 index bd21696a622..00000000000 --- a/server/sonar-server/src/test/java/org/sonar/ce/property/CePropertyDefinitionsTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program 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. - * - * This program 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. - */ -package org.sonar.ce.property; - -import org.junit.Test; -import org.sonar.test.TestUtils; - -import static org.assertj.core.api.Assertions.assertThat; - -public class CePropertyDefinitionsTest { - - @Test - public void all() { - assertThat(CePropertyDefinitions.all()).isNotEmpty(); - } - - @Test - public void only_statics() { - assertThat(TestUtils.hasOnlyPrivateConstructors(CePropertyDefinitions.class)).isTrue(); - } -}