Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gitlab PR decoration don't work anymore #335

Closed
LaSylv opened this issue Apr 12, 2021 · 3 comments
Closed

Gitlab PR decoration don't work anymore #335

LaSylv opened this issue Apr 12, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@LaSylv
Copy link

LaSylv commented Apr 12, 2021

Describe the bug
Gitlab PR decoration is failing

To Reproduce
Configure gitlab PR decoration
Expected behavior
No ERROR/failing

Software Versions

  • SonarQube Version: [8.7.0] (reproduced on 8.8.0)
  • Plugin Version: 1.7.0

Additional context


2021.04.12 08:45:23 ERROR ce[AXjFQa7dboEK8z4slOrP][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Execution of task class com.github.mc1arke.sonarqube.plugin.ce.pullrequest.PullRequestPostAnalysisTask failed
java.lang.IllegalArgumentException: Cannot format given Object as a Number
	at java.base/java.text.DecimalFormat.format(Unknown Source)
	at java.base/java.text.Format.format(Unknown Source)
	at com.github.mc1arke.sonarqube.plugin.ce.pullrequest.AnalysisDetails.createAnalysisSummary(AnalysisDetails.java:207)
	at com.github.mc1arke.sonarqube.plugin.ce.pullrequest.gitlab.GitlabServerPullRequestDecorator.decorateQualityGateStatus(GitlabServerPullRequestDecorator.java:171)
	at com.github.mc1arke.sonarqube.plugin.ce.pullrequest.PullRequestPostAnalysisTask.finished(PullRequestPostAnalysisTask.java:160)
	at org.sonar.ce.task.projectanalysis.api.posttask.PostProjectAnalysisTasksExecutor.executeTask(PostProjectAnalysisTasksExecutor.java:118)
	at org.sonar.ce.task.projectanalysis.api.posttask.PostProjectAnalysisTasksExecutor.finished(PostProjectAnalysisTasksExecutor.java:109)
	at org.sonar.ce.task.step.ComputationStepExecutor.executeListener(ComputationStepExecutor.java:91)
	at org.sonar.ce.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:63)
	at org.sonar.ce.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:81)
	at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.executeTask(CeWorkerImpl.java:235)
	at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.run(CeWorkerImpl.java:217)
	at org.sonar.ce.taskprocessor.CeWorkerImpl.findAndProcessTask(CeWorkerImpl.java:162)
	at org.sonar.ce.taskprocessor.CeWorkerImpl$TrackRunningState.get(CeWorkerImpl.java:137)
	at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:89)
	at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:53)
	at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
	at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:69)
	at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

If you have any hint on why this is happening I can try to fix this

@Rakdos8
Copy link
Contributor

Rakdos8 commented Apr 19, 2021

Sonar version : 8.8.0.42792
Plugin version : 1.7.0

I ran in the same issue on a grovvy project. But my Java project is still working.
I've a bit checked the stack trace and it fails there : https://github.com/mc1arke/sonarqube-community-branch-plugin/blob/master/src/main/java/com/github/mc1arke/sonarqube/plugin/ce/pullrequest/AnalysisDetails.java#L207 on decimalFormat.format(coverage).
I don't understand why though because coverage is a BigDecimal (so a Number) or is null. If it's null, it's not an Object.

@mc1arke
Copy link
Owner

mc1arke commented May 17, 2021

Fixed in 1.8.0 of the plugin

@mc1arke mc1arke closed this as completed May 17, 2021
@nishwalshetty
Copy link

@mc1arke i see the same issue with sonarqube 9.5 and plugin version 1.12.0.

couple of observations:

1 . works fine when change is in files whose language is recognized by sonarqube but when the pull request has changes to a shell script/Jenkinsfile it is not posting any comment maybe becuase there is no language for these files in sonarqube but the expectation is that it will post a success status check and sucessful comment in pr.
2. i installed shell check plugin and rerun it starts decorating the pull request.

question : if the language of the changes file is not available in sonarqube then plugin will not post any comment/status ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants