Disabling AI Codefix with environment variable

As documented on Managing AI features | SonarQube Server Documentation
you can disable AI Codefix by setting sonar.ai.codefix.hidden=true in sonar.properties file. (Or contacting support and provide your serverId.)

For our deployment we use k8s manifests and container images. For Sonarqube configuration settings it is common to use environment variables, which can easily be added to a deployment.
In the provided sonar.properties file inside the container, it is stated that properties can be overridden by environment variables. The naming is also explained:

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 underscores (‘_’). For example, to override ‘sonar.web.systemPasscode’ use ‘SONAR_WEB_SYSTEMPASSCODE’.
  • be encrypted. See Security features | SonarQube Server Documentation

Setting property sonar.ai.codefix.hidden=true should be equal to setting environment variable SONAR_AI_CODEFIX_HIDDEN=true. However this is not the case, it has no effect.
Please allow disabling AI Codefix using an environment variable. It is more convenient and consistent with other configuration settings.

  • Version: SonarQube Server 10.8.1 (developer)
  • Deployment: K8s manifests, official container image
1 Like

Hi @tomkuipers ,

I can confirm it’s reproducible on our side. I’ve created a SONAR-24449 ticket which you can use to track the progress on the issue.

At the moment, we aim to include a fix for this in the 2025.2 SQ Server.

Best,

Vojtech

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.