From bef04f50354e73fe8ae49137ea903488c431caff Mon Sep 17 00:00:00 2001 From: David Cho-Lerat <117642976+david-cho-lerat-sonarsource@users.noreply.github.com> Date: Thu, 15 Dec 2022 17:09:31 +0100 Subject: [PATCH] SONAR-13057 Explain that update in sonar.properties are not taken into account when restarting from UI/WS --- .../src/main/js/components/common/RestartButton.tsx | 7 +++---- .../__tests__/__snapshots__/RestartButton-test.tsx.snap | 7 ++++++- .../java/org/sonar/server/platform/ws/RestartAction.java | 3 ++- sonar-application/src/main/assembly/conf/sonar.properties | 8 ++++++++ .../src/main/resources/org/sonar/l10n/core.properties | 1 + .../src/main/resources/snapshot-of-api.json | 2 +- 6 files changed, 21 insertions(+), 7 deletions(-) diff --git a/server/sonar-web/src/main/js/components/common/RestartButton.tsx b/server/sonar-web/src/main/js/components/common/RestartButton.tsx index c6eb8bd0f24..feae00d4318 100644 --- a/server/sonar-web/src/main/js/components/common/RestartButton.tsx +++ b/server/sonar-web/src/main/js/components/common/RestartButton.tsx @@ -32,9 +32,7 @@ interface Props { } export default class RestartButton extends React.PureComponent { - handleConfirm = () => { - return restart().then(this.props.fetchSystemStatus); - }; + handleConfirm = () => restart().then(this.props.fetchSystemStatus); render() { const { className, systemStatus } = this.props; @@ -46,7 +44,8 @@ export default class RestartButton extends React.PureComponent {

{translate('system.are_you_sure_to_restart')}

-

{translate('system.forcing_shutdown_not_recommended')}

+

{translate('system.forcing_shutdown_not_recommended')}

+

{translate('system.restart_does_not_reload_sonar_properties')}

} modalHeader={translate('system.restart_server')} diff --git a/server/sonar-web/src/main/js/components/common/__tests__/__snapshots__/RestartButton-test.tsx.snap b/server/sonar-web/src/main/js/components/common/__tests__/__snapshots__/RestartButton-test.tsx.snap index 90940e63cbb..4d612a7bcff 100644 --- a/server/sonar-web/src/main/js/components/common/__tests__/__snapshots__/RestartButton-test.tsx.snap +++ b/server/sonar-web/src/main/js/components/common/__tests__/__snapshots__/RestartButton-test.tsx.snap @@ -10,9 +10,14 @@ exports[`should render correctly 1`] = ` > system.are_you_sure_to_restart

-

+

system.forcing_shutdown_not_recommended

+

+ system.restart_does_not_reload_sonar_properties +

} modalHeader="system.restart_server" diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/platform/ws/RestartAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/platform/ws/RestartAction.java index 99a188ea297..de87d55c6c3 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/platform/ws/RestartAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/platform/ws/RestartAction.java @@ -52,7 +52,8 @@ public class RestartAction implements SystemWsAction { @Override public void define(WebService.NewController controller) { controller.createAction("restart") - .setDescription("Restart server. Require 'Administer System' permission. Perform a full restart of the Web, Search and Compute Engine Servers processes.") + .setDescription("Restarts server. Requires 'Administer System' permission. Performs a full restart of the Web, Search and Compute Engine Servers processes." + + " Does not reload sonar.properties.") .setSince("4.3") .setPost(true) .setHandler(this); diff --git a/sonar-application/src/main/assembly/conf/sonar.properties b/sonar-application/src/main/assembly/conf/sonar.properties index c1e24de49cd..31f9fe7d4aa 100644 --- a/sonar-application/src/main/assembly/conf/sonar.properties +++ b/sonar-application/src/main/assembly/conf/sonar.properties @@ -1,3 +1,11 @@ +#-------------------------------------------------------------------------------------------------- +# IMPORTANT: +# This file will *not* be reloaded upon hitting the "Restart" button in the UI, or using the +# api/system/restart endpoint. +# In order for any change made to this file to be taken into account, you must perform a full +# restart of the main SonarQube service. +#-------------------------------------------------------------------------------------------------- + # Property values can: # - be overridden by environment variables. The name of the corresponding environment variable is the # upper-cased name of the property where all the dot ('.') and dash ('-') characters are replaced by diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties index 2a51b3d2d5b..7625bd7b15e 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -3194,6 +3194,7 @@ system.log_level.warning.short=Current logs level has performance impacts, get b system.log_level.info=Your selection does not affect the Search Engine. system.logs_level=Logs level system.new_version_available=A new version of SonarQube is available. +system.restart_does_not_reload_sonar_properties=Also note that a restart will not reload the sonar.properties file. system.see_whats_new=See what's new! system.release_notes=Release Notes system.released_x=Released {0} diff --git a/sonar-ws-generator/src/main/resources/snapshot-of-api.json b/sonar-ws-generator/src/main/resources/snapshot-of-api.json index 72630f2deee..47f92478d4f 100644 --- a/sonar-ws-generator/src/main/resources/snapshot-of-api.json +++ b/sonar-ws-generator/src/main/resources/snapshot-of-api.json @@ -8961,7 +8961,7 @@ }, { "key": "restart", - "description": "Restart server. Require 'Administer System' permission. Perform a full restart of the Web, Search and Compute Engine Servers processes.", + "description": "Restarts server. Requires 'Administer System' permission. Performs a full restart of the Web, Search and Compute Engine Servers processes. Does not reload sonar.properties.", "since": "4.3", "internal": false, "post": true, -- 2.39.5