I have a PR created in our BitBucket Server but the Merge is being prevented as shown in the attached screenshot (Open issues: 16 > 0). I'm trying to figure out where this is configured.
I've attached a screenshot of the Quality Gate we are using for the project and do not see that metric there. How do we change this?
Using SonarQube v7.4 Developer Edition, Sonar for BitBucket Server plugin v2.3.1, BitBucket Server v5.9.1.
Thanks in advance!
David
We also use Sonar, but this question is for SonarQube, not Atlassian.
@Mibex_Software is who I was targeting a response from. Perhaps I should have opened a ticket from their website though.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This pull request merge block message comes from a failed quality gate in Sonar. Could you please double-check that you are looking at the quality gates of the project you analyze (and not at the quality gate of a different project) and if you can find a quality gate with a metric called "Open issues"?
Best regards,
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Michael,
I confirmed that the Quality Gate conditions in the screenshot I gave was the one configured to the project. There are only 2 other quality gates configured (Sonar way + another custom one) and none of the 3 gates have the "Open issues" condition.
I even tried to add the "Open issues" condition to the gate and re-running a sonar scan but is still preventing merge with message: "Sonar failed quality gate: Open issues: XX > 0"
In the repository settings for the Sonar plugin, under the Merge Checks tab, I have "Merge Checks" enabled as well as "Use SonarQube Quality Gates"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I enabled DEBUG logging and found:
2019-01-09 11:00:16,793 DEBUG [SONAR-5] c.m.s.s.sonar.DefaultSonarClient SONAR time for calling GET http://localhost/api/measures/component?additionalFields=periods,metrics&metricKeys=alert_status,quality_gate_details&componentKey=com.app:app-parent&branch=feature%2FAAA-3-page-is-broken HTTP/1.1: 18.74947ms
2019-01-09 11:00:16,793 DEBUG [SONAR-5] c.m.s.s.sonar.DefaultSonarClient SONAR: RESPONSE: {"component":{"id":"AWgzbqdSpMojYA-W7l4R","key":"com.app:app-parent","name":"App Parent","qualifier":"TRK","measures":[{"metric":"alert_status","value":"ERROR"},{"metric":"quality_gate_details","value":"{\"level\":\"ERROR\",\"conditions\":[{\"metric\":\"open_issues\",\"op\":\"GT\",\"error\":\"0\",\"actual\":\"1\",\"level\":\"ERROR\"},{\"metric\":\"reopened_issues\",\"op\":\"GT\",\"error\":\"0\",\"actual\":\"0\",\"level\":\"OK\"}],\"ignoredConditions\":false}"}],"branch":"feature/AAA-3-page-is-broken"},"metrics":[{"key":"alert_status","name":"Quality Gate Status","description":"The project status with regard to its quality gate.","domain":"Releasability","type":"LEVEL","higherValuesAreBetter":true,"qualitative":true,"hidden":false,"custom":false},{"key":"quality_gate_details","name":"Quality Gate Details","description":"The project detailed status with regard to its quality gate","domain":"General","type":"DATA","qualitative":false,"hidden":false,"custom":false}],"periods":[]}
So the issue does appear to be on the SonarQube side of things. I'll post my question there.
Thanks.
EDIT: Appears to be a limitation of short-lived branches in SonarQube. https://docs.sonarqube.org/latest/branches/short-lived-branches/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.