Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create GitHub Actions Workflows for CodeQL, Clang Analyzer and GCC -fanalyzer #1112

Merged
merged 2 commits into from
Sep 15, 2023

Conversation

jiridanek
Copy link
Contributor

@jiridanek jiridanek commented Jun 3, 2023

TODO: put the information below into a file under docs/

Code scanning is a GitHub feature https://docs.github.com/en/get-started/learning-about-github/about-github-advanced-security

Findings from CodeQL and GCC -fanalyzer get reported to https://github.com/skupperproject/skupper-router/security/code-scanning

Findings from clang (through CodeChecker) get reported in a github-pages-codechecker deployment webpage, which is not yet available, because it only deploys from main branch, but it will look like https://github.com/jiridanek/skupper-router/deployments/activity_log?environment=github-pages-codechecker

Checks available in clang are documented at https://clang.llvm.org/docs/analyzer/checkers.html The Cross Translation Unit analysis mode is not turned on in this PR just yet, https://clang.llvm.org/docs/analyzer/user-docs/CrossTranslationUnit.html#automated-ctu-analysis-with-codechecker

CodeChecker is recommended tool to run clang analyzer, docs are at https://github.com/Ericsson/codechecker/blob/master/docs/usage.md

@jiridanek jiridanek added this to the 2.5.0 milestone Jun 3, 2023
@jiridanek jiridanek self-assigned this Jun 3, 2023
@codecov
Copy link

codecov bot commented Jun 3, 2023

Codecov Report

Merging #1112 (e124625) into main (0a4fa8b) will decrease coverage by 0.12%.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1112      +/-   ##
==========================================
- Coverage   78.34%   78.23%   -0.12%     
==========================================
  Files         243      243              
  Lines       63135    63133       -2     
  Branches     5956     5845     -111     
==========================================
- Hits        49464    49390      -74     
- Misses      11039    11098      +59     
- Partials     2632     2645      +13     
Flag Coverage Δ
pysystemtests 87.55% <ø> (-0.03%) ⬇️
pyunittests 54.44% <ø> (ø)
systemtests 72.24% <ø> (-0.19%) ⬇️
unittests 26.62% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
calculator 30.14% <ø> (+<0.01%) ⬆️
systemtests 78.84% <ø> (-0.12%) ⬇️

@jiridanek jiridanek force-pushed the jd_2023_06_03_code_scanners branch from 6e93828 to b279515 Compare June 3, 2023 11:17
@jiridanek
Copy link
Contributor Author

jiridanek commented Jun 3, 2023

So, gcc -fanalyzer findings from this PR are at https://github.com/skupperproject/skupper-router/security/code-scanning?query=is%3Aopen+pr%3A1112+tool%3A%22GNU+C11%22

Notice the Show paths link which opens the "static backtrace" for the warning.

image

@jiridanek
Copy link
Contributor Author

@jiridanek jiridanek force-pushed the jd_2023_06_03_code_scanners branch 2 times, most recently from 27a1b32 to 371bf1c Compare June 3, 2023 11:55
@jiridanek jiridanek marked this pull request as ready for review June 3, 2023 11:55
@jiridanek jiridanek force-pushed the jd_2023_06_03_code_scanners branch 2 times, most recently from e03fa83 to 4e78f05 Compare June 6, 2023 14:34
@jiridanek
Copy link
Contributor Author

jiridanek commented Jun 8, 2023

to answer to @astitcher, and @kgiusti,

clang-analyzer apparently does not have a good way to suppress findings, according to https://clang-analyzer.llvm.org/faq.html#suppress_issue

there are some extra annotations (only one, actually) for clang-analyzer, coverity has much more https://clang-analyzer.llvm.org/annotations.html#attr_nonnull

for gcc -fanalyzer it appears that the heavyweight method for suppressing warnings needs to be used, with push and pop, https://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@jiridanek jiridanek merged commit 3c27e23 into skupperproject:main Sep 15, 2023
22 of 41 checks passed
@jiridanek jiridanek deleted the jd_2023_06_03_code_scanners branch September 15, 2023 16:56
jiridanek added a commit to jiridanek/skupper-router that referenced this pull request Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant