fix: migrate external issues from SonarQube to SonarCloud (Issue #147)#151
Conversation
CloudVoyager was dropping all external issues (Ruff, Pylint, Flake8 linters)
during migration. Root cause: externalIssues-{ref}.pb and adhoerules.pb
were never written to the SonarCloud upload zip archive, and unit test
files (UTS qualifier) were excluded from source extraction causing their
issues to be skipped.
Changes:
- add-protobuf-files.js: write externalissues-{ref}.pb and adhoerules.pb
to the upload zip alongside existing component/issue/measure/activerules files
- source-methods.js: include UTS (unit test) files in source file extraction
so their external issues are included in validComponentKeys
- build-file-components.js: safety net to ensure all FIL components from
component tree are added to componentsMap even without source code
- docs/regression-testing.md: generalize protocol to support any SQ project
Regression test (sonar-tools project, SQ 2026.1):
Before: 554 external issues skipped, 704 external issue messages built,
778/1332 SC issues migrated
After: 0 external issues skipped, 1258 external issue messages built,
1332/1332 SC issues migrated (100%)
SummaryWhat ChangedThis PR fixes a data loss issue (#147) where external issues from SonarQube were not being migrated to SonarCloud. The fix has three parts:
Also updates regression testing documentation to be project-agnostic with expanded guidance on project selection and API commands. What reviewers should knowFor ReviewersStart with the code changes (3 small hunks, ~50 LOC total):
Verify data flow integrity:
Watch for edge cases:
Testing note: Regression testing docs now generalize to any project, so manual testing should verify external issues transfer correctly on a project that has them.
|
|
Hi @okorach @okorach-sonar , Ruff migration issues are fixed 👍🏼 |
Summary
CloudVoyager was dropping all external issues (Ruff, Pylint, Flake8 linters) during migration to SonarCloud.
Root causes found and fixed:
add-protobuf-files.js: External issues were correctly built into protobuf messages butexternalIssues-{ref}.pbandadhoerules.pbwere never written to the upload zip archive.source-methods.js: Unit test files (UTS qualifier) were excluded from source file extraction, causing their issues to be skipped fromvalidComponentKeys.build-file-components.js: Safety net added to ensure FIL components from the component tree are added even without source code.Test plan
okorach-oss_sonar-toolsproject (SQ 2026.1)Files changed
src/pipelines/sq-2025/sonarcloud/uploader/helpers/add-protobuf-files.jssrc/pipelines/sq-2025/sonarqube/api-client/helpers/source-methods.jssrc/pipelines/sq-2025/protobuf/build-components/helpers/build-file-components.jsdocs/regression-testing.md🤖 Generated with Claude Code