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

[Github] PR Decoration - Annotation on wrong line #189

Closed
cncgoko opened this issue Jun 9, 2020 · 3 comments
Closed

[Github] PR Decoration - Annotation on wrong line #189

cncgoko opened this issue Jun 9, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@cncgoko
Copy link
Contributor

cncgoko commented Jun 9, 2020

Describe the bug
On Github PR decoration, annotation for single line issues are reported on the wrong line, because end line of the annotated error is incremented by one.

To Reproduce
Steps to reproduce the behavior:

  1. Explore any issue in PR Checks decorator

Expected behavior
Annotation should be made on the last line of the issue. If the issue is single lined, the annotation should be made on that single line.

Screenshots
No screenshot available

Software Versions

  • SonarQube Version: 7.9.3
  • Plugin Version: Release 1.3.1

Additional context
The issue seems to come from line

.put("endLine", Optional.ofNullable(componentIssue.getIssue().getLine()).orElse(0) + 1)

I'm not sure if it's by design, or any requirement from Github API, but there is a suspicious + 1 that can be the cause of this issue

@cncgoko cncgoko added the bug Something isn't working label Jun 9, 2020
cncgoko added a commit to cncgoko/sonarqube-community-branch-plugin that referenced this issue Jun 11, 2020
Fix proposal for mc1arke#189

On Github PR decoration, annotation for single line issues are reported on the wrong line, because end line of the annotated error is incremented by one.
cncgoko added a commit to cncgoko/sonarqube-community-branch-plugin that referenced this issue Jun 11, 2020
cncgoko added a commit to cncgoko/sonarqube-community-branch-plugin that referenced this issue Jun 11, 2020
Fix proposal for mc1arke#189

On Github PR decoration, annotation for single line issues are reported on the wrong line, because end line of the annotated error is incremented by one.
@mc1arke
Copy link
Owner

mc1arke commented Jun 13, 2020

If you think you have a potential fix and can prove it resolves the issue then feel free to submit a Pull Request.

mc1arke pushed a commit that referenced this issue Jun 27, 2020
On Github Pull Request decoration, annotation for single line issues are reported on the wrong line, because end line of the annotated error is incorrectly incremented by one.
@marvin-w
Copy link
Contributor

marvin-w commented Jul 4, 2020

This can be closed.

mc1arke pushed a commit that referenced this issue Jul 16, 2020
On Github Pull Request decoration, annotation for single line issues are reported on the wrong line, because end line of the annotated error is incorrectly incremented by one.

(cherry picked from commit 79f6c5a)
mc1arke pushed a commit that referenced this issue Jul 16, 2020
On Github Pull Request decoration, annotation for single line issues are reported on the wrong line, because end line of the annotated error is incorrectly incremented by one.

(cherry picked from commit 79f6c5a)
@mc1arke
Copy link
Owner

mc1arke commented Jul 17, 2020

The fix has been released in 1.3.2 of the plugin (Sonarqube 7.8-8.0) and 1.4.0 (Sonarqube 8.1)

@mc1arke mc1arke closed this as completed Jul 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants