Quality Gate previously used

Is it possible to know what was the Quality Gate applied in an execution scan in the past?

  • which versions are you using: 9.9 Entreprise Edition
  • what are you trying to achieve: a way to get the qualitygate that was applied in the past.
  • what have you tried so far to achieve this: walkthrough all menus of the SonarQube server front-end and read all API endpoints. No success.

Hi,

Unfortunately, there’s no good way to do this. An Event is added to the analysis when the Quality Gate status, changes. And one is added when the Quality Profile in use changes. But one is not added when the Quality Gate in use changes.

I’m going to move this topic to the Product Manager for a Day category since the functionality doesn’t exist.

I think I know what the answer will be, but would you mind explaining why you want this?

 
Thx,
Ann

Hi Ann,
We are developing a centralized tool to measure the quality of a set of products. Among other tools, we are planning to fetch information from sonarqube.
An important information is to know how products are in terms of their Quality Gate. For that is necessary to know what QG had the sonarqube project runed against to.

If a project is passed, then we want to know what was the quality gate used during the scan. (Not necessarily the actual one)

There is no log table with info about what QG was configured for each execution?

1 Like

Hi,

I’m not aware of one.

 
Ann

Thank you Ann,

Is there any feedback from the Product Manager ?

Pedro

Hey Pedro,

Thanks for taking the time to explain.
Can you please tell me more about it? Is this something you plan to monitor or rather a piece of information that you would like to save with, for example, every release? Would you need to identify the name of the Quality Gate that was used, or would you also need to identify what was the definition of the Quality Gate at that time?

Chris

Hi Christophe,
Idea is to built a monitorization tool, and keep traking of the scans. Issue is that QG can be updated at any time and that way it’s not assured that a scan few days earlier is the one configured today.
However maybe it’s important to keep is the measures (not the QG). Does API offers a endpoint where query about measures in the past for a given project ?
Maybe endpoint /api/measures/search_history?component offers the list of measurements for each project?

Cheers

Hi again,

Is it possible to get the update of the QualityGate of a project from the api endpoint: /api/project_analyses/search?project=<
> ?
The update of a QG for a project will create an Event that is fetched from endpoint?

That way we’ll know if the QG was updated.

Trying to call the endpoint, the response gets following info within:
“events”: [

  •            {*
    
  •                "key": "AYoZv7LHoVQd_pm_PowR",*
    
  •                "category": "QUALITY_GATE",*
    

The key isn’t the QG key.
Is this key possible to be used somewhere to get more details about the events?

Thanks

Hi Pedro,

I realize that your question remains unanswered. Since you are now looking for assistance, I think you would get a better chance to get some help from the community if you split your question from your initial suggestion and post it outside of the “Product Manager for a Day” category.

Chris

1 Like

Thanks a lot for the suggestion.
Should i create a new post? or is it possible to update of “Product Manager for a Day” configuration of the post? (i don’t recall to had classify it like PM for a day)

Cheers

Hi,

You’ll be able to choose a category when you create your new thread. Without re-reading the thread, I’m guessing the ‘SonarQube’ category will be best.

 
HTH,
Ann

1 Like

We found a way to develop our requirement.

Nevertheless, thank you very much for the follow-up.

1 Like

Hi Pedro,

would you mind to share your solution ?

Gilbert

1 Like

Hi Gilbert,
It was internal workaround. No add value to the forum.
Cheers