violations-lib icon indicating copy to clipboard operation
violations-lib copied to clipboard

Evaluate relative paths to make them match changed paths

Open stoesselt opened this issue 6 years ago • 3 comments

I have a GCC warning. However, the compiler warning is not shown/commented in the PR.

I also use the warnings plugin to create a Jenkins internal report. I use both plugins with the same output files of GCC, and in the warnings plugin it is identified and resolved correctly. So the path in total is correct.

In contrast to the other output logs I use, I know that this has relative parts in its path, e.g. /foo/bar/../foobar.cpp. I don't know if Bitbucket can handle such a path, does the plugin resolve it before invoking the url?

stoesselt avatar Sep 10 '18 12:09 stoesselt

Relative parts is most likely the problem. Can you not get rid of that?

Den mån 10 sep. 2018 14:41stoesselt [email protected] skrev:

I have a GCC warning. However, the compiler warning is not shown/commented in the PR.

I also use the warnings plugin to create a Jenkins internal report. I use both plugins with the same output files of GCC, and in the warnings plugin it is identified and resolved correctly. So the path in total is correct.

In contrast to the other output logs I use, I know that this has relative parts in its path, e.g. /foo/bar/../foobar.cpp. I don't know if Bitbucket can handle such a path, does the plugin resolve it before invoking the url?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tomasbjerre/violations-lib/issues/40, or mute the thread https://github.com/notifications/unsubscribe-auth/AAa1E_v_7NO2wprpm7LTiqGccbLf35aUks5uZl37gaJpZM4WhUcZ .

tomasbjerre avatar Sep 10 '18 12:09 tomasbjerre

I have to say it, I love your response times ^^

Ok, I got rid of the relative path parts and it works now. In other words Bitbucket cannot cope with the relative path parts.

I would like to have this issue as an enhancement. Though it only seems relevant to Bitbucket I would keep it at the lowest level and do proper path resolution before providing it to higher layers..

stoesselt avatar Sep 11 '18 07:09 stoesselt

Thanks.

What happens here is that the Bitbucket APi returns paths that were changed in the PR. Like /this/path/was/changed.txt and in the report file we have maby /this/path/was/not/../changed.txt. And the file will only be commented if they are equal.

This can definitely be fixed in the plugin or one of its supporting libraries. I think this lib should be responsible for just parsing the report files and making its content available.

I think, maby, this issue should be resolved with a change in violation-comments-lib.

tomasbjerre avatar Sep 11 '18 09:09 tomasbjerre

I think this was fixed when fixing https://github.com/tomasbjerre/violations-command-line/issues/7

tomasbjerre avatar Feb 18 '23 06:02 tomasbjerre