I’m currently working on a plugin which would check some diff between two JSONs.
The implementation would do the following:
Load old version
Load new version
Do some diff calculation
Running the scanner would allow to access the new version but what about the old one? How can I access that data? Is there some persistent store in SonarQube which could be used for this purpose?
Actually the JSON is released into JAR artifacts so it’s possible to do some LATEST version downloading from Nexus/Artifactory but obviously that would mean that SonarQube have a coupling with the Maven2 repository.
Isn’t there any way to store a copy into the database with the custom plugin I’m trying to create? I’ve read somewhere that from 7.1, it’s not even possible to access the DB.
Isn’t there any extension point for handling custom database tables?
There is no way for you to create or access (if you created them manually) custom tables. What you can do is store metrics, but the longer I think about using that to accomplish your goal, the more it seems like it would quickly lead to a hot mess. You should really consider some other way to accomplish this. Off-hand I’d say you should look into some other process that would check out the previous version, run your diff and prepare a report that your custom plugin would read and store as either metrics or issues (if you just have to get whatever it is you’re after into SonarQube).
Thank you very much for the help, at least you could confirm that it’s not really possible.
Just out of curiosity, why isn’t there a way to handle custom tables in Sonar plugins?