Re: ghprb plugin

98 views
Skip to first unread message

Daniel Spilker

unread,
Jul 7, 2016, 3:05:59 AM7/7/16
to Greg Fogelberg, job-dsl...@googlegroups.com
Hi Greg,

please use this Job DSL mailing list for any questions. I put the list in CC.

Are you using the latest version GHPRB? You need at least version 1.29.7, but 1.32.x would be better.

Daniel

On Thu, Jun 30, 2016 at 5:14 PM, Greg Fogelberg <greg.fo...@gmail.com> wrote:
Hi Daniel,

Thanks for you feedback on https://github.com/jenkinsci/ghprb-plugin/pull/372

I'm not sure what your preferred method of communication is, but I'm unable to find any documentation on how to get the ghprb-plugin to be recognized in my DSL files.

I have a helper file which throws a deprecation warning when I use pullRequest (as expected) but throws the following error when I use githubPullRequest:

Caused by: javaposse.jobdsl.dsl.DslScriptException: (PullRequestBuilder.groovy, line 22) No signature of method: javaposse.jobdsl.dsl.helpers.triggers.TriggerContext.githubPullRequest() is applicable for argument types: (helpers.PullRequestBuilder$_pullRequestTrigger_closure1_closure5_closure6) values: [helpers.PullRequestBuilder$_pullRequestTrigger_closure1_closure5_closure6@f0f2775]


My Helper file is as follows:

package helpers

/**
 * Usage:
 * import static helpers.PullRequestBuilder.*
 * 
 * job {
 *     with pullRequestTrigger('project', '${sha1}', 'upstream_build')
 * }
 */
class PullRequestBuilder {
  static Closure pullRequestTrigger(String project, String branch_name, String upstream_build = '') {
    return {
      with projectRepo(project, branch_name) {
        def urcNode = it.userRemoteConfigs.'hudson.plugins.git.UserRemoteConfig'.find()
        urcNode << refspec('+refs/pull/*:refs/remotes/origin/pr/*')
      }
      triggers {
        if (upstream_build != '') {
          upstream(upstream_build, 'FAILURE')
        }
        githubPullRequest {
            orgWhitelist(['org'])
        }
      }
    }
  }
  static Closure projectRepo(String project, String branch_name, Closure gitClosure = {}) {
    return {
      scm {
        github('org/'+project, branch_name, 'ssh', gitClosure)
      }
    }
  }
}

Thanks,
Greg

Reply all
Reply to author
Forward
0 new messages