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

Add sonarqube capacities to Ginkgo. #304

Merged
merged 2 commits into from
May 22, 2019
Merged

Add sonarqube capacities to Ginkgo. #304

merged 2 commits into from
May 22, 2019

Conversation

tcojean
Copy link
Member

@tcojean tcojean commented May 17, 2019

A long time ago, I tried out using sonarqube with Ginkgo and we got some really
nice code analysis out of it. This small PR adds this capacity to Ginkgo as part of
the CI system. The main goal is to have statistics (coverage, new bugs, etc) for
each pull request before merging into develop. This would allow to take care of
many coding problems as part of the PR process rather than after merging.

After this, I believe Ginkgo is fairly well covered in terms of tools for code static
and dynamic analysis. This is the last tool I wanted to add to Ginkgo.

  • Adapt the containers to bundle the sonar-scanner tool when found.
  • Add a CUDA job which launches the build-wrapper and sonar-scanner tools to
    scan the code and update all data online.
  • Put all coverage analysis on a per branch basis instead of only for the long
    living branches. This provides change metrics for branches before they are
    merged to develop.

@tcojean tcojean added reg:build This is related to the build system. reg:ci-cd This is related to the continuous integration system. 1:ST:WIP This PR is a work in progress. Not ready for review. labels May 17, 2019
@tcojean tcojean self-assigned this May 17, 2019
+ Adapt the containers to bundle the sonar-scanner tool when found.
+ Add a CUDA job which launches the build-wrapper and sonar-scanner tools to
  scan the code and update all data online.
+ Put all coverage analysis on a per branch basis instead of only for the long
  living branches. This provides change metrics for branches before they are
  merged to develop.
@tcojean tcojean force-pushed the sonarqube_scan branch 2 times, most recently from 17b7bf2 to ace679b Compare May 19, 2019 12:31
@codecov
Copy link

codecov bot commented May 19, 2019

Codecov Report

Merging #304 into develop will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #304   +/-   ##
========================================
  Coverage    98.09%   98.09%           
========================================
  Files          216      216           
  Lines        16058    16058           
========================================
  Hits         15752    15752           
  Misses         306      306

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5e0ca65...25231f0. Read the comment docs.

@tcojean tcojean added 1:ST:ready-for-review This PR is ready for review and removed 1:ST:WIP This PR is a work in progress. Not ready for review. labels May 19, 2019
@tcojean
Copy link
Member Author

tcojean commented May 19, 2019

