Long lived branches: quality gate does not fail in first analysis

315 views
Skip to first unread message

Kumar Gaurav

unread,
Jun 6, 2018, 3:42:00 AM6/6/18
to SonarQube
Dear all,

With long lived branch: Quality gate does not fail for new code coverage in first analysis.

I am doing following:
- git checkout -b "new_branch"
- add some code and don't write tests for them
- mvn sonar:sonar -Dsonar.branch.name new_branch

Quality gate passes for new_branch although its configured to use default sonar quality gate: Error when new code coverage < 80%

It means that if someone runs sonar analysis for a branch first time, after making some changes, he/she would not know whether his/her code will break quality gate upon merge.

Please let me know if I am missing something here.

Thanks a lot,
Kumar

G. Ann Campbell

unread,
Jun 7, 2018, 8:07:12 AM6/7/18
to SonarQube
Hi Kumar,

You're not missing anything. Unfortunately, this is a known limitation for now.


Ann

Kumar Gaurav

unread,
Jun 8, 2018, 5:51:14 AM6/8/18
to SonarQube
Thanks Ann. Is there a ticket already for that. I can vote and watch the ticket in that case.

Regards
Kumar

G. Ann Campbell

unread,
Jun 8, 2018, 7:16:31 AM6/8/18
to Kumar Gaurav, SonarQube
I knew you were going to ask me for that! I should have just take the time yesterday to find it. 

Here's what you're looking for: https://jira.sonarsource.com/browse/MMF-1265


Ann



---
G. Ann Campbell | SonarSource
Product Manager
@GAnnCampbell

Kumar

--
Important: this SonarQube Google Group will close on June 11th, 2018, in order to move to a new forum to power even more community discussions. See details in this post: https://groups.google.com/d/msg/sonarqube/BbSZz-JnhVM/DavhMueEAAAJ
---
You received this message because you are subscribed to a topic in the Google Groups "SonarQube" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sonarqube/57XrEbTT8dA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sonarqube+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/d87192c7-fa81-4c5c-974d-d8a32094496e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kumar Gaurav

unread,
Jun 8, 2018, 8:14:13 AM6/8/18
to SonarQube
Thanks a lot Ann. I am following that.

My current workaround is to run following just after I create a branch: 

git checkout master
mvn sonar:sonar -Dsonar.branch.name=my_branch
git checkout my_branch
mvn sonar:sonar -Dsonar.branch.name=my_branch

I don't really like this way, please let me know in case there is a better workaround.

Thanks,
Kumar


On Friday, June 8, 2018 at 9:16:31 PM UTC+10, G. Ann Campbell wrote:
I knew you were going to ask me for that! I should have just take the time yesterday to find it. 

Here's what you're looking for: https://jira.sonarsource.com/browse/MMF-1265


Ann



---
G. Ann Campbell | SonarSource
Product Manager
@GAnnCampbell

On Fri, Jun 8, 2018 at 11:51 AM, Kumar Gaurav <gau...@kgaurav.com> wrote:
Thanks Ann. Is there a ticket already for that. I can vote and watch the ticket in that case.

Regards
Kumar

--
Important: this SonarQube Google Group will close on June 11th, 2018, in order to move to a new forum to power even more community discussions. See details in this post: https://groups.google.com/d/msg/sonarqube/BbSZz-JnhVM/DavhMueEAAAJ
---
You received this message because you are subscribed to a topic in the Google Groups "SonarQube" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sonarqube/57XrEbTT8dA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sonarqube+...@googlegroups.com.

G. Ann Campbell

unread,
Jun 8, 2018, 8:19:08 AM6/8/18
to Kumar Gaurav, SonarQube
Hi Kumar,

I understand your distaste, but I think you're already come up with the best approach.


Ann



---
G. Ann Campbell | SonarSource
Product Manager
@GAnnCampbell

To unsubscribe from this group and all its topics, send an email to sonarqube+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/1b04830b-6dc2-4775-af07-0744c7116cba%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages