feat: add configurable global UI banner visibility setting - #3435
feat: add configurable global UI banner visibility setting#3435lucas4790 wants to merge 1 commit into
Conversation
0e73bcf to
850bd1f
Compare
| .subCategory(CoreProperties.SUBCATEGORY_LOOKNFEEL) | ||
| .type(SINGLE_SELECT_LIST) | ||
| .options("ALL", "ADMINS_ONLY", "DISABLED") | ||
| .defaultValue("ADMINS_ONLY") |
There was a problem hiding this comment.
⚠️ Bug: Default value contradicts PR description
The PR description states that ALL is the default behaviour ("ALL (default) — All logged-in users see update/upgrade banners"), but the code at line 159 sets .defaultValue("ADMINS_ONLY"). The test also asserts ADMINS_ONLY as the default, so the implementation is internally consistent — but one of the two (docs vs code) is wrong.
If the intended default is ALL (preserving current behaviour for existing instances), the code and test need updating. If ADMINS_ONLY is intentional, update the PR description table to avoid confusion during review and for future readers.
If the intent is to preserve current behaviour (all users see banners) and let admins opt in to restricting visibility, change the default to ALL.:
.defaultValue("ALL")
Was this helpful? React with 👍 / 👎
850bd1f to
3de15a1
Compare
Add a new property sonar.ui.banners.visibility that controls who sees global update/upgrade notification banners in the UI. - ALL (default): all logged-in users see banners - ADMINS_ONLY: only users with global Admin permission see banners - DISABLED: no users see banners The property is registered in CorePropertyDefinitions and exposed via the api/navigation/global endpoint through GlobalAction. Provides unit test in CorePropertyDefinitionsTest.
|
Both findings from gitar-bot have been addressed in the latest commit:
|
|
gitar review |
|
gitar unblock |
|
Thanks @lucas4790 for this contribution. I will keep you posted. Plus this change cannot move forward on its own without the changes on the webapp side. |
|
This was discussed with PM and it is not a feature we want to introduce in the product. Best regards, |
Code Review
|
| Auto-apply | Compact | Unblock |
|
|
|
Was this helpful? React with 👍 / 👎 | Gitar
What problem are you trying to fix?
Administrators have no way to control who sees global update/upgrade notification banners. This adds a configurable property to give admins that control.
What improvement are you trying to make?
Adds a new property
sonar.ui.banners.visibility(Administration > General > Look & Feel) that controls who sees global update/upgrade notification banners.ADMINS_ONLY(default)ALLDISABLEDChecklist
CorePropertyDefinitionsTestCorePropertyDefinitions.javaFiles changed
sonar-core/src/main/java/org/sonar/core/config/CorePropertyDefinitions.java— registers the property definition with options and default valueserver/sonar-webserver-webapi/src/main/java/org/sonar/server/ui/ws/GlobalAction.java— adds the key toDYNAMIC_SETTING_KEYSso it is served viaapi/navigation/globalsonar-core/src/test/java/org/sonar/core/config/CorePropertyDefinitionsTest.java— verifies the property is registered with the correct options and default