-
-
Notifications
You must be signed in to change notification settings - Fork 530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Project level new code setting won't save #272
Comments
@thefang12 I also had this issue but If you notice while making changes, it says this setting will apply after your next scan. So after making the change and running another analysis it worked. |
I also have the issue. |
@anand-ispg when you change the setting in the UI it retroactively changes any branch that has already been scanned to the new_code_period that why it works on next scan, the issue is for any new branches it still uses the global new_code_period not the one set at a project level. |
@thefang12 Thank you, I insert a new row manually and it works. |
@thefang12. Thanks for workaround. |
@Dr-Dream can you confirm the exact steps your taking here? I presume this is updates to values in the database you're making, so it would be useful to know which tables and columns you're altering, and example of their pre and post change values are |
@mc1arke , As it works for me. As i understood, according to what i saw during changes in new_code_periods through UI - project_uuid and branch_uuid have same value. So when you change project settings from default in UI - new record in new_code_periods record filled project_uuid and branch_uuid with same uuid value. So if branch_uuid is set, setting reffers to master branch only. Actually, currently, there is no way to change this settings at project level through UI. If barnch_uuid is null, it counted as project settings. After that, i've changed through UI settings exactly for master branch, because it should differs from project one (should not reffer itself). After that all new analisys for new branches done against master. I hope it will helps. One more note. There is no unique constraints on table, so accidentally you could make two or more settings at project level. That will be followed by errors and you'll be not able to get project level settings of new code in UI at all. |
I'm running into this as well with the new SonarQube 8.9 LTS version and 1.8.0 version of the plugin. |
The New Code Period webservices contain logic that specifically sets the target branch UUID to the main branch of the project if the Community version of Sonarqube is being used, thereby overriding the branch name that's been saved in the new code period's value. The existing Java Agent functionality has been extended to alter the constructors of the relevant New Code services so they override the bundled Edition Provider that specifies the current platform edition as being Community edition, and instead injects a provider that overrides the current distribution as Developer edition, thereby causing the webservice logic to skip applying defaults for branch values.
The New Code Period webservices contain logic that specifically sets the target branch UUID to the main branch of the project if the Community version of Sonarqube is being used, thereby overriding the branch name that's been saved in the new code period's value. The existing Java Agent functionality has been extended to alter the constructors of the relevant New Code services so they override the bundled Edition Provider that specifies the current platform edition as being Community edition, and instead injects a provider that overrides the current distribution as Developer edition, thereby causing the webservice logic to skip applying defaults for branch values.
The New Code Period webservices contain logic that specifically sets the target branch UUID to the main branch of the project if the Community version of Sonarqube is being used, thereby overriding the branch name that's been saved in the new code period's value. The existing Java Agent functionality has been extended to alter the constructors of the relevant New Code services so they override the bundled Edition Provider that specifies the current platform edition as being Community edition, and instead injects a provider that overrides the current distribution as Developer edition, thereby causing the webservice logic to skip applying defaults for branch values.
The New Code Period webservices contain logic that specifically sets the target branch UUID to the main branch of the project if the Community version of Sonarqube is being used, thereby overriding the branch name that's been saved in the new code period's value. The existing Java Agent functionality has been extended to alter the constructors of the relevant New Code services so they override the bundled Edition Provider that specifies the current platform edition as being Community edition, and instead injects a provider that overrides the current distribution as Developer edition, thereby causing the webservice logic to skip applying defaults for branch values.
when it will be released? |
Looking forward to release as well :) |
It's a miracle we need - the miracle |
Released in v1.9.0 of the plugin. |
@mc1arke Any chance that this can get backported to version 1.8.0 of the plugin? |
Yes! I was giving it a couple of days between the 1.9.0 release and performing any back-porting to make sure no-one reported any major issues. I'll be looking to back-port all the 1.9.0 functional changes other than the commit for supporting Sonarqube 9.0. I'll hopefully get a 1.8.1 release of the plugin out toward the end of this week. |
This is awesome. Thanks for your effort, it's much appreciated! |
The New Code Period webservices contain logic that specifically sets the target branch UUID to the main branch of the project if the Community version of Sonarqube is being used, thereby overriding the branch name that's been saved in the new code period's value. The existing Java Agent functionality has been extended to alter the constructors of the relevant New Code services so they override the bundled Edition Provider that specifies the current platform edition as being Community edition, and instead injects a provider that overrides the current distribution as Developer edition, thereby causing the webservice logic to skip applying defaults for branch values. (cherry picked from commit 6f589e6)
Backported to 1.8.1 of the plugin for Sonarqube 8.9 support. |
Describe the bug
Setting new_code_period at the project level doesn't work at all.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Project new_code_period is persisted once changed from the global default.
Screenshots
If applicable, add screenshots to help explain your problem.
Setting new_code_period:
After reload:
Software Versions
Additional Comments
The feature works correctly at global and branch levels.
Tried setting it using the UI and the web API and both return a 200 without persisitiing the new_code_period change. The only workaround I've found is to insert the new_code_period record in the new_code_periods table manually 😞 .
The text was updated successfully, but these errors were encountered: