Accidentally changed the underlying branch for a sonar project and ran the analysis and now after reverting the to original branch, all the issues marked as wont fix are again show on the dashboard. Is there any option available in sonarqube to the previous state of the project which was working fine or any possible solution to restore the quality profile.
Unfortunately, there is no way to restore the previous state. SonarQube allows to delete analysis result (Activity tab in 7.1), but all except the last. It means that you can fix statistics by removing accidental analysis, but you must fix issues statuses manually.
Related
We are having an issue with SonarQube analysis where known issues are failing the quality gate. This is an existing code base, after initial analysis, existing issues should remain as is and new code is analyzed. Thus if a developer checks in code, I would expect only new changes are analyzed and scanned. However, SonarQube is detecting both new changes and existing changes as issues during the leak period.
How does Sonar determine the differences between current and previous for the leak period? Is it purely analyzing source files or is there something else happening? What could cause existing code to cause a new issue in the leak period? I'm trying to determine how to diagnose and troubleshoot this issue.
Running:
SonarQube 7.1
sonar-scanner-msbuild 4.2.0.1214
TFS 2012
4 TFS 2012 Build Agents
No SCM integration
Edit:
I mostly see these issues in Bugs and Code Smells. The leak period is based on the previous run, versions are not being used. It seems to be more problematic with SonarQube 7.1 than with the previous 6.7. Here is an example flow that happened:
1) Initial Sonar Analyzes/Scan -- All code is green
2) New check-in -- All code is green
3) New check-in, one line change -- all previously "green" items from step 1 are flagged and gate fails
I am triggering a Sonar analysis from Jenkins whenever a user commits any change to any branch of my project. In SonarQube I see the project analysis result, and quality gate status, for the most recently run analysis. It only shows the most recently run analysis for a given project.
How can I see a 'history' of previous analyses that were run prior? Specifically I would like to see the coverage from before and the where in the codebase specific 'critical' issues triggered a quality gate failure. Basically I want a historical snapshot of the 'project overview' page for each time the analysis is run. Since I am triggering the analysis from different branches I need to be able to differentiate an analysis of Branch A vs. a previous analysis of Branch B.
If you use SonarQube up to version 5.6: Use the Sonar Timeline Plugin, which allows you to add a graph to your dashboard.
If you use SonarQube version 6.5 or later (to be released in August 2017): Get feature rich history graphs out of the box (no plugin required)!
It looks like you have to make a custom dashboard and add a history widget. It looks like it shows you just the times the gate changed (which i guess is what I should have expected) for example the project I tested with only changed status 3 times so even though I asked for 10 columns it only showed 3.
This is on the Sonar homepage for your project, not the sonar widget in jenkins fyi
We had an issue recently that caused TeamCity to stop running builds for several hours. The result was a large queue of pending changes. Now this has been resolved, and new changes are going through the pipeline with no problem.
However, the pending changes area still shows 43 pending. All of these changes have been included in subsequent commits, and have therefore been built. Why is TeamCity showing these old commits as pending? And how do I clear the queue?
I've had the same issue and found a way to work around it. Not ideal but worked for me.
Select your project. Click on Edit Configuration Settings. Select Actions and Copy. Create a duplicate copy of your project.
Now go through the process again only delete the old project instead of copying it.
This gives you a new project with the same setup and none of the history or pending items of the old one. Like I said not ideal, but will get rid of the pending items.
I've configured sonarqube server on my local machine to run and I committed the initial project with Analysis mode. Also, I created an ant target for the developers to run in incremental mode to view their new issues. I installed issuesReport on sonar server and using it from the ant file to generate html files.
However, when each developer syncs with svn and runs the ant target, they see violations by other developers under the new issues instead of only their issues.
I expected the sonarqube plugin only scan newly edited file by the developer, but is instead showing all the new files that are introduced by other developers.
To make it work properly I have to run an analysis mode from my machine. However this fixes the problem only for me, my colleagues still see all the violations as new.
How does SonarQube decide if an issue is new or not? If each developer has to run a full analysis every time, this would be big over head. Is there something am I missing?
Thanks in advance for your time and help.
An issue is considered "new" if it does not exist on the analysis server. If you run a full analysis on a CI server on a scheduled basis, it will feed the server with issues and reduce the risk of developers seeing other developer's issues in issues report in preview mode.
Please note, that the sonar documentation says, incremental mode is only for the developers and that too for the code they run against sonar prior to scm (SVN or GIT) commit.
See incremental section on the page: http://www.sonarqube.org/analysis-vs-preview-vs-incremental-preview-in-sonarqube/
The sonar report, when run with incremental mode, will show the developer, how much issue will be generated, if he commits the code. This way developer gets to know, what he can do to keep the sonar issues low. This is the whole purpose of incremental mode.
Hope this answers your question!!!
I have two build configurations- a dev configuration (builds on every checkin), and a QA configuration (builds on-demand, whenever a version for qa is released. We don't do continuous deployment (yet)).
When a version for QA is released, I'd like to be able to know what issues have been resolved since the last version. (format is not important- report / chart / text...),
Meaning- i'd like to know all the issues that have been changed to 'resolved' since the date of the last build in this configuration.
I'm using tfs teamcity issue tracker.
Any ideas?
You probably know already that TC has a "Fixed in Build" value?
I find it tricky to use because if we click 'build' once too often, the list of resolved issues gets all messed up.
Thus I'm also interested in expanding the feature, I just posted;
http://devnet.jetbrains.net/thread/438721
API to access "Fixed in Build" value?