aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Marion <steve.marion@sonarsource.com>2024-12-06 17:16:31 +0100
committersonartech <sonartech@sonarsource.com>2024-12-11 20:03:09 +0000
commitb9f5a1b3342ba21b307fd6615a7206bd0d188645 (patch)
tree141a7d6bbf729c92c43dd9c545df73393b22964e
parent889253c668d4ad467bbcde7e580d7bfafdbd2224 (diff)
downloadsonarqube-b9f5a1b3342ba21b307fd6615a7206bd0d188645.tar.gz
sonarqube-b9f5a1b3342ba21b307fd6615a7206bd0d188645.zip
SONAR-23901 replace invalid documentation upgrade url.
(cherry picked from commit fa1b58e014b8b08aa49a1af1649b8311cb21ddf2)
-rw-r--r--server/sonar-webserver-core/src/main/java/org/sonar/server/platform/DatabaseServerCompatibility.java2
-rw-r--r--server/sonar-webserver-core/src/test/java/org/sonar/server/platform/DatabaseServerCompatibilityTest.java6
-rw-r--r--server/sonar-webserver/src/main/java/org/sonar/server/platform/PlatformImpl.java2
3 files changed, 5 insertions, 5 deletions
diff --git a/server/sonar-webserver-core/src/main/java/org/sonar/server/platform/DatabaseServerCompatibility.java b/server/sonar-webserver-core/src/main/java/org/sonar/server/platform/DatabaseServerCompatibility.java
index 9e94c11a24e..81a1f84f788 100644
--- a/server/sonar-webserver-core/src/main/java/org/sonar/server/platform/DatabaseServerCompatibility.java
+++ b/server/sonar-webserver-core/src/main/java/org/sonar/server/platform/DatabaseServerCompatibility.java
@@ -56,7 +56,7 @@ public class DatabaseServerCompatibility implements Startable {
throw MessageException.of("The version of SonarQube you are trying to upgrade from is too old. Please upgrade to the " +
MIN_UPGRADE_VERSION_HUMAN_READABLE + " Long-Term Active version first.");
}
- String documentationLink = documentationLinkGenerator.getDocumentationLink("/setup/upgrading");
+ String documentationLink = documentationLinkGenerator.getDocumentationLink("/server-upgrade-and-maintenance/upgrade/upgrade-the-server/roadmap");
String msg = String.format("The database must be manually upgraded. Please backup the database and browse /setup. "
+ "For more information: %s", documentationLink);
LoggerFactory.getLogger(DatabaseServerCompatibility.class).warn(msg);
diff --git a/server/sonar-webserver-core/src/test/java/org/sonar/server/platform/DatabaseServerCompatibilityTest.java b/server/sonar-webserver-core/src/test/java/org/sonar/server/platform/DatabaseServerCompatibilityTest.java
index 2f5d577beea..19a5a4412a5 100644
--- a/server/sonar-webserver-core/src/test/java/org/sonar/server/platform/DatabaseServerCompatibilityTest.java
+++ b/server/sonar-webserver-core/src/test/java/org/sonar/server/platform/DatabaseServerCompatibilityTest.java
@@ -69,17 +69,17 @@ public class DatabaseServerCompatibilityTest {
public void log_warning_if_requires_upgrade() {
when(version.getStatus()).thenReturn(DatabaseVersion.Status.REQUIRES_UPGRADE);
when(version.getVersion()).thenReturn(Optional.of(DatabaseVersion.MIN_UPGRADE_VERSION));
- when(documentationLinkGenerator.getDocumentationLink("/setup/upgrading")).thenReturn("https://docs.sonarsource.com/sonarqube/latest/setup/upgrading");
+ when(documentationLinkGenerator.getDocumentationLink("/server-upgrade-and-maintenance/upgrade/upgrade-the-server/roadmap")).thenReturn("[expected doc url]");
compatibility.start();
assertThat(logTester.logs()).hasSize(4);
assertThat(logTester.logs(Level.WARN)).contains(
"The database must be manually upgraded. Please backup the database and browse /setup. "
- + "For more information: https://docs.sonarsource.com/sonarqube/latest/setup/upgrading",
+ + "For more information: [expected doc url]",
"################################################################################",
"The database must be manually upgraded. Please backup the database and browse /setup. "
- + "For more information: https://docs.sonarsource.com/sonarqube/latest/setup/upgrading",
+ + "For more information: [expected doc url]",
"################################################################################");
}
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 23706d9e3e6..28821f02993 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
@@ -102,7 +102,7 @@ public class PlatformImpl implements Platform {
// if AutoDbMigration kicked in or no DB migration was required, startup can be resumed in another thread
if (dbRequiresMigration()) {
DocumentationLinkGenerator docLinkGenerator = currentLevel.getContainer().getComponentByType(DocumentationLinkGenerator.class);
- String documentationLink = docLinkGenerator.getDocumentationLink("/setup/upgrading");
+ String documentationLink = docLinkGenerator.getDocumentationLink("/server-upgrade-and-maintenance/upgrade/upgrade-the-server/roadmap");
LOGGER.info("Database needs to be migrated. Please refer to {}", documentationLink);
} else {
this.autoStarter = createAutoStarter();