diff options
author | Steve Marion <steve.marion@sonarsource.com> | 2024-11-21 10:36:22 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2024-11-28 20:02:59 +0000 |
commit | 84398329f3989d32830e7fd4f623c8b8fc47e5d5 (patch) | |
tree | bddb3ef6821fe5ca77f50728d0475b43a5e0fb45 /server/sonar-webserver/src | |
parent | 49e3469392c8a5d5d17a72a19b60583445993cee (diff) | |
download | sonarqube-84398329f3989d32830e7fd4f623c8b8fc47e5d5.tar.gz sonarqube-84398329f3989d32830e7fd4f623c8b8fc47e5d5.zip |
SONAR-23755 Add core extension common to allow SQS specific behavior to happen. Add to DefaultLinkGenerator extension point to modify the default documentation base URL.
Diffstat (limited to 'server/sonar-webserver/src')
3 files changed, 8 insertions, 4 deletions
diff --git a/server/sonar-webserver/src/main/java/org/sonar/server/platform/PlatformImpl.java b/server/sonar-webserver/src/main/java/org/sonar/server/platform/PlatformImpl.java index 882a5185ada..23706d9e3e6 100644 --- a/server/sonar-webserver/src/main/java/org/sonar/server/platform/PlatformImpl.java +++ b/server/sonar-webserver/src/main/java/org/sonar/server/platform/PlatformImpl.java @@ -29,6 +29,7 @@ import javax.servlet.ServletRegistration; import org.sonar.api.utils.log.Logger; import org.sonar.api.utils.log.Loggers; import org.sonar.api.utils.log.Profiler; +import org.sonar.core.documentation.DocumentationLinkGenerator; import org.sonar.core.platform.ExtensionContainer; import org.sonar.core.platform.SpringComponentContainer; import org.sonar.server.app.ProcessCommandWrapper; @@ -100,7 +101,9 @@ public class PlatformImpl implements Platform { // if AutoDbMigration kicked in or no DB migration was required, startup can be resumed in another thread if (dbRequiresMigration()) { - LOGGER.info("Database needs to be migrated. Please refer to https://docs.sonarsource.com/sonarqube/latest/setup/upgrading"); + DocumentationLinkGenerator docLinkGenerator = currentLevel.getContainer().getComponentByType(DocumentationLinkGenerator.class); + String documentationLink = docLinkGenerator.getDocumentationLink("/setup/upgrading"); + LOGGER.info("Database needs to be migrated. Please refer to {}", documentationLink); } else { this.autoStarter = createAutoStarter(); diff --git a/server/sonar-webserver/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel1.java b/server/sonar-webserver/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel1.java index 6976d2dd286..0bc70a5c392 100644 --- a/server/sonar-webserver/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel1.java +++ b/server/sonar-webserver/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel1.java @@ -28,6 +28,7 @@ import org.sonar.api.internal.SonarRuntimeImpl; import org.sonar.api.utils.System2; import org.sonar.api.utils.Version; import org.sonar.core.config.CorePropertyDefinitions; +import org.sonar.core.documentation.DefaultDocumentationLinkGenerator; import org.sonar.core.extension.CoreExtensionRepositoryImpl; import org.sonar.core.extension.CoreExtensionsLoader; import org.sonar.core.platform.SonarQubeVersion; @@ -51,8 +52,8 @@ import org.sonar.server.es.EsModule; import org.sonar.server.issue.index.IssueIndex; import org.sonar.server.issue.index.IssueIndexSyncProgressChecker; import org.sonar.server.permission.index.WebAuthorizationTypeSupport; -import org.sonar.server.platform.DefaultNodeInformation; import org.sonar.server.platform.ContainerSupportImpl; +import org.sonar.server.platform.DefaultNodeInformation; import org.sonar.server.platform.LogServerVersion; import org.sonar.server.platform.Platform; import org.sonar.server.platform.ServerFileSystemImpl; @@ -140,6 +141,8 @@ public class PlatformLevel1 extends PlatformLevel { GlobalLockManagerImpl.class, + DefaultDocumentationLinkGenerator.class, + new OkHttpClientProvider(), CoreExtensionRepositoryImpl.class, diff --git a/server/sonar-webserver/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java b/server/sonar-webserver/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java index a09c93f5d68..1b03e89f093 100644 --- a/server/sonar-webserver/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java +++ b/server/sonar-webserver/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java @@ -53,7 +53,6 @@ import org.sonar.ce.task.projectanalysis.taskprocessor.AuditPurgeTaskProcessor; import org.sonar.ce.task.projectanalysis.taskprocessor.IssueSyncTaskProcessor; import org.sonar.ce.task.projectanalysis.taskprocessor.ReportTaskProcessor; import org.sonar.ce.task.projectexport.taskprocessor.ProjectExportTaskProcessor; -import org.sonar.core.documentation.DefaultDocumentationLinkGenerator; import org.sonar.core.extension.CoreExtensionsInstaller; import org.sonar.core.language.LanguagesProvider; import org.sonar.core.metric.SoftwareQualitiesMetrics; @@ -340,7 +339,6 @@ public class PlatformLevel4 extends PlatformLevel { WebAnalyticsLoaderImpl.class, new MonitoringWsModule(), DefaultBranchNameResolver.class, - DefaultDocumentationLinkGenerator.class, DelegatingManagedServices.class, DelegatingDevOpsProjectCreatorFactory.class, |