Closed WonderCsabo closed 3 years ago
This is intended. I would argue that it is likely that a changed line may introduce a problem that is reported on a nearby line. Not necessarily reported on the exact line that was changed.
Any violation within the patch, reported by GitLab, will be reported. The patch being what a human would see when viewing the merge request diff in the GUI. Implemented like this:
Could be relevant, but could be totally irrelevant. You cannot know. Since the flag is about the changed code, IMHO it should be reported for the changed code, and not other, nearby parts as well.
The Bitbucket Server plugin has a commentOnlyChangedContentContext
config that can be set to 1
to only comment on the exact line. That feature can be added here to solve this issue.
Good idea!
Hi Tomas, Do you have the ETA when this enhancement can be implemented?
No. Pull requests are welcome.
Looks like it's supported now https://github.com/jenkinsci/violation-comments-to-gitlab-plugin/commit/7cbdf2565be1ea05b1b2c1aba1b990efbee4aec1
yes this is available now.
Hi Tomas, Firstly very happy to know that this enhancement was implemented in 2.49. But in release page, latest one is 2.47, how can I upgrade to 2.49 via jenkins plugin manager?
I made a new release now, should be available within hours.
Many many thanks, new release is available now.
Expected: if the
commentOnlyChangedContent
parameter is set totrue
, only the violations for changed lines should be reported.Actual: it seems if the violation is inside the diff, it is still reported, despite if the line was actually changed or not.
Example:
You can see that a violation was reported for line 5 (the line with ellipsis), but that line actually was not changed by the commits.