Since issue status sync may be done:
https://github.com/okorach/sonar-tools/blob/593226eb1492c54d1bfa282eb7ed4ba5bb44cea3/sonar/findings.py#L488
https://github.com/okorach/sonar-tools/blob/593226eb1492c54d1bfa282eb7ed4ba5bb44cea3/sonar/findings.py#L421
https://github.com/okorach/sonar-tools/blob/593226eb1492c54d1bfa282eb7ed4ba5bb44cea3/sonar/findings.py#L447
Basically the matching algorithm verifies an exact match based on several issue attributes.
- If an exact match is found, there's a match , and the sync is performed
- If no exact match is found, the matching algorithm compute an approximate match score, based on the correspondance of a certain number of issue attributes.
- If a single approximate match is found, then this is the match, and the sync is performed
- If multiple approximate matches are found, then there is no best match and in that case the sync of the source issue is skipped
- If no approximate match is found, then there is no match and in that case the sync of the source issue is skipped
Since issue status sync may be done:
During the
migratecommand when theskip_project_data_migrationisfalse(default)After a migration if
skip_project_data_migrationistrue. In that case the migration only migrates projects configuration and a SQC scan has to be done to populate project data, after which issue status sync can be performedsonar-migration-toolshould offer a standalonesync-issuescommandThis command should sync all the issues of projects from a source SQS platform to the corresponding projects in SQC
The mapping of project keys should be based on the SQC project key renaming conventions defined in the migration configuration (currently hardcoded as
<org>_<projectKey>but will be configurable in the medium term based on issue The project key renaming strategy should be configurable #138Since the code may be slightly different on SQS and SQC the issue matching algorithm should not assume strict line number correspondance. A looser matching function is implemented at:
https://github.com/okorach/sonar-tools/blob/593226eb1492c54d1bfa282eb7ed4ba5bb44cea3/sonar/findings.py#L488
https://github.com/okorach/sonar-tools/blob/593226eb1492c54d1bfa282eb7ed4ba5bb44cea3/sonar/findings.py#L421
https://github.com/okorach/sonar-tools/blob/593226eb1492c54d1bfa282eb7ed4ba5bb44cea3/sonar/findings.py#L447
Basically the matching algorithm verifies an exact match based on several issue attributes.