]> source.dussan.org Git - sonarqube.git/commit
SONAR-7678 server-side stateless settings
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Wed, 31 Aug 2016 14:05:43 +0000 (16:05 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Tue, 6 Sep 2016 08:13:55 +0000 (10:13 +0200)
commitf79030e299ce766ec510ce2019c7b5e77105a1cd
tree380ff3dad2fb6378b5a2338eef4d28ea9fcbefb6
parenta8b6d946372e3dd3f1a0bacace78b9d02867897f
SONAR-7678 server-side stateless settings

* Settings class becomes abstract as multiple implementations
are used. Can't become an interface for binary
backward-compatibility of API

* tests should use MapSettings, an in-memory implementation
of Settings

* web server uses a thread-specific cache of settings when
processing HTTP requests

* web server does not have a cache of settings during startup,
except for the system settings loaded from sonar.properties

* Compute Engine uses a thread-specific cache of settings when
  processing a task. Cache is clear at end of task.

 * some useless methods of PersistentSettings are removed
194 files changed:
it/it-plugins/security-plugin/src/test/java/FakeAuthenticatorTest.java
plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/lang/XooTokenizerTest.java
server/sonar-ce/src/main/java/org/sonar/ce/container/ComputeEngineContainerImpl.java
server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java
server/sonar-server/src/main/java/org/sonar/ce/settings/ComputeEngineSettings.java [deleted file]
server/sonar-server/src/main/java/org/sonar/ce/settings/ProjectSettings.java [new file with mode: 0644]
server/sonar-server/src/main/java/org/sonar/ce/settings/ProjectSettingsFactory.java [new file with mode: 0644]
server/sonar-server/src/main/java/org/sonar/ce/settings/SettingsLoader.java
server/sonar-server/src/main/java/org/sonar/ce/settings/ThreadLocalSettings.java [deleted file]
server/sonar-server/src/main/java/org/sonar/server/authentication/JwtSerializer.java
server/sonar-server/src/main/java/org/sonar/server/authentication/UserSessionInitializer.java
server/sonar-server/src/main/java/org/sonar/server/computation/task/projectanalysis/component/SettingsRepositoryImpl.java
server/sonar-server/src/main/java/org/sonar/server/computation/task/projectanalysis/taskprocessor/ReportTaskProcessor.java
server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/SetDefaultTemplateAction.java
server/sonar-server/src/main/java/org/sonar/server/platform/PersistentSettings.java
server/sonar-server/src/main/java/org/sonar/server/platform/ServerSettings.java [deleted file]
server/sonar-server/src/main/java/org/sonar/server/platform/ServerSettingsImpl.java [deleted file]
server/sonar-server/src/main/java/org/sonar/server/platform/StartupMetadataPersister.java
server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel1.java
server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel2.java
server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel3.java
server/sonar-server/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java
server/sonar-server/src/main/java/org/sonar/server/qualitygate/QualityGates.java
server/sonar-server/src/main/java/org/sonar/server/setting/DatabaseSettingLoader.java [new file with mode: 0644]
server/sonar-server/src/main/java/org/sonar/server/setting/DatabaseSettingsEnabler.java [new file with mode: 0644]
server/sonar-server/src/main/java/org/sonar/server/setting/NopSettingLoader.java [new file with mode: 0644]
server/sonar-server/src/main/java/org/sonar/server/setting/ProjectSettingsFactory.java [deleted file]
server/sonar-server/src/main/java/org/sonar/server/setting/SettingLoader.java [new file with mode: 0644]
server/sonar-server/src/main/java/org/sonar/server/setting/ThreadLocalSettings.java [new file with mode: 0644]
server/sonar-server/src/main/java/org/sonar/server/ui/JRubyFacade.java
server/sonar-server/src/main/java/org/sonar/server/user/DoPrivileged.java
server/sonar-server/src/main/java/org/sonar/server/user/SecurityRealmFactory.java
server/sonar-server/src/main/java/org/sonar/server/user/ThreadLocalUserSession.java
server/sonar-server/src/main/java/org/sonar/server/user/UserSessionFilter.java
server/sonar-server/src/test/java/org/sonar/ce/http/CeHttpClientTest.java
server/sonar-server/src/test/java/org/sonar/ce/settings/ComputeEngineSettingsTest.java [deleted file]
server/sonar-server/src/test/java/org/sonar/ce/settings/SettingsLoaderTest.java
server/sonar-server/src/test/java/org/sonar/server/activity/ActivityServiceTest.java
server/sonar-server/src/test/java/org/sonar/server/activity/index/ActivityIndexDefinitionTest.java
server/sonar-server/src/test/java/org/sonar/server/activity/index/ActivityIndexTest.java
server/sonar-server/src/test/java/org/sonar/server/app/ProcessCommandWrapperImplTest.java
server/sonar-server/src/test/java/org/sonar/server/authentication/JwtHttpHandlerTest.java
server/sonar-server/src/test/java/org/sonar/server/authentication/JwtSerializerTest.java
server/sonar-server/src/test/java/org/sonar/server/authentication/RealmAuthenticatorTest.java
server/sonar-server/src/test/java/org/sonar/server/authentication/UserIdentityAuthenticatorTest.java
server/sonar-server/src/test/java/org/sonar/server/authentication/UserSessionInitializerTest.java
server/sonar-server/src/test/java/org/sonar/server/authentication/ws/LoginActionTest.java
server/sonar-server/src/test/java/org/sonar/server/authentication/ws/ValidateActionTest.java
server/sonar-server/src/test/java/org/sonar/server/batch/IssuesActionTest.java
server/sonar-server/src/test/java/org/sonar/server/batch/UsersActionTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/configuration/CeConfigurationImplTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/dbcleaner/ProjectCleanerTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/task/projectanalysis/api/measurecomputer/MeasureComputerContextImplTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/task/projectanalysis/component/SettingsRepositoryTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/task/projectanalysis/duplication/IntegrateCrossProjectDuplicationsTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/task/projectanalysis/issue/DebtCalculatorTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/task/projectanalysis/issue/DefaultAssigneeTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/task/projectanalysis/issue/ScmAccountToUserLoaderTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/task/projectanalysis/issue/filter/IssueFilterTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/task/projectanalysis/qualitymodel/RatingSettingsTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/task/projectanalysis/step/ApplyPermissionsStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/task/projectanalysis/step/IndexTestsStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/task/projectanalysis/step/LoadPeriodsStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/task/projectanalysis/step/PurgeDatastoresStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/task/projectanalysis/step/QualityGateLoadingStepTest.java
server/sonar-server/src/test/java/org/sonar/server/email/ws/UpdateConfigurationActionTest.java
server/sonar-server/src/test/java/org/sonar/server/es/EsClientProviderTest.java
server/sonar-server/src/test/java/org/sonar/server/es/EsTester.java
server/sonar-server/src/test/java/org/sonar/server/es/IndexCreatorTest.java
server/sonar-server/src/test/java/org/sonar/server/es/NewIndexTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueAuthorizationIndexerTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexDebtTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexDefinitionTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexerTest.java
server/sonar-server/src/test/java/org/sonar/server/measure/custom/ws/CreateActionTest.java
server/sonar-server/src/test/java/org/sonar/server/measure/custom/ws/MetricsActionTest.java
server/sonar-server/src/test/java/org/sonar/server/measure/custom/ws/SearchActionTest.java
server/sonar-server/src/test/java/org/sonar/server/measure/custom/ws/UpdateActionTest.java
server/sonar-server/src/test/java/org/sonar/server/notification/NotificationServiceTest.java
server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/ApplyTemplateActionTest.java
server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/BulkApplyTemplateActionTest.java
server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/DefaultPermissionTemplateFinderTest.java
server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/SearchTemplatesActionTest.java
server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/SetDefaultTemplateActionTest.java
server/sonar-server/src/test/java/org/sonar/server/platform/BackendCleanupMediumTest.java
server/sonar-server/src/test/java/org/sonar/server/platform/PersistentSettingsTest.java
server/sonar-server/src/test/java/org/sonar/server/platform/ServerIdLoaderTest.java
server/sonar-server/src/test/java/org/sonar/server/platform/ServerImplTest.java
server/sonar-server/src/test/java/org/sonar/server/platform/ServerLoggingTest.java
server/sonar-server/src/test/java/org/sonar/server/platform/ServerSettingsTest.java [deleted file]
server/sonar-server/src/test/java/org/sonar/server/platform/StartupMetadataPersisterTest.java
server/sonar-server/src/test/java/org/sonar/server/platform/StartupMetadataProviderTest.java
server/sonar-server/src/test/java/org/sonar/server/platform/UrlSettingsTest.java
server/sonar-server/src/test/java/org/sonar/server/platform/cluster/ClusterImplTest.java
server/sonar-server/src/test/java/org/sonar/server/platform/db/EmbeddedDatabaseFactoryTest.java
server/sonar-server/src/test/java/org/sonar/server/platform/db/EmbeddedDatabaseTest.java
server/sonar-server/src/test/java/org/sonar/server/platform/monitoring/EsMonitorTest.java
server/sonar-server/src/test/java/org/sonar/server/platform/monitoring/SettingsMonitorTest.java
server/sonar-server/src/test/java/org/sonar/server/platform/monitoring/SonarQubeMonitorTest.java
server/sonar-server/src/test/java/org/sonar/server/platform/ws/RestartActionTest.java
server/sonar-server/src/test/java/org/sonar/server/plugins/UpdateCenterClientTest.java
server/sonar-server/src/test/java/org/sonar/server/project/ws/BulkDeleteActionTest.java
server/sonar-server/src/test/java/org/sonar/server/project/ws/DeleteActionTest.java
server/sonar-server/src/test/java/org/sonar/server/qualitygate/QualityGatesTest.java
server/sonar-server/src/test/java/org/sonar/server/qualitygate/ws/DeselectActionTest.java
server/sonar-server/src/test/java/org/sonar/server/qualitygate/ws/GetByProjectActionTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/index/ActiveRuleIndexTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/index/ActiveRuleIndexerTest.java
server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/ChangelogActionTest.java
server/sonar-server/src/test/java/org/sonar/server/rule/RegisterRulesTest.java
server/sonar-server/src/test/java/org/sonar/server/rule/index/RuleIndexDefinitionTest.java
server/sonar-server/src/test/java/org/sonar/server/rule/index/RuleIndexTest.java
server/sonar-server/src/test/java/org/sonar/server/rule/index/RuleIndexerTest.java
server/sonar-server/src/test/java/org/sonar/server/setting/DatabaseSettingLoaderTest.java [new file with mode: 0644]
server/sonar-server/src/test/java/org/sonar/server/setting/DatabaseSettingsEnablerTest.java [new file with mode: 0644]
server/sonar-server/src/test/java/org/sonar/server/setting/NopSettingLoaderTest.java [new file with mode: 0644]
server/sonar-server/src/test/java/org/sonar/server/setting/ProjectSettingsFactoryTest.java
server/sonar-server/src/test/java/org/sonar/server/setting/ThreadLocalSettingsTest.java [new file with mode: 0644]
server/sonar-server/src/test/java/org/sonar/server/startup/ClearRulesOverloadedDebtTest.java
server/sonar-server/src/test/java/org/sonar/server/test/index/TestIndexTest.java
server/sonar-server/src/test/java/org/sonar/server/test/index/TestIndexerTest.java
server/sonar-server/src/test/java/org/sonar/server/test/ws/ListActionTest.java
server/sonar-server/src/test/java/org/sonar/server/tester/UserSessionRule.java
server/sonar-server/src/test/java/org/sonar/server/ui/ws/GlobalNavigationActionTest.java
server/sonar-server/src/test/java/org/sonar/server/ui/ws/SettingsNavigationActionTest.java
server/sonar-server/src/test/java/org/sonar/server/user/SecurityRealmFactoryTest.java
server/sonar-server/src/test/java/org/sonar/server/user/ThreadLocalUserSessionTest.java
server/sonar-server/src/test/java/org/sonar/server/user/UserSessionFilterTest.java
server/sonar-server/src/test/java/org/sonar/server/user/UserUpdaterTest.java
server/sonar-server/src/test/java/org/sonar/server/user/index/UserIndexDefinitionTest.java
server/sonar-server/src/test/java/org/sonar/server/user/index/UserIndexTest.java
server/sonar-server/src/test/java/org/sonar/server/user/index/UserIndexerTest.java
server/sonar-server/src/test/java/org/sonar/server/user/ws/ChangePasswordActionTest.java
server/sonar-server/src/test/java/org/sonar/server/user/ws/CreateActionTest.java
server/sonar-server/src/test/java/org/sonar/server/user/ws/DeactivateActionTest.java
server/sonar-server/src/test/java/org/sonar/server/user/ws/SearchActionTest.java
server/sonar-server/src/test/java/org/sonar/server/user/ws/UpdateActionTest.java
server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/DeleteActionTest.java
server/sonar-server/src/test/java/org/sonar/server/view/index/ViewIndexDefinitionTest.java
server/sonar-server/src/test/java/org/sonar/server/view/index/ViewIndexTest.java
server/sonar-server/src/test/java/org/sonar/server/view/index/ViewIndexerTest.java
sonar-core/src/test/java/org/sonar/core/timemachine/PeriodsTest.java
sonar-core/src/test/java/org/sonar/core/util/DefaultHttpDownloaderTest.java
sonar-db/src/test/java/org/sonar/db/DefaultDatabaseTest.java
sonar-db/src/test/java/org/sonar/db/TestDb.java
sonar-db/src/test/java/org/sonar/db/permission/PermissionRepositoryTest.java
sonar-db/src/test/java/org/sonar/db/purge/PurgeConfigurationTest.java
sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/internal/SensorContextTester.java
sonar-plugin-api/src/main/java/org/sonar/api/config/Encryption.java
sonar-plugin-api/src/main/java/org/sonar/api/config/MapSettings.java [new file with mode: 0644]
sonar-plugin-api/src/main/java/org/sonar/api/config/Settings.java
sonar-plugin-api/src/test/java/org/sonar/api/batch/bootstrap/ProjectBuilderTest.java
sonar-plugin-api/src/test/java/org/sonar/api/batch/sensor/cpd/internal/DefaultCpdTokensTest.java
sonar-plugin-api/src/test/java/org/sonar/api/batch/sensor/internal/SensorContextTesterTest.java
sonar-plugin-api/src/test/java/org/sonar/api/config/EmailSettingsTest.java
sonar-plugin-api/src/test/java/org/sonar/api/config/MapSettingsTest.java [new file with mode: 0644]
sonar-plugin-api/src/test/java/org/sonar/api/config/SettingsTest.java [deleted file]
sonar-plugin-api/src/test/java/org/sonar/api/scan/filesystem/FileExclusionsTest.java
sonar-plugin-api/src/test/java/org/sonar/api/utils/DurationsTest.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalSettings.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/ModuleSettings.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/ProjectSettings.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/ProjectConfiguratorTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/BatchPluginPredicateTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/FileCacheProviderTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/cpd/CpdExecutorTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/cpd/deprecated/DefaultCpdBlockIndexerTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/cpd/deprecated/JavaCpdBlockIndexerTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/issue/ignore/pattern/IssueExclusionPatternInitializerTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/issue/ignore/pattern/IssueInclusionPatternInitializerTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/platform/DefaultServerTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/postjob/DefaultPostJobContextTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/postjob/PostJobOptimizerTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/report/MetadataPublisherTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/report/ReportPublisherTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/rule/QProfileVerifierTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/rule/RulesProfileProviderTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/LanguageVerifierTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/ModuleSettingsTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/ProjectReactorValidatorTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/ProjectSettingsTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/filesystem/ExclusionFiltersTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/filesystem/InputFileBuilderFactoryTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/filesystem/InputFileBuilderTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/filesystem/LanguageDetectionFactoryTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/filesystem/LanguageDetectionTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/report/ConsoleReportTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/report/JSONReportTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/sensor/DefaultSensorContextTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/sensor/DefaultSensorStorageTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/sensor/SensorOptimizerTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/sensor/coverage/CoverageExclusionsTest.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/source/SymbolizableBuilderTest.java