Fixed
Pinned fields
Click on the next to a field label to start pinning.
Details
Assignee
Duarte MenesesDuarte MenesesReporter
Duarte MenesesDuarte MenesesLabels
Edition
CommunityFix versions
Due date
Jan 30, 2023Priority
Normal
Details
Details
Assignee
Duarte Meneses
Duarte MenesesReporter
Duarte Meneses
Duarte MenesesLabels
Edition
Community
Fix versions
Due date
Jan 30, 2023
Priority

Sentry
Sentry
Sentry
Created November 29, 2022 at 6:31 PM
Updated December 3, 2024 at 8:27 AM
Resolved February 3, 2023 at 2:34 PM
Background info
4 years ago we implemented MMF-365 and we dropped the support for modules in the SonarQube server. Due to its complexity, we weren’t able to create DB migrations which would migrate all projects to a structure without modules. Instead, as soon as projects are analyzed, they are migrated to the new structure. Because of that, we had to leave in place code related to modules so that:
We perform the migration when projects are analyzed
Certain webservices can still handle projects that weren’t analyzed yet, and still have the old structure containing modules
Certains parts of the CE project analysis task handles modules to perform, for example, issue tracking
It’s time to drop the support for modules in the SonarQube server.
Any projects that weren’t analyzed and migrated may not work correctly. If they are reanalyzed in versions >10.X, their structure will be corrected but tracking of files and issues will probably not work. Ideally those project should be analyzed with any version between 7.7 and 9.9, before upgrading to 10.X
DB schema
We can drop the following columns in the components table, and associated indexes: ‘module_uuid’, ‘b_module_uuid’, ‘module_uuid_path’, ‘b_module_uuid_path’ and ‘root_uuid’
Changes
DB
In the components table drop columns: module_uuid, module_uuid_path
Scanner
Drop MetadataPublisher.addModulesRelativePaths but keep part that sets builder.setRelativePathFromScmRoot.
Drop property sonar.modules.
CE
Drop ComponentUuidFactoryWithMigration and use ComponentUuidFactoryImpl instead. Make sure that code not related to modules hasn’t evolved differently between both classes.
DB access
Changes (change corresponding queries in mybatis mapper):
Drop ComponentDao.selectEnabledComponentsWithModuleUuidFromProjectKey
Drop ComponentDao.selectEnabledModulesFromProjectKey and corre sponding use in ValidateProjectStep
Drop ComponentDao.selectProjectAndModulesFromProjectKey - its use in ProjectTrackerBaseLazyInput should assume only migrate issues in directories to the root.
Change IssueDao.selectModuleAndDirComponentUuidsOfOpenIssuesForProjectUuid to only select dirs.
Drop ComponentDao.countEnabledModulesByBranchUuid. Its users should either get the branch using BranchDao or create a new method in BranchDao to check if a branch exists.
Drop ComponentDao.selectDescendantModules. IssueAction.keysByUUid should simply use project’s uuid.
WS
Drop handling of modules in ProjectDataLoader.load. Always assume that project does not have modules.
Drop MultiModuleProjectRepository. Drop its use in ProjectAction.
API
Review all uses of Qualifier.MODULES and drop all uses if possible.