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

Add support for Sonarqube 8.2.0 #156

Merged
merged 1 commit into from
Jul 17, 2020
Merged

Add support for Sonarqube 8.2.0 #156

merged 1 commit into from
Jul 17, 2020

Conversation

mc1arke
Copy link
Owner

@mc1arke mc1arke commented Apr 19, 2020

Sonarqube 8.2 introduced a new ProjectDto with associated changes in ProjectAlmSettingsDao to require this new class in various methods, as well as changes in ComponentFinder to allow retrieval of instances of a project.

As this class and the associated methods did not exist in previous versions of Sonarqube, this change breaks backwards compatibility, so means the plugin will now only support Sonarqube 8.2.

Sonarqube 8.2 also provides the ability to set the optional URL parameter on a Gitlab project so that scans run outside of Gitlab CI operate properly, so the additional parameter is now included in the appopriate WebServices and the Gitlab decorator.

@mc1arke
Copy link
Owner Author

mc1arke commented Apr 19, 2020

As per #58, the initial scan of a branch does not return the expected set of initial issues, however does currently support the new code in Sonarqube 8.2, as well setting the URL in Gitlab

@mclayton7
Copy link

@mc1arke this is great. Are you up for adding #145 to this?

@thorus90
Copy link

thorus90 commented May 7, 2020

Any chance that will be integrated soon?

@mc1arke
Copy link
Owner Author

mc1arke commented May 7, 2020

Given this doesn't seem to identify new versus old issues correctly, I'm not keen on merging it, but also haven't had time to investigate why it's not working properly yet.

@k2589
Copy link

k2589 commented May 7, 2020

I builded jar from this branch, but on launch I get this error:

Error: Unable to initialize main class org.sonar.application.App

Caused by: java.lang.NoClassDefFoundError: org/sonar/application/config/AppSettingsLoader

@thib3113
Copy link

Hello, I'm trying to build your branch, run it on sonarqube 8.3.
sonarqube crash with :

java.lang.IllegalStateException: Current edition does not support branch feature
	at com.google.common.base.Preconditions.checkState(Preconditions.java:508)
	at org.sonar.server.ce.queue.BranchSupport.createComponentKey(BranchSupport.java:63)

But the plugin is correctly present in plugin section (in sonarqube), and in the plugin folder (and lib/commons) .

and I can't select a branch on the homepage .

I'll retry with changing (in build.gradle) :

def sonarqubeVersion = '8.3.1.34397'

@migueltg
Copy link

migueltg commented May 13, 2020

Hello, I'm trying to build your branch, run it on sonarqube 8.3.
sonarqube crash with :

java.lang.IllegalStateException: Current edition does not support branch feature
	at com.google.common.base.Preconditions.checkState(Preconditions.java:508)
	at org.sonar.server.ce.queue.BranchSupport.createComponentKey(BranchSupport.java:63)

But the plugin is correctly present in plugin section (in sonarqube), and in the plugin folder (and lib/commons) .

and I can't select a branch on the homepage .

I'll retry with changing (in build.gradle) :

def sonarqubeVersion = '8.3.1.34397'

Not working for me, i get this error doing the build


com.github.mc1arke.sonarqube.plugin.ce.pullrequest.gitlab.GitlabServerPullRequestDecoratorTest > decorateQualityGateStatus FAILED
    com.github.tomakehurst.wiremock.common.FatalStartupException
        Caused by: java.lang.RuntimeException
            Caused by: java.net.BindException

Any suggestion?

EDIT: Test Failed, but lib is working 😃

@thib3113
Copy link

@migueltg it is correctly working for you ? on 8.3 ?

@migueltg
Copy link

@migueltg it is correctly working for you ? on 8.3 ?

I don´t test all but branches are working with 8.3.1.34397

@tisoft
Copy link
Contributor

tisoft commented May 13, 2020

I also tested against 8.3.1.34397 and it seems to work the same way as with 8.2.

@thib3113
Copy link

thib3113 commented May 13, 2020

hum ... I think I miss something ...
I'm coming directly from 8.0-beta ... And, the branch selector disapear with the new interface
image

but correctly detected on marketplace part ...
image

and when I run the sonar scanner (scan failed, and sonarqube log:) :

2020.05.13 12:04:50 ERROR web[AXINW+tdEVL7+LyrAADA][o.s.s.w.WebServiceEngine] Fail to process request http://sonarqube.srv/api/ce/submit?projectKey=myProject&projectName=myProject%20Api&characteristic=branch%3Drenovate%2Fnode-12.x&characteristic=branchType%3DBRANCH
java.lang.IllegalStateException: Current edition does not support branch feature
	at com.google.common.base.Preconditions.checkState(Preconditions.java:508)
	at org.sonar.server.ce.queue.BranchSupport.createComponentKey(BranchSupport.java:63)
	at org.sonar.server.ce.queue.ReportSubmitter.submit(ReportSubmitter.java:83)

Seems to be linked to /lib/commons ... but in theory, I have change it .... I'll retry...


Ok I found ...
On 8.0-beta, /lib/commons was /opt/sq/lib/common, now it's /opt/sonarqube/lib/common ... works really better now ... thank you

@mc1arke mc1arke force-pushed the sq-8_2-support branch 2 times, most recently from e0df748 to e7219c4 Compare May 17, 2020 17:58
@Baiskey
Copy link

Baiskey commented May 19, 2020

It seems that some merge conflicts appeared. What's more, can I ask someone to make a review for this PR?

@hydezhao
Copy link

hydezhao commented Jun 1, 2020

I am testing sq-8_2-support on a sonarqube 8.2, everything works pretty well except i cannot find where to configure the patterns of long-term branch.

Should it suppose to be under General ?

@mc1arke
Copy link
Owner Author

mc1arke commented Jun 1, 2020

@hydezhao there's no longer the concept of short or long term branch. All branches are baselined against the main branch (i.e. master). You can manage how long branches are retained for though: https://docs.sonarqube.org/latest/branches/overview/#header-3

@mc1arke mc1arke force-pushed the sq-8_2-support branch 2 times, most recently from ca7c16f to fb5af34 Compare June 7, 2020 14:24
@sonarcloud
Copy link

sonarcloud bot commented Jun 7, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@teuno
Copy link

teuno commented Jul 6, 2020

Is only the review needed, or something else too?

@sergiocoronel
Copy link

Do you have an estimation on when it will be reviewed?

@ksl67
Copy link
Contributor

ksl67 commented Jul 12, 2020

Will it include support for Bitbucket Cloud Code Insights?

Sonarqube 8.2 introduced a new `ProjectDto` with associated changes in `ProjectAlmSettingsDao` to require this new class in various methods, as well as changes in `ComponentFinder` to allow retrieval of instances of a project. This change makes use of these new classes and methods to allow the Web Services for setting up ALM bindings to operate.

As this class and the associated methods did not exist in previous versions of Sonarqube, this change breaks backwards compatibility, so means the plugin will now only support Sonarqube 8.2.

Sonarqube 8.2 also provides the ability to set the optional URL parameter on a Gitlab project so that scans run outside of Gitlab CI operate properly, so the additional parameter is now included in the appropriate WebServices and the Gitlab decorator.
@sonarcloud
Copy link

sonarcloud bot commented Jul 17, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@mc1arke mc1arke merged commit f624269 into master Jul 17, 2020
@mc1arke mc1arke deleted the sq-8_2-support branch July 17, 2020 21:10
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.