Must-share information (formatted with Markdown):
- SonarQube Server
- Helm
- Import an TFLint json report file in CI analysis process
- Populated sonar.terraform.tflint.reportPaths config, report file is picked up but all issues within the report fail to save due to subject (file could not be resolved)
When the analysis runs I can see 39 files being indexed, a few relevant examples of that group are -
15:37:34.413 DEBUG: 'azure_sql_infrastructure/azure_sql_storage_accounts/main.tf' indexed with language 'terraform'
15:37:34.413 DEBUG: 'azure_sql_infrastructure/azure_sql_storage_accounts/outputs.tf' indexed with language 'terraform'
15:37:34.413 DEBUG: 'azure_sql_infrastructure/azure_sql_storage_accounts/variables.tf' indexed with language 'terraform'
Then I get an entry to say the indexing is done -
15:37:34.422 INFO: 39 files indexed (done) | time=16ms
All good so far
Then I get an entry detailing the TFLint report being picked up
15:37:34.909 INFO: TFLint report importing: Importing external report from: /workspace/source/tflint.json
Every issue within the report fails the same way.. however, the files which cannot be resolved have been indexed - exactly same path. Examples -
15:37:34.913 DEBUG: failed to save issue
org.sonar.iac.common.reports.ReportImporterException: The file: azure_sql_infrastructure/azure_sql_storage_accounts/main.tf could not be resolved
15:37:34.914 DEBUG: failed to save issue
org.sonar.iac.common.reports.ReportImporterException: The file: azure_sql_infrastructure/azure_sql_storage_accounts/variables.tf could not be resolved
I have read a few issues raised which looked similar, however you could see the path differed between the report and the root analysis..
To prove where the analysis was running, I used this value for the reportPaths
-Dsonar.terraform.tflint.reportPaths=tflint.json
You can see as quoted above that file is picked up from /workspace/source/tflint.json which is the root of the repo where the dir azure_sql_infrastructure lives..
Iâm a bit stuck.. if you could suggest something for me to try that would be amazing..
Many thanks
Tony