Is it possible to freeze a version in SonarQube's time machine and make this snapshot always visible in the history chart? For example I have tagged a version in Git as v1.0 and I want this to be always in the chart so I can compare it with the latest versions and track the progress. Is the only way to launch Sonar Maven each time on this version?
Asked
Active
Viewed 144 times
1
1 Answers
4
It is possible to set a version on SonarQube snapshot. You can then use this version in the differential period including the leak period.
Note also that adding an event to a snapshot prevent the snapshot to get deleted from the history. Find more information about this in History and Events documentation.
You can set a version to a snapshot from SonarQube UI in the history of project's analyses (project administration permission is required).

Jean-Denis Coffre
- 158
- 6
-
But how to assign a version to snapshot? Its under which option? – Priyang May 03 '16 at 14:09
-
Log as a project administrator. Then go in {{Administration}} > {{History}}. Finally, on column "Versions" of the relevant snapshot click on "create" (or "update" if you want to modify existing one). – Jean-Denis Coffre May 03 '16 at 14:29
-
Can we assign version from history using "web Api" , I have around 40 projects and I want to assign versions to all? – Priyang May 03 '16 at 14:35
-
Yes it is. Here is the documentation of '/api/event': http://docs.sonarqube.org/pages/viewpage.action?pageId=2392183#WebService/api/events-Createaneventonaproject – Jean-Denis Coffre May 03 '16 at 15:44
-
Thanks a lot. The "differential period link is not working". – highlander May 06 '16 at 09:38
-
I am using web api but over there I cant find a way to assign versions to project. I am using sonarqube version 5.3. For reference https://nemo.sonarqube.org/web_api – Priyang May 18 '16 at 13:17
-
Agree with you the API is not really clear on that. What you should know is that for a SonarQube project history a version is an event. It means that adding a version to a project analysis means adding an event to a snapshot. Find the related documentation [here](http://docs.sonarqube.org/pages/viewpage.action?pageId=2392183#WebService/api/events-Createaneventonaproject) – Jean-Denis Coffre May 20 '16 at 15:24