Hi Tomas,

      I hope you are doing great.

      I needed small info, basically it is the DSL code for "Violation Comments to GitHub Plugin“

      Actually I have most of the below code:

      ##

      violationsToGitHubRecorder {
      createSingleFileComments(true)
      createCommentWithAllSingleFileComments(false)
      repositoryName(repoName)
      repositoryOwner(‘jen1')
      password('')
      username('')
      oAuth2Token('')
      pullRequestId('${ghprbPullId}')
      gitHubUrl('https://github.inmobi.com/api/v3')
      commentOnlyChangedContent(true)
      usernamePasswordCredentialsId('false')
      useOAuth2Token(false)
      useUsernamePassword(false)
      useUsernamePasswordCredentials(true)
      ###

      However the problem is how to to add “pattern” part to it? so it get automatically comes up?
      If you see the screen shot, then there is nothing coming under pattern block?
      Let me know if you have any inputs to share?

      Thanks,
      Giiraj

          [JENKINS-37196] DSL for Violation Comments to GitHub Plugin

          Tomas Bjerre added a comment -

          Also add:

              import org.jenkinsci.plugins.jvctg.config.ViolationConfig;
              import se.bjurr.violations.lib.reports.Reporter;
          

          There is an example in the readme at: https://github.com/jenkinsci/violation-comments-to-github-plugin

          Tomas Bjerre added a comment - Also add: import org.jenkinsci.plugins.jvctg.config.ViolationConfig; import se.bjurr.violations.lib.reports.Reporter; There is an example in the readme at: https://github.com/jenkinsci/violation-comments-to-github-plugin

          Giriraj Gujar added a comment - - edited

          Thanks Tomas for your reply once again.

          I tried adding at the top of my project and got following error:

          • ##################################################*

          [mvn-dsl-giri] $ /bin/bash /tmp/hudson165362560657593151.sh
          Processing DSL script maven_pull_request_seed.groovy
          ERROR: startup failed:
          workspace:/maven_pull_request_seed.groovy: 1: unable to resolve class org.jenkinsci.plugins.jvctg.config.ViolationConfig
          @ line 1, column 1.
          import org.jenkinsci.plugins.jvctg.config.ViolationConfig;
          ^

          workspace:/maven_pull_request_seed.groovy: 2: unable to resolve class se.bjurr.violations.lib.reports.Reporter
          @ line 2, column 1.
          import se.bjurr.violations.lib.reports.Reporter;
          ^

          2 errors
          ##################################################

          So, Do I need to make this as Java programme? Like create pom etc or Is there a shorter way?

          How can I overcome from it?

          I am also attaching my groovy file so you can have a look.

          Please note, that's the only file I have in my DSL.

          Thanks,
          Giriraj

          Giriraj Gujar added a comment - - edited Thanks Tomas for your reply once again. I tried adding at the top of my project and got following error: ##################################################* [mvn-dsl-giri] $ /bin/bash /tmp/hudson165362560657593151.sh Processing DSL script maven_pull_request_seed.groovy ERROR: startup failed: workspace:/maven_pull_request_seed.groovy: 1: unable to resolve class org.jenkinsci.plugins.jvctg.config.ViolationConfig @ line 1, column 1. import org.jenkinsci.plugins.jvctg.config.ViolationConfig; ^ workspace:/maven_pull_request_seed.groovy: 2: unable to resolve class se.bjurr.violations.lib.reports.Reporter @ line 2, column 1. import se.bjurr.violations.lib.reports.Reporter; ^ 2 errors ################################################## So, Do I need to make this as Java programme? Like create pom etc or Is there a shorter way? How can I overcome from it? I am also attaching my groovy file so you can have a look. Please note, that's the only file I have in my DSL. Thanks, Giriraj

          Giriraj Gujar added a comment -

          Hi Tomas,

          Let me know if you have any suggestions.

          It will be huge help.

          Thanks,
          Giriraj

          Giriraj Gujar added a comment - Hi Tomas, Let me know if you have any suggestions. It will be huge help. Thanks, Giriraj

          Tomas Bjerre added a comment -

          I was fiddling with this a bit but did not manage to do what you want.

          I found this commit: https://github.com/jenkinsci/ghprb-plugin/commit/882bbd79f73e2099c7c1125ce5994d0952cf4464
          I think something like that is needed in this plugin to enable a nice DSL here.

          I may have time later today to look at it.

          Tomas Bjerre added a comment - I was fiddling with this a bit but did not manage to do what you want. I found this commit: https://github.com/jenkinsci/ghprb-plugin/commit/882bbd79f73e2099c7c1125ce5994d0952cf4464 I think something like that is needed in this plugin to enable a nice DSL here. I may have time later today to look at it.

          Giriraj Gujar added a comment -

          Sure Tomas for the hint.

          I will also see what I can do.

          Let me know if you find out anything? will be huge favor.

          Giriraj Gujar added a comment - Sure Tomas for the hint. I will also see what I can do. Let me know if you find out anything? will be huge favor.

          Giriraj Gujar added a comment -

          Basically, the problem I am facing, How to use Java class in a stand alone groovy script.

          Giriraj Gujar added a comment - Basically, the problem I am facing, How to use Java class in a stand alone groovy script.

          Tomas Bjerre added a comment -

          I just made a release, will be in the update site within a few hours. The DSL is now:

          violationsToGitHubRecorder {
          createSingleFileComments(boolean value)
          createCommentWithAllSingleFileComments(boolean value)
          repositoryName(String value)
          repositoryOwner(String value)
          password(String value)
          username(String value)
          oAuth2Token(String value)
          pullRequestId(String value)
          gitHubUrl(String value)
          commentOnlyChangedContent(boolean value)
          violationConfigs {
           violationConfig {
            reporter(String value)
            pattern(String value)
           }
          }
          usernamePasswordCredentialsId(String value)
          useOAuth2Token(boolean value)
          useUsernamePasswordCredentials(boolean value)
          useUsernamePassword(boolean value)
          }
          

          Tomas Bjerre added a comment - I just made a release, will be in the update site within a few hours. The DSL is now: violationsToGitHubRecorder { createSingleFileComments( boolean value) createCommentWithAllSingleFileComments( boolean value) repositoryName( String value) repositoryOwner( String value) password( String value) username( String value) oAuth2Token( String value) pullRequestId( String value) gitHubUrl( String value) commentOnlyChangedContent( boolean value) violationConfigs { violationConfig { reporter( String value) pattern( String value) } } usernamePasswordCredentialsId( String value) useOAuth2Token( boolean value) useUsernamePasswordCredentials( boolean value) useUsernamePassword( boolean value) }

          Tomas Bjerre added a comment -

          I just made a new release, changed the DSL a bit.

          Use the examples from the README at: https://github.com/jenkinsci/violation-comments-to-github-plugin

          Tomas Bjerre added a comment - I just made a new release, changed the DSL a bit. Use the examples from the README at: https://github.com/jenkinsci/violation-comments-to-github-plugin

          Giriraj Gujar added a comment -

          Hi Tomas,

          Thank you so much.

          However I don't see it here: https://wiki.jenkins-ci.org/display/JENKINS/Violation+Comments+to+GitHub+Plugin

          It is still showing "Latest Release" as 1.12 only?

          Does it usually takes time to update on wiki?

          Thanks,
          Giriraj

          Giriraj Gujar added a comment - Hi Tomas, Thank you so much. However I don't see it here: https://wiki.jenkins-ci.org/display/JENKINS/Violation+Comments+to+GitHub+Plugin It is still showing "Latest Release" as 1.12 only? Does it usually takes time to update on wiki? Thanks, Giriraj

          Tomas Bjerre added a comment -

          The wiki is a bit slow. But 1.14 is in the update site: http://mirror.xmission.com/jenkins/updates/current/update-center.json

          Tomas Bjerre added a comment - The wiki is a bit slow. But 1.14 is in the update site: http://mirror.xmission.com/jenkins/updates/current/update-center.json

            tomasbjerre Tomas Bjerre
            giriraj_2k5 Giriraj Gujar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: