Incremental PR scans for gosu language

Sonar Qube: 9.9.6 (Enterprise edition)
Plugins:
Community Gosu Plugin:1.2.2
sonarqube-gradle-plugin:4.4.1.3373

PR scanning works fine but it is not incremental, it scans the entire repo every time. How does the incremental scan work with the Gosu Plugin, Is it a plugin’s responsibility for any caching? Any documentation that I should be referring to for this issue?

Hey there.

It is the plugin’s responsibility to manage the cache.

I don’t think we’ve had many (any?) community plugins implement caching. You can probably draw some inspirations from the implementation on the Kotlin or Javascript/Typescript analyzers.

Just to double check, caching is required for the incremental scans to work, correct?

Yes, exactly.

Thank you !!

@Colin - I’m currently working on implementing caching to avoid full scans. I’ve managed to use the readCache and writeCache functions of the plugin API, but I’m not sure how to handle reporting of issues to SonarQube. When I initially scan a file, it reports 10 issues in SonarQube. For subsequent scans, I want to read from the cache. Do I need to store the issues in the cache and then open the same issues as new ones? Essentially, how should I handle reporting issues in incremental scans? Any documentation or help would be appreciated.

Currently for the second scan, if I do not report any issue, 10 issues found in the previous scans are marked as fixed in Sonar Qube.

Hello! Any help or documentation will be appreciated

Hey @koolhuman

This is a pretty advanced plugin dev topic and we don’t have any public documentation outside of here. Again, the best place I can refer you to is examples of implementation in other plugins.

I’ll ping some experts to see if there’s any resources I’m missing.