Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-7276

Report processing fails when quality gate contains multiple conditions on the same metric

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.2, 5.3, 5.4
    • Fix Version/s: 5.6
    • Component/s: Compute Engine
    • Labels:

      Description

      When multiple conditions are defined for the same metric in the quality gate, the processing of the report in the Compute Engine fails with an error such as the following:

      java.lang.UnsupportedOperationException: QualityGate status can not be changed if already set on source Measure
          at org.sonar.server.computation.measure.Measure$UpdateMeasureBuilder.setQualityGateStatus(Measure.java:244) ~[sonar-server-5.2.jar:na]
          at org.sonar.server.computation.step.QualityGateMeasuresStep.updateMeasures(QualityGateMeasuresStep.java:113) ~[sonar-server-5.2.jar:na]
          at org.sonar.server.computation.step.QualityGateMeasuresStep.executeForProject(QualityGateMeasuresStep.java:95) ~[sonar-server-5.2.jar:na]
          at org.sonar.server.computation.step.QualityGateMeasuresStep.access$000(QualityGateMeasuresStep.java:61) ~[sonar-server-5.2.jar:na]
          at org.sonar.server.computation.step.QualityGateMeasuresStep$1.visitProject(QualityGateMeasuresStep.java:85) ~[sonar-server-5.2.jar:na]
          at org.sonar.server.computation.component.DepthTraversalTypeAwareCrawler.visitNode(DepthTraversalTypeAwareCrawler.java:63) ~[sonar-server-5.2.jar:na]
          at org.sonar.server.computation.component.DepthTraversalTypeAwareCrawler.visit(DepthTraversalTypeAwareCrawler.java:44) ~[sonar-server-5.2.jar:na]
          at org.sonar.server.computation.step.QualityGateMeasuresStep.execute(QualityGateMeasuresStep.java:81) ~[sonar-server-5.2.jar:na]
          at org.sonar.server.computation.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:39) ~[sonar-server-5.2.jar:na]
          at org.sonar.server.computation.taskprocessor.report.ReportTaskProcessor.process(ReportTaskProcessor.java:53) ~[sonar-server-5.2.jar:na]
          at org.sonar.server.computation.taskprocessor.CeWorkerRunnableImpl.executeTask(CeWorkerRunnableImpl.java:78) [sonar-server-5.2.jar:na]
          at org.sonar.server.computation.taskprocessor.CeWorkerRunnableImpl.run(CeWorkerRunnableImpl.java:55) [sonar-server-5.2.jar:na]
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_85]
          at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304) [na:1.7.0_85]
      

      Since 5.4, only the leak period can be chosen (see SONAR-7070) but this does not prevent the user from creating multiple conditions for the leak period alone. So, the report processing should still be improved.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sebastien.lesaint Sebastien Lesaint
                Reporter:
                sebastien.lesaint Sebastien Lesaint
              • Votes:
                3 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: