Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-54072

extension point to write comments to SCM pull request

      What I was thinking was to allow an extension point to write warnings to the SCM. I was thinking github for my needs but others have similar concepts.

       

      The extension points could iterate based on the URL and decide if its a PR and one of its own then invoke it with each line or just send the whole report to be processed.

      Any plugin would then decide if to add the warnings into the PR

          [JENKINS-54072] extension point to write comments to SCM pull request

          I looked at that plugin and I think it’s double handling the warnings and logs

          Plus you have to do some magic in git to make it work

          I’m happy to do a PR once I get the code running

          Jeremy Marshall added a comment - I looked at that plugin and I think it’s double handling the warnings and logs Plus you have to do some magic in git to make it work I’m happy to do a PR once I get the code running

          Ulli Hafner added a comment -

          Ok, feel free to go ahead!

          Ulli Hafner added a comment - Ok, feel free to go ahead!

          Hi jeremym, have you progressed on this? On my side I'd be interested into publishing comments to Bitbucket. Maybe we could join our forces to come up with working solution (if you don't have a working solution yet) ? When I look at your GitHub profile, I see that you already started (https://github.com/JeremyMarshall/warnings-ng-plugin/tree/extension and https://github.com/JeremyMarshall/github-violations-warnings-plugin).

           

          Would you be up for some collaboration on this?

          Jean-Christophe Morin added a comment - Hi jeremym , have you progressed on this? On my side I'd be interested into publishing comments to Bitbucket. Maybe we could join our forces to come up with working solution (if you don't have a working solution yet) ? When I look at your GitHub profile, I see that you already started ( https://github.com/JeremyMarshall/warnings-ng-plugin/tree/extension  and https://github.com/JeremyMarshall/github-violations-warnings-plugin).   Would you be up for some collaboration on this?

          jeanchristophemorinperso The problem with my code is that I was mainly targeting declarative pipelines when the warning plugin was used as a post step.

          It mostly works but, the violations in the lists have a full pathname and I couldn't find a good way of stripping this off as the post step at the point I implemented has no way of getting the workspace.

          Another problem is I started writing it in a functional way, which probably has to come out.

           

          I though maybe a better way would be to have a standalone plugin which can reprocess the build/job/<job>/branches/<branch>/builds/<num>/xxx_<outstanding|fixed|new>-issues.xml files

          I haven't progressed this yet other than a bare bones plugin but again the entries have a full path as per the workspace where it was created.

           

          There is another jenkins  github plugin which can write to PRs from the pipeline (maybe there's a similar BitBucker one?) https://github.com/jenkinsci/pipeline-github-plugin#reviewcomment

           

          Feel free to lift anything out but I really do need to start again

           

           

          Jeremy Marshall added a comment - jeanchristophemorinperso The problem with my code is that I was mainly targeting declarative pipelines when the warning plugin was used as a post step. It mostly works but, the violations in the lists have a full pathname and I couldn't find a good way of stripping this off as the post step at the point I implemented has no way of getting the workspace. Another problem is I started writing it in a functional way, which probably has to come out.   I though maybe a better way would be to have a standalone plugin which can reprocess the build/job/<job>/branches/<branch>/builds/<num>/xxx_<outstanding|fixed|new>-issues.xml files I haven't progressed this yet other than a bare bones plugin but again the entries have a full path as per the workspace where it was created.   There is another jenkins  github plugin which can write to PRs from the pipeline (maybe there's a similar BitBucker one?) https://github.com/jenkinsci/pipeline-github-plugin#reviewcomment   Feel free to lift anything out but I really do need to start again    

          Ulli Hafner added a comment -

          Ulli Hafner added a comment - Here another interesting link: https://github.blog/2018-05-07-introducing-checks-api/

          So as I said before Christmas on Gitter, I am still interested by this feature. Bitbucket server has something similar to the GitHub Checks API, it's called Code Insights (see https://confluence.atlassian.com/bitbucketserver/code-insights-966660485.html). There is no equivalent with Bitbucket cloud as of now. Services like Codacy simply create comments in pull requests for Bitbucket cloud. GitLab seems to have somthing similar to GitHub and Bitbucket (https://docs.gitlab.com/ee/user/project/merge_requests/code_quality.html), but it might not be exactly the same thing. I'm no GitLab expert.user, so I might be entirely wrong here.

          Jean-Christophe Morin added a comment - So as I said before Christmas on Gitter, I am still interested by this feature. Bitbucket server has something similar to the GitHub Checks API, it's called Code Insights (see  https://confluence.atlassian.com/bitbucketserver/code-insights-966660485.html ). There is no equivalent with Bitbucket cloud as of now. Services like Codacy simply create comments in pull requests for Bitbucket cloud. GitLab seems to have somthing similar to GitHub and Bitbucket ( https://docs.gitlab.com/ee/user/project/merge_requests/code_quality.html ), but it might not be exactly the same thing. I'm no GitLab expert.user, so I might be entirely wrong here.

          Ulli Hafner added a comment -

          Ulli Hafner added a comment - For reference, here a discussion on the dev list: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/jenkinsci-dev/UGhDM5lcz8Y/P9W4i_B5BAAJ

          Ulli Hafner added a comment -

          We are currently creating a project proposal for GSoC 2020: feel free to add comments at our draft at https://docs.google.com/document/d/1fl3sF0mArtv2THOjPSZvNufGme4P24BtT0BirHMeMRY/edit?usp=sharing

          Ulli Hafner added a comment - We are currently creating a project proposal for GSoC 2020: feel free to add comments at our draft at https://docs.google.com/document/d/1fl3sF0mArtv2THOjPSZvNufGme4P24BtT0BirHMeMRY/edit?usp=sharing

          Ulli Hafner added a comment - - edited

          This issue will be tackled in the GSoC 2020 project GitHub Checks API.

          Ulli Hafner added a comment - - edited This issue will be tackled in the GSoC 2020 project GitHub Checks API .

          Ulli Hafner added a comment -

          Maybe it makes sense to show charts in the PR as well. In order to do this we need to provide a way to create at least images on Jenkins side and link them from the PR.

          Ulli Hafner added a comment - Maybe it makes sense to show charts in the PR as well. In order to do this we need to provide a way to create at least images on Jenkins side and link them from the PR.

            xiongkezhi Kezhi Xiong
            jeremym Jeremy Marshall
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: