ZedThree / clang-tidy-review

Create a pull request review based on clang-tidy warnings
MIT License
88 stars 44 forks source link

Crash when trying to post reviews for files that are not present in the compile set #41

Closed FlorianReimold closed 2 years ago

FlorianReimold commented 2 years ago

I haven't fully understood the crash, yet, but I assume it happens when reviewing a file that is not in the compile_commands.json. That can happen e.g. when you have a cross-plattform project where you edited a Windows specific file which is not compiled on Linux. The clang-tidy-review action will compile it anyways and crash.

The file is accessed in the docker container by its relative name (relative to what?): https://github.com/continental/ecal/runs/6528911109?check_suite_focus=true#step:4:2119

Later it tries to access the name by a non-existing path. For some reason, it misses the workspace directory from the middle of the path. https://github.com/continental/ecal/runs/6528911109?check_suite_focus=true#step:4:2168

I guess at some point the file list has to be filtered, so only files from the compile_commands.json are checked. I think that behavior should be always acceptable when a compile_commands.json is present.


Edit: My test fork completed its review on the same Windows-specific file and in that PR clang-tidy-review successfully reviewed it. I would still like it to not review that file at all, but at least it didn't mess up the path. Any idea why this happened in the main repo (former 2 links) and how it can be fixed?