This PR should now be finished and ready for review. You can see what the PR changes by looking at the bottom of it:

  1. There is a codecov report which shows up with a graph of coverage changes (here nothing changes, so it's all grey).
  2. There are now 4 checks for each PR, the gitlab pipeline as usual, and after the sonarqube_cov step is processed, three extra checks are added. Two are regarding codecov, and the last one is the sonarqube "quality gate" which becomes red when either:
    1. There is bad coverage for the changes
    2. There is too many code duplication
    3. There are critical bugs (or many small ones) which are added as part of the PR.

Note that, for the sonarqube check to appear, a commit needs to happen to the branch (or the pipeline has to be ran), after the PR has been created on Github. If that is not the case, the analysis will nonetheless be available on sonarqube but will not appear here. In practice, I think there is always a couple of commits in the PR, as request for changes and fixes happen (at least for the big PRs which we want to have the sonarqube check).

+ If there is a PR associated to this commit, use the PR parameters.
+ Otherwise, use the sonarqube branching models and suppose the target is
  develop, which is true in almost all cases (the exception being releases).
+ Add jq tool for parsing the json output.
@thoasm
Copy link
Member

thoasm commented May 19, 2019

@tcojean Does it also work if I only force-push (overwrite my last commit) after I create a PR?

@tcojean
Copy link
Member Author

tcojean commented May 19, 2019

@thoasm as long as there is a pipeline trigger in some way and an open PR, this will work.
You could also only trigger a pipeline from the Gitlab.

@thoasm
Copy link
Member

thoasm commented May 19, 2019

@tcojean Then I think this should be fine.

Copy link
Member

@thoasm thoasm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Interesting tool

@tcojean tcojean added 1:ST:do-not-merge Please do not merge PR this yet. 1:ST:ready-for-review This PR is ready for review and removed 1:ST:ready-for-review This PR is ready for review 1:ST:do-not-merge Please do not merge PR this yet. labels May 20, 2019
Copy link
Member

@pratikvn pratikvn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really useful tool. But I guess it needs to tweaked a bit to tell what false positives it detects ?

@tcojean
Copy link
Member Author

tcojean commented May 22, 2019

@pratikvn Yes, you can do it from the web interface and set particular issues as false positive or won't fix. I believe that is the preferred way of controlling this.

@tcojean tcojean merged commit 5e744ca into develop May 22, 2019
@tcojean tcojean deleted the sonarqube_scan branch May 22, 2019 10:31
@tcojean tcojean added 1:ST:ready-to-merge This PR is ready to merge. and removed 1:ST:ready-for-review This PR is ready for review labels May 22, 2019
tcojean added a commit that referenced this pull request Oct 20, 2019
The Ginkgo team is proud to announce the new minor release of Ginkgo version
1.1.0. This release brings several performance improvements, adds Windows support, 
adds support for factorizations inside Ginkgo and a new ILU preconditioner
based on ParILU algorithm, among other things. For detailed information, check the respective issue.

Supported systems and requirements:
+ For all platforms, cmake 3.9+
+ Linux and MacOS
  + gcc: 5.3+, 6.3+, 7.3+, 8.1+
  + clang: 3.9+
  + Intel compiler: 2017+
  + Apple LLVM: 8.0+
  + CUDA module: CUDA 9.0+
+ Windows
  + MinGW and CygWin: gcc 5.3+, 6.3+, 7.3+, 8.1+
  + Microsoft Visual Studio: VS 2017 15.7+
  + CUDA module: CUDA 9.0+, Microsoft Visual Studio
  + OpenMP module: MinGW or CygWin.


The current known issues can be found in the [known issues
page](https://github.com/ginkgo-project/ginkgo/wiki/Known-Issues).


Additions:
+ Upper and lower triangular solvers ([#327](#327), [#336](#336), [#341](#341), [#342](#342)) 
+ New factorization support in Ginkgo, and addition of the ParILU
  algorithm ([#305](#305), [#315](#315), [#319](#319), [#324](#324))
+ New ILU preconditioner ([#348](#348), [#353](#353))
+ Windows MinGW and Cygwin support ([#347](#347))
+ Windows Visual studio support ([#351](#351))
+ New example showing how to use ParILU as a preconditioner ([#358](#358))
+ New example on using loggers for debugging ([#360](#360))
+ Add two new 9pt and 27pt stencil examples ([#300](#300), [#306](#306))
+ Allow benchmarking CuSPARSE spmv formats through Ginkgo's benchmarks ([#303](#303))
+ New benchmark for sparse matrix format conversions ([#312](#312))
+ Add conversions between CSR and Hybrid formats ([#302](#302), [#310](#310))
+ Support for sorting rows in the CSR format by column idices ([#322](#322))
+ Addition of a CUDA COO SpMM kernel for improved performance ([#345](#345))
+ Addition of a LinOp to handle perturbations of the form (identity + scalar *
  basis * projector) ([#334](#334))
+ New sparsity matrix representation format with Reference and OpenMP
  kernels ([#349](#349), [#350](#350))

Fixes:
+ Accelerate GMRES solver for CUDA executor ([#363](#363))
+ Fix BiCGSTAB solver convergence ([#359](#359))
+ Fix CGS logging by reporting the residual for every sub iteration ([#328](#328))
+ Fix CSR,Dense->Sellp conversion's memory access violation ([#295](#295))
+ Accelerate CSR->Ell,Hybrid conversions on CUDA ([#313](#313), [#318](#318))
+ Fixed slowdown of COO SpMV on OpenMP ([#340](#340))
+ Fix gcc 6.4.0 internal compiler error ([#316](#316))
+ Fix compilation issue on Apple clang++ 10 ([#322](#322))
+ Make Ginkgo able to compile on Intel 2017 and above ([#337](#337))
+ Make the benchmarks spmv/solver use the same matrix formats ([#366](#366))
+ Fix self-written isfinite function ([#348](#348))
+ Fix Jacobi issues shown by cuda-memcheck

Tools and ecosystem:
+ Multiple improvements to the CI system and tools ([#296](#296), [#311](#311), [#365](#365))
+ Multiple improvements to the Ginkgo containers ([#328](#328), [#361](#361))
+ Add sonarqube analysis to Ginkgo ([#304](#304), [#308](#308), [#309](#309))
+ Add clang-tidy and iwyu support to Ginkgo ([#298](#298))
+ Improve Ginkgo's support of xSDK M12 policy by adding the `TPL_` arguments
  to CMake ([#300](#300))
+ Add support for the xSDK R7 policy ([#325](#325))
+ Fix examples in html documentation ([#367](#367))
tcojean added a commit that referenced this pull request Oct 21, 2019
The Ginkgo team is proud to announce the new minor release of Ginkgo version
1.1.0. This release brings several performance improvements, adds Windows support,
adds support for factorizations inside Ginkgo and a new ILU preconditioner
based on ParILU algorithm, among other things. For detailed information, check the respective issue.

Supported systems and requirements:
+ For all platforms, cmake 3.9+
+ Linux and MacOS
  + gcc: 5.3+, 6.3+, 7.3+, 8.1+
  + clang: 3.9+
  + Intel compiler: 2017+
  + Apple LLVM: 8.0+
  + CUDA module: CUDA 9.0+
+ Windows
  + MinGW and Cygwin: gcc 5.3+, 6.3+, 7.3+, 8.1+
  + Microsoft Visual Studio: VS 2017 15.7+
  + CUDA module: CUDA 9.0+, Microsoft Visual Studio
  + OpenMP module: MinGW or Cygwin.


The current known issues can be found in the [known issues
page](https://github.com/ginkgo-project/ginkgo/wiki/Known-Issues).


### Additions
+ Upper and lower triangular solvers ([#327](#327), [#336](#336), [#341](#341), [#342](#342)) 
+ New factorization support in Ginkgo, and addition of the ParILU
  algorithm ([#305](#305), [#315](#315), [#319](#319), [#324](#324))
+ New ILU preconditioner ([#348](#348), [#353](#353))
+ Windows MinGW and Cygwin support ([#347](#347))
+ Windows Visual Studio support ([#351](#351))
+ New example showing how to use ParILU as a preconditioner ([#358](#358))
+ New example on using loggers for debugging ([#360](#360))
+ Add two new 9pt and 27pt stencil examples ([#300](#300), [#306](#306))
+ Allow benchmarking CuSPARSE spmv formats through Ginkgo's benchmarks ([#303](#303))
+ New benchmark for sparse matrix format conversions ([#312](#312))
+ Add conversions between CSR and Hybrid formats ([#302](#302), [#310](#310))
+ Support for sorting rows in the CSR format by column idices ([#322](#322))
+ Addition of a CUDA COO SpMM kernel for improved performance ([#345](#345))
+ Addition of a LinOp to handle perturbations of the form (identity + scalar *
  basis * projector) ([#334](#334))
+ New sparsity matrix representation format with Reference and OpenMP
  kernels ([#349](#349), [#350](#350))

### Fixes
+ Accelerate GMRES solver for CUDA executor ([#363](#363))
+ Fix BiCGSTAB solver convergence ([#359](#359))
+ Fix CGS logging by reporting the residual for every sub iteration ([#328](#328))
+ Fix CSR,Dense->Sellp conversion's memory access violation ([#295](#295))
+ Accelerate CSR->Ell,Hybrid conversions on CUDA ([#313](#313), [#318](#318))
+ Fixed slowdown of COO SpMV on OpenMP ([#340](#340))
+ Fix gcc 6.4.0 internal compiler error ([#316](#316))
+ Fix compilation issue on Apple clang++ 10 ([#322](#322))
+ Make Ginkgo able to compile on Intel 2017 and above ([#337](#337))
+ Make the benchmarks spmv/solver use the same matrix formats ([#366](#366))
+ Fix self-written isfinite function ([#348](#348))
+ Fix Jacobi issues shown by cuda-memcheck

### Tools and ecosystem improvements
+ Multiple improvements to the CI system and tools ([#296](#296), [#311](#311), [#365](#365))
+ Multiple improvements to the Ginkgo containers ([#328](#328), [#361](#361))
+ Add sonarqube analysis to Ginkgo ([#304](#304), [#308](#308), [#309](#309))
+ Add clang-tidy and iwyu support to Ginkgo ([#298](#298))
+ Improve Ginkgo's support of xSDK M12 policy by adding the `TPL_` arguments
  to CMake ([#300](#300))
+ Add support for the xSDK R7 policy ([#325](#325))
+ Fix examples in html documentation ([#367](#367))


Related PR: #370
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1:ST:ready-to-merge This PR is ready to merge. reg:build This is related to the build system. reg:ci-cd This is related to the continuous integration system.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants