Cannot activate rules in Quality Profiles

When logged in as the administrator, there is no tool bar with “Bulk Change” in rules list. When click into any inactive rule, there is no “activate” button near the Quality Profiles title neither.

SonarQube version: 7.1

Hi,

Could you make sure that the administrator user or its group has the “Administer Quality Profiles” permission?

Yes. Now I upgraded to 7.2.1 version, but the problem still exists.
However, in the old version 5.6.4 I can find the activate option.

Could you open the https://<your sonarqube url>/api/rules/app and tell me if canWrite flag is set to "true"?

Yes, it is true.
{“canWrite”:true,“languages”:{“cs”:“C#”,“py”:“Python”,“java”:“Java”,“flex”:“Flex”,“xml”:“XML”,“php”:“PHP”,“ts”:“TypeScript”,“js”:“JavaScript”},“repositories”:[{“key”:“Pylint”,“name”:“Pylint”,“language”:“py”},{“key”:“android-lint”,“name”:“Android Lint”,“language”:“java”},{“key”:“common-cs”,“name”:“Common C#”,“language”:“cs”},{“key”:“common-flex”,“name”:“Common Flex”,“language”:“flex”},{“key”:“common-java”,“name”:“Common Java”,“language”:“java”},{“key”:“common-js”,“name”:“Common JavaScript”,“language”:“js”},{“key”:“common-php”,“name”:“Common PHP”,“language”:“php”},{“key”:“common-py”,“name”:“Common Python”,“language”:“py”},{“key”:“common-ts”,“name”:“Common TypeScript”,“language”:“ts”},{“key”:“common-xml”,“name”:“Common XML”,“language”:“xml”},{“key”:“csharpsquid”,“name”:“SonarAnalyzer”,“language”:“cs”},{“key”:“flex”,“name”:“SonarAnalyzer”,“language”:“flex”},{“key”:“javascript”,“name”:“SonarAnalyzer”,“language”:“js”},{“key”:“php”,“name”:“SonarAnalyzer”,“language”:“php”},{“key”:“python”,“name”:“SonarAnalyzer”,“language”:“py”},{“key”:“squid”,“name”:“SonarAnalyzer”,“language”:“java”},{“key”:“typescript”,“name”:“SonarAnalyzer”,“language”:“ts”},{“key”:“xml”,“name”:“SonarAnalyzer”,“language”:“xml”}]}

And could also copy the response of /api/qualityprofiles/search please? I’m mainly interested in the actions property of each profile.

{“profiles”:[{“key”:“AWRuuXrUy_CcL1bNs9Yj”,“name”:“Sonar way”,“language”:“cs”,“languageName”:“C#”,“isInherited”:false,“isDefault”:true,“activeRuleCount”:198,“activeDeprecatedRuleCount”:0,“rulesUpdatedAt”:“2018-07-06T08:33:26+0000”,“organization”:“default-organization”,“isBuiltIn”:true,“actions”:{“edit”:false,“setAsDefault”:false,“copy”:true,“associateProjects”:false,“delete”:false}},{“key”:“AWRuuXymy_CcL1bNs9lx”,“name”:“Sonar way”,“language”:“flex”,“languageName”:“Flex”,“isInherited”:false,“isDefault”:true,“activeRuleCount”:46,“activeDeprecatedRuleCount”:0,“rulesUpdatedAt”:“2018-07-06T08:33:27+0000”,“organization”:“default-organization”,“isBuiltIn”:true,“actions”:{“edit”:false,“setAsDefault”:false,“copy”:true,“associateProjects”:false,“delete”:false}},{“key”:“AWRu0Pv7-2-L20Vd-_Xa”,“name”:“Android Lint”,“language”:“java”,“languageName”:“Java”,“isInherited”:false,“isDefault”:true,“activeRuleCount”:147,“activeDeprecatedRuleCount”:0,“rulesUpdatedAt”:“2018-07-06T08:59:07+0000”,“organization”:“default-organization”,“isBuiltIn”:true,“actions”:{“edit”:false,“setAsDefault”:false,“copy”:true,“associateProjects”:false,“delete”:false}},{“key”:“AWRuuXvry_CcL1bNs9gW”,“name”:“Sonar way”,“language”:“java”,“languageName”:“Java”,“isInherited”:false,“isDefault”:false,“activeRuleCount”:299,“activeDeprecatedRuleCount”:0,“projectCount”:0,“rulesUpdatedAt”:“2018-07-06T08:33:26+0000”,“organization”:“default-organization”,“isBuiltIn”:true,“actions”:{“edit”:false,“setAsDefault”:true,“copy”:true,“associateProjects”:true,“delete”:false}},{“key”:“AWRuuX3vy_CcL1bNs9r3”,“name”:“Sonar way”,“language”:“js”,“languageName”:“JavaScript”,“isInherited”:false,“isDefault”:true,“activeRuleCount”:86,“activeDeprecatedRuleCount”:0,“rulesUpdatedAt”:“2018-07-06T08:33:27+0000”,“organization”:“default-organization”,“isBuiltIn”:true,“actions”:{“edit”:false,“setAsDefault”:false,“copy”:true,“associateProjects”:false,“delete”:false}},{“key”:“AWRuuX01y_CcL1bNs9oi”,“name”:“Sonar way Recommended”,“language”:“js”,“languageName”:“JavaScript”,“isInherited”:false,“isDefault”:false,“activeRuleCount”:125,“activeDeprecatedRuleCount”:0,“projectCount”:0,“rulesUpdatedAt”:“2018-07-06T08:33:27+0000”,“organization”:“default-organization”,“isBuiltIn”:true,“actions”:{“edit”:false,“setAsDefault”:true,“copy”:true,“associateProjects”:true,“delete”:false}},{“key”:“AWRuuX9Gy_CcL1bNs9wj”,“name”:“Drupal”,“language”:“php”,“languageName”:“PHP”,“isInherited”:false,“isDefault”:false,“activeRuleCount”:20,“activeDeprecatedRuleCount”:0,“projectCount”:0,“rulesUpdatedAt”:“2018-07-06T08:33:27+0000”,“organization”:“default-organization”,“isBuiltIn”:true,“actions”:{“edit”:false,“setAsDefault”:true,“copy”:true,“associateProjects”:true,“delete”:false}},{“key”:“AWRuuX73y_CcL1bNs9v5”,“name”:“PSR-2”,“language”:“php”,“languageName”:“PHP”,“isInherited”:false,“isDefault”:false,“activeRuleCount”:20,“activeDeprecatedRuleCount”:0,“projectCount”:0,“rulesUpdatedAt”:“2018-07-06T08:33:27+0000”,“organization”:“default-organization”,“isBuiltIn”:true,“actions”:{“edit”:false,“setAsDefault”:true,“copy”:true,“associateProjects”:true,“delete”:false}},{“key”:“AWRuuX5-y_CcL1bNs9uZ”,“name”:“Sonar way”,“language”:“php”,“languageName”:“PHP”,“isInherited”:false,“isDefault”:true,“activeRuleCount”:74,“activeDeprecatedRuleCount”:0,“rulesUpdatedAt”:“2018-07-06T08:33:27+0000”,“organization”:“default-organization”,“isBuiltIn”:true,“actions”:{“edit”:false,“setAsDefault”:false,“copy”:true,“associateProjects”:false,“delete”:false}},{“key”:“AWRuuX-Ty_CcL1bNs9xZ”,“name”:“Sonar way”,“language”:“py”,“languageName”:“Python”,“isInherited”:false,“isDefault”:true,“activeRuleCount”:32,“activeDeprecatedRuleCount”:0,“rulesUpdatedAt”:“2018-07-06T08:33:27+0000”,“organization”:“default-organization”,“isBuiltIn”:true,“actions”:{“edit”:false,“setAsDefault”:false,“copy”:true,“associateProjects”:false,“delete”:false}},{“key”:“AWRuuYAgy_CcL1bNs9yq”,“name”:“Sonar way”,“language”:“ts”,“languageName”:“TypeScript”,“isInherited”:false,“isDefault”:true,“activeRuleCount”:47,“activeDeprecatedRuleCount”:0,“rulesUpdatedAt”:“2018-07-06T08:33:28+0000”,“organization”:“default-organization”,“isBuiltIn”:true,“actions”:{“edit”:false,“setAsDefault”:false,“copy”:true,“associateProjects”:false,“delete”:false}},{“key”:“AWRuuYFSy_CcL1bNs902”,“name”:“Sonar way recommended”,“language”:“ts”,“languageName”:“TypeScript”,“isInherited”:false,“isDefault”:false,“activeRuleCount”:91,“activeDeprecatedRuleCount”:0,“projectCount”:0,“rulesUpdatedAt”:“2018-07-06T08:33:28+0000”,“organization”:“default-organization”,“isBuiltIn”:true,“actions”:{“edit”:false,“setAsDefault”:true,“copy”:true,“associateProjects”:true,“delete”:false}},{“key”:“AWRuuXzwy_CcL1bNs9mi”,“name”:“Sonar way”,“language”:“xml”,“languageName”:“XML”,“isInherited”:false,“isDefault”:true,“activeRuleCount”:1,“activeDeprecatedRuleCount”:0,“rulesUpdatedAt”:“2018-07-06T08:33:27+0000”,“organization”:“default-organization”,“isBuiltIn”:true,“actions”:{“edit”:false,“setAsDefault”:false,“copy”:true,“associateProjects”:false,“delete”:false}}],“actions”:{“create”:true}}

You have only built-in quality profiles. You can’t change them, they are updated automatically with new version. As you can not change any of the profiles, the activate buttons are hidden in the interface. As soon as you create a profile, you’ll be able to activate rules in it.

You can read more in the docs: https://docs.sonarqube.org/display/SONAR/Quality+Profiles

1 Like

I found the options after copying the profile. Thank you Stas!