bcgov / nr-compliance-enforcement

A scalable solution that manages public complaints as well as investigative case files for multiple Compliance and Enforcement divisions across the natural resource sector.
Apache License 2.0
3 stars 2 forks source link

chore: CE-859 add sonar properties file #776

Closed mikevespi closed 5 days ago

mikevespi commented 5 days ago

Add a .sonar.properties file to allow custom Sonar settings.

Description

With Sonarcloud scans set up by PS to run automatically, the configuration in the workflow is not getting applied, our Sonar passes and fails are simply running against the default configuration on the Sonar instance. In order to overwrite the defaults a .sonar.properties file is needed. This PR creates that file and moves the settings in the workflow to the properties. They will likely need more fine tuning, however this will now be possible.

Fixes # https://env-ceds.atlassian.net/jira/software/c/projects/CE/boards/4?selectedIssue=CE-859

How Has This Been Tested?

This was tested in a separate branch by running various scenarios with changes to the workflow, and adding the properties file. With the properties file, the duplication was failed when a significant amount of (fake) duplication was added to a file. Adding the directory that housed the file to the exclusions list in the properties file caused the duplication to be correctly ignored resulting in a passing Sonar test. The same test was run without the properties file, and the equivalent changes made to the workflow code, without success; both scenarios hit the default > 3% duplication error.

Checklist

Further comments

Now that we have control of the Sonar settings, we can consider fine tuning them to behave the way that we want, and run on the code we intended it to be run on. We can also consider removing the job from the workflow, as it does not seem to be running as intended.


Thanks for the PR!

Deployments, as required, will be available below:

Please create PRs in draft mode. Mark as ready to enable:

After merge, new images are deployed in:

sonarcloud[bot] commented 5 days ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud