SonarQube 9.7.1 - no more edition API endpoint

Hello,

We have developed a tool to manage our SonarQube instances and to automate project creation and configuration.

Because in the past we had several SQ editions, we were checking the edition using the api endpoint api/system/info and then fetching ['Statistics']['edition'].

It seems that since the upgrade to 9.7.1 (we had 9.6 previously), the edition is no longer present in the API response. Has it been moved to some other endpoint I don’t know about ?

We are heavily using the API to manage our instance and such modification had a lot of impact. Is there a changelog on API-related changes ?

Thanks ^^

1 Like

Hello @Mikhail_Sidelnikov ,

Yes, we are aware of this issue and are actively working on it. As a workaround, for licensed SonarQube instances (i.e. Developer, Enterprise, Data Center Editions), the api/editions/show_license will return details about the edition, but you’ll receive a 404 on Community Edition.

I will update you once we have further updates to share.

1 Like

Thanks for your reply @Joe !

I’m afraid in our case this would not be sufficient because we are also relying on the Statistics section for KPI purposes (the NLoC namely) …

BR

1 Like

As you may know already, [SONAR-17194] - Jira and We’re making some changes to SonarQube telemetry document the reasons for the change. The Statistics object is therefore intentionally removed.

In [SONAR-17578] - Jira for SonarQube 9.8, we will fix LOC information back to GET api/system/info API, which should allow you to obtain LOC information then.

1 Like

I am curious to learn more about this:

We have developed a tool to manage our SonarQube instances and to automate project creation and configuration.

Is this tool published somewhere? We have a fairly large org and using click ops to manage lots of projects and settings is not a good idea, hence my interest in this.

Thanks for your interest !

Unfortunately it’s not published, the tool is tightly linked to the way we are using projects (project key generation, application generation and project linking to the application, etc).

In the future, I’d really like to use the python-sonarqube-api Python package to just keep métier-related process in our pipelines and leave the API processes to the Python package.

1 Like

Thank you for sharing the python package link, I will take a look. I’ve been on a lookout for configuration providers that can configure Sonar, perhaps something like this using Terraform:

https://registry.terraform.io/providers/jdamata/sonarqube/latest/docs

The idea is to use an industry standard tool, driven via config, to maintain projects at scale. Yes, the API is neat but that still leaves considerable amount of engineering work to write a tool that can be used in config-as-code paradigm. I would love to see Sonar provide something in this space, using one of the most popular configuration management tools like Terraform, or CloudFormation with custom resource definitions. This idea isn’t unique, and other technology companies do do this to support adoption. It’s a glaring omission in the current portfolio.

2 Likes