Sonar: Validate changes from a given date

Asked

Viewed 75 times

1

I use Git integrated with Team Foundation Server. The idea is to place Sonar as a step in TFS to stop the build as per the established rule. I need to know if it is possible for Sonar to apply the tests only for changes made from a certain date. Example: I have the 1 year history of system changes. I’m going to put the Sonar step today. I want him to check only the changes made as of today. To reduce the initial impact, the idea would be to make a validation framework, and then validate what was left behind. It is possible?

2 answers

1


Sonar will run on top of the build, not in all of its code history, but you need a historical basis to analyze whether the code is improving or not. Sonar evaluates trend, so the analysis takes place on the historical.

But yes, it is possible to score from when Sonarqube will perform the analysis, setting a point in the past for this.

  • Well, I like I know this point?

1

In your build you need to add 3 steps:

inserir a descrição da imagem aqui

1) Prepare Analysis

Configure which Sonarqube project will upload the information. In this step we have to Configure Endpoint, Project key, Project Name and Project Version

2) Run Code Analysis

This step should be added right after build

3) Publish Quality Gate Result

Must be added to publish the result

After this, each build that runs will be published the result:

inserir a descrição da imagem aqui

For more information, follow the official documentation link:

https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Extension+for+VSTS-TFS

Browser other questions tagged

You are not signed in. Login or sign up in order to post.