Affects Version/s: None
Fix Version/s: 8.7
The goal will be to remove the concept of organizations in SonarQube's code base.
Organizations are already not in use, but we work around a "default organization".
The work can be split in several areas, as independent as possible, between this ticket and
We no longer need to check for user membership in an organization. Checking for permissions will only depend on the permission key, not on an organization.
Update: AbstractUserSession, ServerUserSession and other implementations
User registration: update UserUpdater and UserRegistrarImpl
- A lot of WS are impacted, since most WS check user permissions and memberships using organization. All that will have to be cleaned up once UserSessions are changed.
- Tables 'groups', 'group_roles', 'permission_templates', 'users', and 'user_roles': Remove column 'organization_uuid'.
- 'Name' in the table 'groups' can now be unique
- Update AuthorizationDao, UserPermissiondao, GroupPermissionDao, PermissionTemplateDao
- api/components/suggestions endpoint, organization need to be removed from the result
- Tables 'components' and 'projects': drop column 'organization'
- all references to components.organization_uuid, like in LiveMeasureMapper.xml
- A lot of utility classes will be impacted, like ComponentDbTester and ComponentTesting. We'll have to refactor all methods using orgs.
- All WS under organizations/ and helper classes can be removed
- The following tables and all associated classes can be removed: 'organizations', 'organization_members' and 'organization_alm_bindings'**
- I'm not even sure if 'organization_alm_bindings' is used at all
- To me it's not: its used for example to synchronize membership when the feature is enabled at org level, which should never happen on SQ, so that's dead code. (MemberUpdater.java:113)
- Storing the default organization in the AnalysisMetadata and PostProjectAnalysisTask and injecting the object DefaultOrganization in several steps is no longer needed.
- A startup task should be added in order to check that only the default organization exists in DB, and fail if it's not the case.
OrganizationWebhookHandler.java can be deleted, with related tests and package
- Table 'webhooks': Remove column 'organization_uuid'.
- Issue assignment should not depend anymore on user organization membership
- admin account recovery SQL query will not include organization anymore
- Remove reference from https://docs.sonarqube.org/latest/project-administration/webhooks/
Everything related to OrganizationTester.java must be removed. it's used in 195 places, including:
- branch.it.suite (11)
- it-code.test (182)
- authorization (4)
- ce (8)
- issue (22)
- organization (58)
- project (18)
- qualityGate (9)
- qualityProfile (49)
- rule (10)
- user (3)
- webhook (1)
com.sonarsource.it.Tester need to be cleaned up, removing organizations().enableSupport() and deleteOrganizations()
DbTester.getDefaultOrganization() is used 1419 times, mainly in webserver-web-api.test package. Usage is spread amongst component, favorite, issue, measure, metric, org, permission, project, qg, qp, rule, setting, users, webhook. Basically every SQ domains.