-
Notifications
You must be signed in to change notification settings - Fork 92
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
Support GitLab Code Quality report format #803
Support GitLab Code Quality report format #803
Conversation
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #803 +/- ##
==========================================
- Coverage 87.07% 86.75% -0.33%
==========================================
Files 141 142 +1
Lines 1540 1578 +38
Branches 268 274 +6
==========================================
+ Hits 1341 1369 +28
- Misses 199 209 +10 ☔ View full report in Codecov by Sentry. |
d17783d
to
df31199
Compare
df31199
to
7feec0b
Compare
7feec0b
to
3191d1f
Compare
@saeltz @mccartney Could you be so kind to review this PR? I've done some basic tests on a (private) GitLab Ultimate instance to test the various features around Code Quality, and they look fine. |
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.
Thanks for your work!
src/main/scala/com/sksamuel/scapegoat/io/GitlabCodeQualityReportWriter.scala
Outdated
Show resolved
Hide resolved
src/main/scala/com/sksamuel/scapegoat/io/GitlabCodeQualityReportWriter.scala
Outdated
Show resolved
Hide resolved
val fingerprint = MessageDigest | ||
.getInstance("MD5") |
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.
Maybe extract the MessageDigest
to only have one instance instead of initialising one for every warning?
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.
As MessageDigest is stateful and not thread safe, I've moved it to the outer loop so it at least re-uses the instance for an entire report.
78e0f29
to
055d6a1
Compare
Thanks @Johnnei 👍 |
Add support to output GitLab Code Quality report format (Fixes #775).
Note: On multi module projects this will need support from the preferred build tool or trick (cat + jq?) to aggregate the jsons into one json.
The report requires project root relative paths to get correct links in the widgets. To this I used
CI_PROJECT_DIR
(https://docs.gitlab.com/ee/ci/variables/predefined_variables.html). If this turns out to not be flexible enough then maybe it could still become a config option for the report.