-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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 Analysis for PRs #26993
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- the sonar container version should be reproducible and be loaded from generator-jhipster provided version instead of using latest.
A new release will introduce errors/bugs without warnings. new issues is only reported after a period. AFAIK there is no way to check new issues between 2 checks.the pr is simulating a PR so it may work.- PR comments requires a token to work.
- code coverage won't work without caching tests result.
JHipster Lite is quite different. |
Thank you for the review and comments, @mshima.
|
Sonar version should be get from
Like we get node/java/npm versions and build ci matrix with them. |
@DanielFran can you generate a Fine grained PAT with PR and ISSUES (to be used in https://github.com/jhipster/generator-jhipster/blob/main/.github/workflows/issue-check.yml workflow) comment permission? |
To be able to analyze differences (using pull request analysis), we have to use |
A specific Dockerfile in test-integration/sonar-pr then? |
I'm not entirely sure I understand the requirement. Do you mean creating a Dockerfile in |
Reproducible version and auto update through dependabot. |
A docker-compose file with renovate auto update is an alternative. |
Thanks for the clarification. We could use a custom manager if Renovate doesn’t detect the dependency in the action, but adding a Dockerfile might be simpler. I’ll push this change together with the token once it’s created by @DanielFran |
@mshima @anarsultanov I created JHIPSTER_PAT_PR_ISSUES token |
@DanielFran have you added to repository secrets? |
Yes, it can be used |
Co-authored-by: Marcelo Shima <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- if cache does not match, the overall issues should be shown.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use kebab case instead of snake case. It's the default for actions.
Co-authored-by: Marcelo Shima <[email protected]>
Dockerfile needs to be added to dependabot config: generator-jhipster/.github/dependabot.yml Lines 198 to 207 in 1ffb5de
|
Seems like some issue with token:
One option we can try is to load the result into artifacts since it uses some other token that might be accessible. Update: but if you want to keep things as is, to only get comments on pull requests created directly in the repository, we can get rid of the PAT and rely on the default token. |
Co-authored-by: Marcelo Shima <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Polish
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fold log to improve readability.
@anarsultanov approved |
This PR introduces a custom GitHub Action to address Issue #19467 by adding SonarQube reports to PRs, enabling the detection of newly introduced issues and helping maintain high code quality in the project.
Summary:
main
branch, the entire generated application is cached. This cache is then restored during PR analysis.main
branch project is analyzed first, followed by the analysis of the PR changes. This process allows to identify and report only the issues newly introduced in the PR.Simplification Suggestion:
We could simplify the approach by analyzing the generated project directly instead of focusing on the changes. This would streamline the workflow, eliminate the dependency on caching, and allow the use of the official SonarQube Community Edition image.
Please make sure the below checklist is followed for Pull Requests.
When you are still working on the PR, consider converting it to Draft (below reviewers) and adding
skip-ci
label, you can still see CI build result at your branch.