Configuration in sonar.properties not reflected in UI

1,187 views
Skip to first unread message

yoxo...@gmail.com

unread,
Feb 1, 2017, 8:38:49 AM2/1/17
to SonarQube

Hello,

configuration values set in sonar.properties are not shown in the UI - or not honored at all. This issue has already been raised on the mailing list [1] - alas, without being answered.

* Update Center (sonar.updatecenter.activate=false)

As expected, this is nicely reflected in the UI, i.e. all update center controls are disabled.

* Look and Feel (sonar.lf.*)

If - for example - 'sonar.lf.logoUrl' or 'sonar.lf.enableGravatar' are set in sonar.properties, the settings are used, but not shown in the UI. I would expect inputs to be prepopulated with the values set in the config file and to be read-only. A message near the disabled controls could be useful as well.
Also, it is unclear (and undocumented?) what happens if values are specified in the UI and in the config file. Which one overrides?

* Email settings (email.*)

Like above, those settings work are not reflected in the UI, and they seem to be undocumented. I found out about the email property names on the mailing list. [1]

* sonar.core.serverBaseURL

This is ignored if set via config file. Looks like a bug to me. (the same issue is described in [1])


Kind regards,
Roland



[1] https://groups.google.com/d/topic/sonarqube/aAFPS2KpuY8/discussion


Julien Lancelot

unread,
Feb 1, 2017, 9:08:25 AM2/1/17
to yoxo...@gmail.com, SonarQube
Hi,

See my answers below :

On Wed, 1 Feb 2017 at 14:38 <yoxo...@gmail.com> wrote:

Hello,

configuration values set in sonar.properties are not shown in the UI - or not honored at all. This issue has already been raised on the mailing list [1] - alas, without being answered.

* Update Center (sonar.updatecenter.activate=false)

As expected, this is nicely reflected in the UI, i.e. all update center controls are disabled.

Ok
 

* Look and Feel (sonar.lf.*)

If - for example - 'sonar.lf.logoUrl' or 'sonar.lf.enableGravatar' are set in sonar.properties, the settings are used, but not shown in the UI. I would expect inputs to be prepopulated with the values set in the config file and to be read-only. A message near the disabled controls could be useful as well.

Why would you set these settings in sonar.properties ?
 
Also, it is unclear (and undocumented?) what happens if values are specified in the UI and in the config file. Which one overrides?

* Email settings (email.*)

Email settings are only internal, nobody should used them, that's why it's not documented. 
 

Like above, those settings work are not reflected in the UI, and they seem to be undocumented. I found out about the email property names on the mailing list. [1]

* sonar.core.serverBaseURL

This is ignored if set via config file. Looks like a bug to me. (the same issue is described in [1])

Why would you set this in the sonar.properties file ?
 
--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/8987234a-ab90-486e-b845-2a2c5fd737e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Regards, 
--
Julien LANCELOT | SonarSource

yoxo...@gmail.com

unread,
Feb 1, 2017, 10:38:07 AM2/1/17
to SonarQube, yoxo...@gmail.com

Hi,

the motivation for this approach is trying to automate infrastructure setup. (e.g. with Docker or Puppet)

The need for manual intervention when deploying a new instance is time consuming and error prone, and does not scale well.
Also, to avoid configuration drift, it is desirable to have the whole configuration version controlled. (all config files in a VCS)

With automation, the somewhat higher cost of setting up the first instance quickly pays off when the next instances (for other departments, or testing) - those are almost free.

Kind regards,
Roland

Julien Lancelot

unread,
Feb 2, 2017, 3:12:06 AM2/2/17
to yoxo...@gmail.com, SonarQube
Hi,

I totally understand your needs, and we have the same internally at SonarSource !

What I would propose you to do is : 
  • For all settings that are described in sonar.properties, you can without any issues continue to use this file
  • For all other settings (available in the UI), you need to use web services to update them : 
    • Before SonarQube 6.3 : use POST api/properties 
    • Starting from SonarQube 6.3 : use POST api/settings/set
I hope this will help.
Regards,


For more options, visit https://groups.google.com/d/optout.

yoxo...@gmail.com

unread,
Feb 2, 2017, 7:58:58 AM2/2/17
to SonarQube, yoxo...@gmail.com

Hi Julien,

thank you for the clarification. POSTing the configuration values indeed does the trick.

However, looks like the email settings still need to be set manually.

Best regards,
Roland


PS. I noticed that I can submit arbitrary key/value pairs and get a "200" return value. A subsequent GET returns those. (no issue though)

yoxo...@gmail.com

unread,
Feb 2, 2017, 8:48:59 AM2/2/17
to SonarQube, yoxo...@gmail.com

Meanwhile I figured out the email part, too. (post to email_configuration/save)

Thanks again for the support and pointing me to the right direction.

Cheers,
Roland

Julien Lancelot

unread,
Feb 2, 2017, 11:17:30 AM2/2/17
to yoxo...@gmail.com, SonarQube
Good to know that you could used WS with success..

For email, have you tried with the settings provided by the ui ? 
  • email.smtp_port.secured
  • email.smtp_username.secured
  • email.smtp_host.secured
  • ...
Because posting on internal post to email_configuration/save won't work on next versions.

Regards,


For more options, visit https://groups.google.com/d/optout.

yoxo...@gmail.com

unread,
Feb 3, 2017, 1:54:19 AM2/3/17
to SonarQube, yoxo...@gmail.com

Yes, that works too and of is of course much preferred. Thanks!

The 5.6.5 UI does not reveal those keys, so I was not sure if it's a good idea to use them.

Best regards,
Roland

Julien Lancelot

unread,
Feb 3, 2017, 2:28:16 AM2/3/17
to yoxo...@gmail.com, SonarQube
Good news !

The email settings should appear in next version, in 6.2 it's visible.

Regards,


For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages