SonarQube TFVC Plugin with VSTS - sonarqube

is it possible to make the TFVC Plugin of SonarQube work with VSTS?
If I want to use the Plugin to connect with the TFVC of our VSTS-Account I get a not authorized exception. I'm pretty sure that the credentials are correct. Or Are there any special rights which are needed for that?
19:54:37.632 ERROR - Unable to TFS annotate the project which raised the following authentication exception: TF30063: You are not authorized to access xxx.visualstudio.com\DefaultCollection.
the configuration seems all correct, because the plugin works with a TFS2015-Server without any issues.
I'm Testing the plugin localy with the sonar Scanner V1.1.
SonarQube Version 5.2, TFVC Plugin Version 2.1
Thank you for your help!

Apparently this scenario is not supported yet. I ran into the same problem and I found the following issue on the backlog of the SonarQube team:
With the current TFVC Annotate plugin code author information is not seen for VSO hosted builds, this MMF is to enable the same.
You can find this information on: https://jira.sonarsource.com/browse/MMF-85
So until they fixed it I fear you'll need to disable this plugin...

Related

Not able to setup BitBucket ALM with SonarQube

I am currently on SonarQube Community Edition and I am trying to Integrate SonarQube with BitBucket. I have created an OAuth Consumer in my BitBucket Account and when I try to add it in SonarQube's BitBucket Cloud I am getting an error which is not properly complete I Guess (Unknown url : /api/alm_settings/create_bitbu... )
I don't know what I am doing wrong or if SonarQube Community Edition doesn't allow me to integrate BitBucket ALM. I am attaching a screenshot of the same
Cheers,
As it turns out, I have solved this issue and am posting the solution for whoever needs it.
It just so happens that this was an issue with the version of SonarQube I had. I updated SonarQube to the latest version(v9.6.1) and that resolved my issue.
Cheers,

Pull request build is not showing issues in SonarQube

I have a PR analysis done on a project in Azure pipeline and the analysis doesnt show up any issues in sonarUI for the code.
But when the PR is merged in to the branch and analysis is performed then the issues are generated for the same piece of code.
using SonarQube 8.5
Could someone explain the reason??
What type of Azure DevOps are you using? The cloud offering, Azure DevOps Services (VSTS)? Or the on-premises offering, Azure DevOps Server (TFS)?
According to the introduction from the docs about Pull Request Analysis in SonarQube, it seems that Azure DevOps Services is not supported for Pull Request Analysis in SonarQube.
If you are using Azure DevOps Services, you can try the method below to see if it can work:
Install a Self-hosted agent on the machine your SonarQube server is hosting. And use this agent to run your pipeline. Before analyzing your Pull Requests, make sure the Pull Request branch is checked out.
[UPDATE]
According to your comments,
I have a PR analysis done on a project in Azure pipeline and the analysis doesnt show up any issues in sonarUI for the code. But when the PR is merged in to the branch and analysis is performed then the issues are generated for the same piece of code.
The PR build and the CI build have the same configuration, and the only difference is the trigger type. Due to the CI build can work as expected, the configuration you set in the Azure pipeline should be correct.
I see this happenning intermittently...previously with 8.0 version this issue never happened..after the upgradation to 8.5..I can see this issue happening
You can try the build pipeline with version 8.0 to see if it still works as expected. And compare the output logs in the build pipeline between version 8.0 and 8.5.
If it works fine on version 8.0, it means the Azure pipeline can work normally, and the issue should occur on the version 8.5 itself. If so, I recommend that you can open a topic on the SonarSource Community to get more help.

PL/SQL plugin not working in SonarQube

I want to use SonarQube for PL/SQL. I downloaded the plugin from the SonarQube Site and placed it into $SONARQUBE_HOME/extensions/plugins. Then I restarted the SonarQube Server but it didn't start up. When I removed the plugin it was working.
How can I resolve this issue?
The PL/SQL language is supported as part of the SonarSource Developer Edition, which is a commercial package for which you need a license.
This is why if you install it manually, this will not work.

SonarQube ecosystem upgrades (SonarQube and SonarLint)

We are using SonarQube 5.1 and want to upgrade to SonarQubee 5.2 or 5.3 due to some issues around issue assign area of SonarQube 5.1
We are also using SonarQube eclipse plugin 3.5.0
I noticed recently that SonarQube eclipse plugin 3.5.0 is not supported with SonarQube 5.2 as per http://docs.sonarqube.org/display/SONAR/SonarQube+in+Eclipse.
Also latest SonarLint release 1.2 cannot connect to remote Sonar Instance to fetch server rules. This feature was available with SonarQube eclipse plugin 3.5.0.
I found on Stackoverflow that SonarLint would support this feature with release 2.0 but there is no planned release date for 2.0
Getting remote config file for SonarLint if online, using local if offline
My question is why SonarQube ecosystem upgrades are not synchronised?
SonarQube eclipse plugin should support latest SonarQube releases until SonarLint is capable to connect to remote Sonar instance to fetch server rules.
How anyone who are supposed to take SonarQube upgrades to resolve problems with existing version could execute eclipse analysis?
As you have read, the SonarQube Eclipse plugin has been deprecated in favor of SonarLint for Eclipse. One of the main reasons behind this is that SonarLint for Eclipse is designed to be an independant product which lifecycle must be decoupled from SonarQube - in order to ease and speed up innovation on the user experience in the IDE. So by now, SonarQube and SonarLint upgrades are not synchronized by definition.
Still, your question is perfectly valid: why don't we make some last updates on the SQ Eclipse plugin as long as SonarLint is not able to connect to a SonarQube server? The main reason is that we believe so much in SonarLint that we want to focus all our attention and energy on that product, and therefore we want to move fast to be able to have the "connected-to-SonarQube" experience as soon as possible. Our telemetry tells us that most existing users and customers are currently using a SonarQube version that is still usable with the SQ Eclipse plugin, so I feel this is the right decision to work as fast as possible on SonarLint to make sure it can connect to a SonarQube instance in the upcoming months (when the next LTS is released).
The following combination works fine
(SonarLint + SonarScanner + SonarQube + Eclipse):
SonarLint: 3.5.0.201804241315
sonarScanner: sonar-scanner-3.2.0.1227-windows
SonarQube: 6.7.4 (build 38452)
sonar-scanner.properties:
sonar.host.url=http://localhost:9000
sonar.sourceEncoding=UTF-8
sonar.projectKey=JavaProject
sonar.projectName=MyJavaStandaloneProject
sonar.projectVersion=0.0.1-SNAPSHOT
sonar.sources=D:/eclipse/workspace/MyJavaStandaloneProject
sonar.java.binaries=D:/eclipse/workspace/MyJavaStandaloneProject/target/classes
pom.xml:
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.2</version>
</plugin>
</plugins>
</build>
Bind Eclipse projects to SonarQube projects:
Select a SonarQube server: localhost
Eclipse Project: MyJavaStandaloneProject
SonarQube Project: 'MyJavaProject' on server localhost
Click: Auto bind selected projects.
"Note: SonarQube Project: 'MyJavaProject' on server localhost
can be auto configured by clicking Auto bind button."
All configurations done.
Right click project and Run As Maven build ...
Goal: sonar:sonar
[INFO] ANALYSIS SUCCESSFUL

Sonar eclipse plugin needs sonar server installed

Is Sonar eclipse plugin needs a valid sonar server installed locally or remotely to do the quality profiles in eclipse.
Thanks,
cabear
As per the "Configuring SonarQube in Eclipse" documentation page, you can see that this is indeed required to have a SonarQube server installed somewhere.
If your project is not already under analysis, you'll need to declare
it through the SonarQube web interface.
Once your project exists in SonarQube, you're ready to get started
with SonarQube in Eclipse.

Resources