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

Compute Engine should support analyses run on older versions of analyzers

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.2
    • Component/s: Compute Engine
    • Labels:
      None

      Description

      The analysis report processed by Compute Engine may have been generated by older versions of analyzers when plugins are upgraded after the execution of scanner.

      The following cases should be supported:

      • report contains issues on a rule that has been removed. The issues should be ignored and should be excluded from computation of measures. Current version fails with:
        org.sonar.server.computation.task.projectanalysis.component.VisitException: Visit of Component {key=sample:src/File0.xoo,type=FILE} failed
        	at org.sonar.server.computation.task.projectanalysis.component.VisitException.rethrowOrWrap(VisitException.java:44)
        	at org.sonar.server.computation.task.projectanalysis.component.VisitorsCrawler.visit(VisitorsCrawler.java:74)
        	at org.sonar.server.computation.task.projectanalysis.component.VisitorsCrawler.visitChildren(VisitorsCrawler.java:110)
        	at org.sonar.server.computation.task.projectanalysis.component.VisitorsCrawler.visitImpl(VisitorsCrawler.java:97)
        	at org.sonar.server.computation.task.projectanalysis.component.VisitorsCrawler.visit(VisitorsCrawler.java:72)
        	at org.sonar.server.computation.task.projectanalysis.component.VisitorsCrawler.visitChildren(VisitorsCrawler.java:110)
        	at org.sonar.server.computation.task.projectanalysis.component.VisitorsCrawler.visitImpl(VisitorsCrawler.java:97)
        	at org.sonar.server.computation.task.projectanalysis.component.VisitorsCrawler.visit(VisitorsCrawler.java:72)
        	at org.sonar.server.computation.task.projectanalysis.step.ExecuteVisitorsStep.execute(ExecuteVisitorsStep.java:51)
        	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.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)
        	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:299)
        	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        	at java.base/java.lang.Thread.run(Thread.java:844)
        Caused by: java.lang.IllegalStateException: Fail to process issues of component 'sample:src/File0.xoo'
        	at org.sonar.server.computation.task.projectanalysis.issue.IntegrateIssuesVisitor.visitAny(IntegrateIssuesVisitor.java:70)
        	at org.sonar.server.computation.task.projectanalysis.component.TypeAwareVisitorWrapper.visitAny(TypeAwareVisitorWrapper.java:82)
        	at org.sonar.server.computation.task.projectanalysis.component.VisitorsCrawler.visitNode(VisitorsCrawler.java:117)
        	at org.sonar.server.computation.task.projectanalysis.component.VisitorsCrawler.visitImpl(VisitorsCrawler.java:100)
        	at org.sonar.server.computation.task.projectanalysis.component.VisitorsCrawler.visit(VisitorsCrawler.java:72)
        	... 22 more
        Caused by: java.lang.IllegalStateException: The rule bluegreen:a raised an issue, but is not one of the active rules.
        	at org.sonar.server.computation.task.projectanalysis.issue.IssueCreationDateCalculator.lambda$illegalStateException$2(IssueCreationDateCalculator.java:182)
        	at java.base/java.util.Optional.orElseThrow(Optional.java:385)
        	at org.sonar.server.computation.task.projectanalysis.issue.IssueCreationDateCalculator.onIssue(IssueCreationDateCalculator.java:84)
        	at org.sonar.server.computation.task.projectanalysis.issue.IssueVisitors.onIssue(IssueVisitors.java:41)
        	at org.sonar.server.computation.task.projectanalysis.issue.IntegrateIssuesVisitor.process(IntegrateIssuesVisitor.java:124)
        	at org.sonar.server.computation.task.projectanalysis.issue.IntegrateIssuesVisitor.fillNewOpenIssues(IntegrateIssuesVisitor.java:91)
        	at org.sonar.server.computation.task.projectanalysis.issue.IntegrateIssuesVisitor.visitAny(IntegrateIssuesVisitor.java:64)
        	... 26 more
        
      • report references a Quality profile that has been deleted. The profile name should be kept, without failing the analysis.
      • report references a language which related plugin has been uninstalled. The language should be ignored and be excluded from computation of measures.
      • report contains measures on a metric that has been removed. These measures should be ignored without failing analysis.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                simon.brandhof Simon Brandhof
                Reporter:
                simon.brandhof Simon Brandhof
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: