Closed JohnHalleyGotway closed 5 months ago
@bikegeek and @jprestop, I'm moving this PR from draft to being ready for review. I think I've tied up all the loose ends. I'll submit a similar PR for the main_v2.1
branch to get these changes into the default branch... and then move on to the other METplus repos.
I can take a look at it, should we try to get this into the beta4 release?
@bikegeek, yes, since it came together so quickly and easily, I think I'll try to get all of these changes in for beta4. Working on the companion PR for the main_v2.1 branch now.
I will add METreformat to the list of sonar.sources in the sonar-project-properties. There are some tests for the METreformat code, so the code coverage should be >0% if the tests are getting picked up.
These PR adds SonarQube Scanning to GitHub actions, as described below:
sonarqube.yml
defines the new workflow that is triggered by pushes to the develop or main branches, as well as pull requests to those branches. I also added a manual workflow dispatch option, but that won't show up in GitHub until these changes are also made in themain_v2.1
branch. This workflow checks out the code, determines the current branch name, runs a script to set up the SonarQube properties file, and then calls custom actions to perform the scan and check the results.configure_sonarqube.sh
customizes thesonar-project.properties
settings for the current run.sonar-project.properties
is updated with template values to be updated byconfigure_sonarqube.sh
and therun_sonarqube.sh
script used by the nightly build.run_sonarqube.sh
is the script run during the nightly build. This is updated to handle the newly-parameterizedsonar-project.properties
file.internal_tests
directory since the SonarQube scanning files were moved from there tointernal/scripts/sonarqube
(prior to this feature branch) for consistency with other METplus repos.Note that the scans were enhanced to include the actual code version number rather than just a hard-code string of
1.0
.Please also see this issue comment about a runtime exception. While this exception occurs when running on seneca, it DOES NOT occur when running through GitHub actions. I inspected the log from this run and see on lines 118-121 that no exception occurs:
Pull Request Testing
[x] Describe testing already performed for these changes: I manually ran the SonarQube scan for both the
develop
andmain_v2.1
branches so that they'd present in needham.rap.ucar.edu to serve as references.[x] Recommend testing for the reviewer(s) to perform, including the location of input datasets, and any additional instructions:
Review the code changes.
Confirm that the SonarQube workflow runs for this PR.
Inspect the SonarQube server:
[x] Do these changes include sufficient documentation updates, ensuring that no errors or warnings exist in the build of the documentation? [Yes] None needed.
[x] Do these changes include sufficient testing updates? [Yes] None needed.
[x] Will this PR result in changes to the test suite? [No] If yes, describe the new output and/or changes to the existing output:
[x] Please complete this pull request review by [Fri 4/5/24].
Pull Request Checklist
See the METplus Workflow for details.