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

Add input validation on quality gate conditions

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.1
    • Component/s: Quality Gate, Web API
    • Labels:

      Description

      Currently, it is possible to enter any kind of value on a quality gate condition. This leads to an error with a clear message during the analysis, but it would be nice to help the user enter correct values in the UI.

      Here's the error generated in compute engine task :

      Failed to execute task AWB0ignj1Lwr_7aTQeOw
      org.sonar.server.computation.task.projectanalysis.component.VisitException: Visit of Component {key=MyProjectKey,uuid=AWBqT1PDE5-t8Obqzzvo,type=PROJECT} failed
      	at org.sonar.server.computation.task.projectanalysis.component.VisitException.rethrowOrWrap(VisitException.java:44)
      	at org.sonar.server.computation.task.projectanalysis.component.DepthTraversalTypeAwareCrawler.visit(DepthTraversalTypeAwareCrawler.java:41)
      	at org.sonar.server.computation.task.projectanalysis.step.QualityGateMeasuresStep.execute(QualityGateMeasuresStep.java:109)
      	at org.sonar.server.computation.task.step.ComputationStepExecutor.executeSteps(ComputationStepExecutor.java:64)
      	at org.sonar.server.computation.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:52)
      	at org.sonar.server.computation.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:73)
      	at org.sonar.ce.taskprocessor.CeWorkerImpl.executeTask(CeWorkerImpl.java:134)
      	at org.sonar.ce.taskprocessor.CeWorkerImpl.findAndProcessTask(CeWorkerImpl.java:97)
      	at org.sonar.ce.taskprocessor.CeWorkerImpl.withCustomizedThreadName(CeWorkerImpl.java:81)
      	at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:73)
      	at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:43)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: java.lang.IllegalArgumentException: Quality Gate: Unable to parse value '10d' to compare against Technical Debt
      	at org.sonar.server.computation.task.projectanalysis.qualitygate.ConditionEvaluator.evaluateCondition(ConditionEvaluator.java:62)
      	at org.sonar.server.computation.task.projectanalysis.qualitygate.ConditionEvaluator.evaluate(ConditionEvaluator.java:44)
      	at org.sonar.server.computation.task.projectanalysis.step.QualityGateMeasuresStep.evaluateQualityGate(QualityGateMeasuresStep.java:210)
      	at org.sonar.server.computation.task.projectanalysis.step.QualityGateMeasuresStep.updateMeasures(QualityGateMeasuresStep.java:185)
      	at org.sonar.server.computation.task.projectanalysis.step.QualityGateMeasuresStep.executeForProject(QualityGateMeasuresStep.java:116)
      	at org.sonar.server.computation.task.projectanalysis.step.QualityGateMeasuresStep.access$000(QualityGateMeasuresStep.java:76)
      	at org.sonar.server.computation.task.projectanalysis.step.QualityGateMeasuresStep$1.visitProject(QualityGateMeasuresStep.java:107)
      	at org.sonar.server.computation.task.projectanalysis.component.DepthTraversalTypeAwareCrawler.visitNode(DepthTraversalTypeAwareCrawler.java:70)
      	at org.sonar.server.computation.task.projectanalysis.component.DepthTraversalTypeAwareCrawler.visitImpl(DepthTraversalTypeAwareCrawler.java:51)
      	at org.sonar.server.computation.task.projectanalysis.component.DepthTraversalTypeAwareCrawler.visit(DepthTraversalTypeAwareCrawler.java:39)
      	... 17 common frames omitted
      

        Attachments

          Activity

            People

            Assignee:
            julien.lancelot Julien Lancelot
            Reporter:
            fabrice.bellingard Fabrice Bellingard
            Votes:
            6 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: