I am trying to develop a plugin by referring the sonarqube plugin development documentation and the sample plugin for sonarqube 10.1. I noticed that some pages on UI keeps on refreshing. Following is one example for that. I wanted to know if the refreshing can be disabled/paused for those screens.
Steps to reproduce:
- Extract zip of Sonarqube 10.1.0.73491
- Extract and build sonar-custom-plugin-example-10.x.zip
- Copy sonar-example-plugin-10.0.0.jar in sonarqube-10.1.0.73491\extensions\plugins directory
- Start sonar by running sonarqube-10.1.0.73491\bin\windows-x86-64\StartSonar.bat
- Login to sonarqube and create a project with key test_10_1_11 (do not start scan yet)
- Click on menu item More–>Project Page Using Backbone JS
- Observe the screen keeps on refreshing
I can reproduce this, so I’ll ping the right team. Thanks for the report.
Kindly let me know if there are any tentative timelines for the fix to be available.
Thank you for the report. It turned out that our Backbone example is broken now. It happened due to CSP (Content Security Policy) with the
script-src directive set to
self to restrict inline scripts and eval expressions. The change was done in 10.0.
Because of that, plugins can no longer include inline scripts.
We plan to rewrite the Backbone plugin example to something that is not that old. We do not have an exact plan for when we will do it.
For now, feel free to rewrite the plugin under
sonar-custom-plugin-example/src/main/js/project_page to anything that makes sense to you. For inspiration, you can check how other plugins are done - for example,
src/js/portfolio_page is written via React, and
src/js/global_page is written via Vanilla JS.