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

pr decoration fix IllegalStateException NO_VALUE #44

Closed
wants to merge 5 commits into from

Conversation

ThYpHo0n
Copy link

@ThYpHo0n ThYpHo0n commented Nov 4, 2019

Thanks for you efforts in introducing pr decoration!
I encountered two errors while running the plugin in the case that a PR doesn't change values in the duplications/coverage so that the conditions will end up having null values.

Error from the SonarQube CE log:

ERROR ce[foobar][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Execution of task class com.github.mc1arke.sonarqube.plugin.ce.pullrequest.PullRequestPostAnalysisTask failed

java.lang.IllegalStateException: There is no value when status is NO_VALUE
at com.google.common.base.Preconditions.checkState(Preconditions.java:197)
at org.sonar.ce.task.projectanalysis.api.posttask.ConditionImpl.getValue(ConditionImpl.java:163)
at com.github.mc1arke.sonarqube.plugin.ce.pullrequest.github.GithubPullRequestDecorator.decorateQualityGateStatus(GithubPullRequestDecorator.java:191)
at com.github.mc1arke.sonarqube.plugin.ce.pullrequest.PullRequestPostAnalysisTask.finished(PullRequestPostAnalysisTask.java:62)

mc1arke and others added 5 commits August 19, 2019 22:00
This change introduces the APIs and components to allow the collection of issues and metrics during analysis, and an initial implementation for decorating requests on Github using these metrics. The Github implementation uses v4 of the Github API to create the 'check run' with the analysis results, but v3 of the API to acquire the relevant application authentication tokens since application authentication cannot currently be created/retrieved through the v4 API.

The provided implementation currently only supports the same level of reporting as provided by the official SonarQube branch decoration, but without including any images in the summary, and the configuration properties match those in the official documentation for setting up SonarQube for application based authentication again Github.
@mc1arke
Copy link
Owner

mc1arke commented Dec 20, 2019

The state that causes this should no longer be present in #30 so I'm closing this PR without merging. Thanks for your contribution though!

@mc1arke mc1arke closed this Dec 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants