diff options
author | Steve Marion <steve.marion@sonarsource.com> | 2024-11-28 14:43:23 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2024-11-28 20:02:59 +0000 |
commit | 08336d6acba76fd0f99a27f4fc90f8c61eb4bd24 (patch) | |
tree | 610e4df770bfa7e96dff2f8eecd6946bc9c012f4 /server/sonar-webserver-webapi | |
parent | e527e3cac9674f576fcf13b29371cd49ac673064 (diff) | |
download | sonarqube-08336d6acba76fd0f99a27f4fc90f8c61eb4bd24.tar.gz sonarqube-08336d6acba76fd0f99a27f4fc90f8c61eb4bd24.zip |
SONAR-23787 skip formatting of version for SQCB
Diffstat (limited to 'server/sonar-webserver-webapi')
-rw-r--r-- | server/sonar-webserver-webapi/src/main/java/org/sonar/server/ui/ws/GlobalAction.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ui/ws/GlobalAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ui/ws/GlobalAction.java index f346a7604ef..e40944c629c 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ui/ws/GlobalAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ui/ws/GlobalAction.java @@ -26,8 +26,6 @@ import java.util.Set; import org.sonar.api.Startable; import org.sonar.api.config.Configuration; import org.sonar.api.platform.Server; -import org.sonar.server.component.ComponentType; -import org.sonar.server.component.ComponentTypes; import org.sonar.api.server.ws.Change; import org.sonar.api.server.ws.Request; import org.sonar.api.server.ws.Response; @@ -36,11 +34,14 @@ import org.sonar.api.utils.System2; import org.sonar.api.utils.text.JsonWriter; import org.sonar.api.web.page.Page; import org.sonar.core.documentation.DocumentationLinkGenerator; +import org.sonar.core.platform.EditionProvider; import org.sonar.core.platform.PlatformEditionProvider; import org.sonar.db.DbClient; import org.sonar.db.DbSession; import org.sonar.db.dialect.H2; import org.sonar.server.authentication.DefaultAdminCredentialsVerifier; +import org.sonar.server.component.ComponentType; +import org.sonar.server.component.ComponentTypes; import org.sonar.server.issue.index.IssueIndexSyncProgressChecker; import org.sonar.server.platform.NodeInformation; import org.sonar.server.ui.PageRepository; @@ -180,7 +181,13 @@ public class GlobalAction implements NavigationWsAction, Startable { } private void writeVersion(JsonWriter json) { - String displayVersion = VersionFormatter.format(server.getVersion()); + final String displayVersion; + // if edition is community + if(editionProvider.get().filter(e -> e.equals(EditionProvider.Edition.COMMUNITY)).isPresent()) { + displayVersion = server.getVersion(); + } else { + displayVersion = VersionFormatter.format(server.getVersion()); + } json.prop("version", displayVersion); } |