Show PMD results in inline code quality diff
What does this MR do and why?
Show PMD results in inline code quality diff
Remove ./ from file when loading code quality data
If the file path in code quality data starts with ./
like files in the pmd scanner results do
remove it from the file path so that it gets displayed
in the code quality inline diff results
Changelog: fixed
References
- request for help issue: https://gitlab.com/gitlab-com/request-for-help/-/issues/2584
- MR in project where this was discovered demonstrating that vale findings are shown but pmd findings are not: gl-demo-ultimate-smatthies/pov/just-a-web-app!3 (diffs)
- PMD in code quality documentation: https://docs.gitlab.com/ci/testing/code_quality/#pmd-copypaste-detector
Screenshots or screen recordings
How to set up and validate locally
- set up a project that shows code quality results from the PMD scanner, either:
- set up a project to use the PMD CI/CD component and open an MR that adds a new code quality finding, or
- clone this project that mocks the code quality scan and open an MR in it that adds a new mocked code quality finding:
- use this artifact as the
feature-branch/gl-codequality-report.json
- in the MR, add
.mvn/wrapper/MavenWrapperDownloader.java
to the repo so that findings can be shown for it - ensure pipelines ran for the base and head commits of the MR
- use this artifact as the
- check that code quality findings are now displayed inline in the MR diff
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Miranda Fluharty