Flag existing and new compiler warnings with reviewdog#3192
Flag existing and new compiler warnings with reviewdog#3192NickSzapiro-NOAA wants to merge 2 commits into
Conversation
|
There won't be any extra warning messages in this PR, so I assume this new check won't produce anything and pass. Is there any way to test this PR's work? Create a new warning manually and see what it does? |
|
This is neat. Looking at your example PR, it looks like the previous logs are already stored somewhere. Is this maintained by the EPIC Spackstack team? Also, we should think about how often this should be run if it takes ~20 minutes to complete. (I'm thinking not on every pull request, maybe a less frequent trigger, but 20 minutes also isn't too bad of a runtime.) |
|
Here is an example from adding an unused variable @BrianCurtis-NOAA : NickSzapiro-NOAA#24 (comment) I'm not sure that previous logs are involved. Where do you see that @dpsarmie ? That's not 100%, as code changes could trigger warnings elsewhere but we separately track the total number of warnings |
|
I was looking at the https://github.com/NickSzapiro-NOAA/ufs-weather-model/actions/runs/24421069485/job/71343114530?pr=24 logs for the Github action, but you're right there's no download of the previous logs. I was confused but now I see that the logs it downloads are from the S2SWA and ATM builds from the previous steps (looking at the SHA256 hashes). So now my question is what is being compared to generate the report? I'm assuming there's a diff being run somewhere between a baseline and the new logs being generated or does reviewdog work some other way? |
|
Another way without a diff to a previous version. Currently this
The Spack job is the time consuming part and the warnings wait on that (for the build logs) |
|
Are we sure this is a well-maintained GHA? It has ~130 open issues, the top one of which is "looking for maintainers" posted in 2019. There are two new issues, one posted by @DavidHuber-NOAA last week and then closed. |
|
As far as custom GitHub actions are concerned, I suggest pinning specific commit hashes and updating carefully. Here's an instance of exploits apparently being introduced into reviewdog: GHSA-qmg3-hpqr-gqvc |
|
@DeniseWorthen @dpsarmie @NickSzapiro-NOAA I've been looking at GitHub Actions-related repository security settings. I don't know how locked down they are currently but it might be worth reviewing them and minimizing permissions/features to whatever is strictly needed. |
|
I'm not an expert and welcome more reviews/feedback reviewdog seems to be a widely used, popular open-source tool for automated code reviews, particularly within the GitHub ecosystem. But, I'm not sure this is the best tool , especially with a major security vulnerability in March 2025 (see https://www.wiz.io/blog/new-github-action-supply-chain-attack-reviewdog-action-setup) as Alex mentioned Happy to try other approaches, if folks have suggestions |
|
ok ... I'm starting a new branch that will work similarly but using our own script with read permissions instead @AlexanderRichert-NOAA Do you want to make a separate issue on reviewing the GitHub Actions-related repository security settings? |
|
Sounds good, will do |
|
Closing in favor of #3200 |
Commit Queue Requirements:
test_changes.listindicates which tests, if any, are changed by this PR. Committest_changes.list, even if it is empty.Description:
We're looking for a friendlier way of iterating with developers to reduce compiler warnings, towards better code quality and EE2 requirements. Here is a go at this via reviewdog
https://github.com/reviewdog/reviewdog "provides a way to post review comments to code hosting services, such as GitHub, automatically by integrating with any linter tools with ease. It uses an output of lint tools and posts them as a comment if findings are in the diff of patches to review."
Here we add GitHub Actions to flag existing and new compiler warnings with reviewdog for s2swa application in GNU debug mode. These complement the tracking of the number of warnings on supported platforms via the regression test platform logs.
NickSzapiro-NOAA#24 is an example of what a developer may see
Commit Message:
Priority:
Git Tracking
UFSWM:
Sub component Pull Requests:
UFSWM Blocking Dependencies:
Documentation:
Changes
Regression Test Changes (Please commit test_changes.list):
Input data Changes:
Library Changes/Upgrades:
Testing Log: