-
-
Notifications
You must be signed in to change notification settings - Fork 530
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 sonarqube 10.2 support+ #797
Add sonarqube 10.2 support+ #797
Conversation
Sonarqube 10 has removed legacy support for modules as well as removing deprecated properties historically used for specifying branch targets. Additionally, the interface for managing Sonarqube features has had a method renamed, which makes the new version of Sonarqube binary incompatible with the plugin. The references to Sonarqube's removed code have been removed from the plugin, and the implementations of the interface and Java agent that dynamically updates Sonarqube code that also implements the interface have been updated to use the new method name. As the Sonarqube server binaries are now compiled against Java 17, the build process has been bumped to JDK 17, but continues to produce Java 11 artefacts to allow scanner components to be compatible with the ongoing Java 11 support in the scanner.
based on the branch: feature/sonarqube-10_0-support 1. upgrade sonarqubeVersion to '10.0.0.68432' 2. fixed dbClient.componentDao().insert(DbSession session, ComponentDto item, boolean isMainBranch) 3. fixed UT code
Hello @TheMeinerLP, this MR is still in progress or is already working ? |
Working |
Is there already a downloadable jar file anywhere? |
Need to wait for @mc1arke approval, so GitHub CI starts and build artefact can be downloaded. Or you can of course build it yourself, this is quite straightforward |
Hi all! With mvn -Dsonar.branch.name=test will return: And some more logs: Can anybody approve this or help fix this issue ? =) |
Fixed for me, now testing I fixed this by force set project_uuid to branchDto before insert |
@iSergio you updated a specific file to make it work ? |
Is it possible for you to release a jar in your fork? |
@mc1arke Any plan for when will be released this new version compatible with 10.2? |
https://github.com/iSergio/sonarqube-community-branch-plugin/releases/tag/1.16.1 |
Almost the same problem as @iSergio had... It works well with existing projects but it won't publish a result with a new one. We use Azure Pipeline task and the analysis went without any error but it fails at the publish to SQ server step:
At the server's side:
Unfortunately, @iSergio's fix doesn't help with this issue. Update. |
Maybe i need to check again some stuff here. I can provide via R2 from Cloudflare are jar file for other users. |
I get the same error, and it can be executed normally without adding a key in (10.1+sonarqube-community-branch-plugin 1.15) |
its work for me, thanks! |
anyone tried this snapshot/PR with the latest SonarQube 10.3 already? |
1.16.1-SNAPSHOT is working with 10.3.0.82913 |
Hello, what is this version 1.16.1-SNAPSHOT? can you point to repo/commit? |
I got link from one of the comment threads to @iSergio's Fork |
Are we planning to merge this to have a consolidated version for latest releases ? |
I try to use sonarqube-community-branch-plugin-1.16.0-SNAPSHOT (The file date is 2023/10/20) and SonarQube 10.2.1 to analyze new project. But when I try to click the branch (e.g. http://localhost:9000/dashboard?branch=branch1&id=project1), it's redirected to login page and show And I also try to access a non-existed branch, e.g. http://localhost:9000/dashboard?branch=branch_non_exist&id=project1, and it shows This is my 1st time to use this plugin, I just follow README.md to download .jar and modify And I don't set |
Also experiencing the same problem others addressed when creating new projects. In my case the branch dropdown gets locked, and I can only make analysis to the default branch. Trying new branches throws the below error:
Using the latest SonarQube version available ( |
I am unable to confirm the behavior described by @Pexers. When I start an analysis of a project, the dropdown menu remains grayed out because there is only one branch. However, after initiating an analysis of a second branch, the dropdown menu becomes available as expected. Can anyone else confirm either my or @Pexers's observations? I used the same setup with Sonarqube 10.3.0 and the Snapshot of iSergio. |
From the logs I can see that the analysis was successful, however, when trying to access the report, I get an unauthorized error, even when trying to login with admin. Despite that, I have made a test with a local sonar scanner CLI, and it can indeed make the analysis using different branches. So at the moment I'm a bit confused. 🫠 scanner:
image: sonarsource/sonar-scanner-cli
networks: [ sonar-network ]
volumes:
- ./src:/usr/src
entrypoint: >
/bin/sh -c "
sonar-scanner -Dsonar.login=admin -Dsonar.password=admin -Dsonar.host.url=http://sonarqube:9000 -Dsonar.organization=my-org -Dsonar.projectKey=proj-1 -Dsonar.branch.name=staging-qa -Dsonar.sources=/usr/src
" |
Any plans on making a docker for this version? |
@Pexers, can you try to log in to the index.html of sonarqube to verify that the credentials are correct and then navigate to the project and switch to the newly analyzed branch? |
@rnoberger I've fixed my issue. ProblemSomehow, I've managed to break my SonarQube project, and I couldn't start an analysis for branches called I started by doing a backup & restore of the DB using clean SonarQube & PSQL instances. During the index process, the bellow error was logged:
Meaning that the project for that specific FixI had to access the PSQL instance and run the following query: SELECT * FROM project_branches WHERE project_uuid='<broken_uuid>'; The result of the query showed the DELETE FROM project_branches WHERE project_uuid='<broken_uuid>'; After completing these steps, I was able to create the |
Thanks for that feedback, i will try to fix the issues and analyze it. |
Is there any ETA for this PR to be merged? |
Hey everyone, any updates? |
Does anyone not want to take it over and release it if the repo owner does nothing? |
@Numichi thanks for that hint. I am currently too busy to manage that kind of big project but if someone else has the intention to do that. I am happy to contribute my code there. I do this PR beside my normal company work. I hope I can go further on and fix some issues and do a update |
I can see this behavior if I haven't scanned the master/main branch yet. |
How were you able to deploy it using helm ? the plugin is still not available for 10.x.x, I can see last release was 1.14.0 |
In this comment, you can find the direct link to plugin's jar file - #797 (comment) You can use that link in helm chart under this section -
|
I receive this error with your exact config: helm upgrade --install -n sonarqube sonarqube sonarqube/sonarqube -f values.yaml
|
@maltunok This is not a helm/plugin related issue. It is STS related issue. In your case, ENVs orders are changed (and it is normal). If possible, recreate the STS. |
@hiakki when i delete the env: section and add the following to my values.yaml it sucessfully deploys to kubernetes but this time branch not found error is returned. ` jvmCeOpts: "-javaagent:/opt/sonarqube/extensions/plugins/sonarqube-community-branch-plugin-1.16.1-SNAPSHOT.jar=ce"`
|
I seems worked finally. Thank you community. values.yaml Dockerfile: RUN apk update RUN dotnet sonarscanner begin /k:"xxx" /d:sonar.host.url="$SONAR_URL" /d:sonar.login="$SONAR_TOKEN" /d:sonar.branch.name="$SONAR_BRANCH_NAME"` pipeline:
|
I'm superseding this with #839 since this PR currently has conflicts and doesn't appear to be setting the project UUID properly on branches and pull requests. Thanks for the proposed contribution though! |
Supports following Sonarqube Versions:
Following issues get fixed:
Build from: 20.10.2023
sonarqube-community-branch-plugin-1.16.0-SNAPSHOT.jar.zip