Skip to content

Issue status synchronization should be a standalone sonar-migration-tool command #412

Description

@okorach-sonar

Since issue status sync may be done:

  • During the migrate command when the skip_project_data_migration is false (default)

  • After a migration if skip_project_data_migration is true. 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 performed

  • sonar-migration-tool should offer a standalone sync-issues command

  • This 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 #138

  • Since 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.

  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    usabilityIssue related to tool usability

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions