Skip to content

Automation: Pull Requests

aslakknutsen edited this page Mar 11, 2012 · 8 revisions

GitHub -> Hubot -> Jenkins

  • GitHub -> On PullRequest (Opened/Changed/Comment)
    • WebHook -> Hubot /github/pullrequest
      • scan comments for @ike commands, verify command issuer has push request to given repo(admins, module lead)
// create a JIRA issue for pull request if missing from pull request
@ike jira create {
  subject: "Should be able to do bla bla",
  body: "When something something",
  version: "1.0.0.next",
  component: "Extension - Seam2" (default given based on repository)
}
@ike response: Created jira issue ARQ-513 (URL)

// Resolve given issue number, 
// number is optional (taken from subject / commit message / comments if only one given)
@ike jira resolve (ARQ-513)
@ike response: Resolved | Multiple found (ARQ-XX, ARQ-YY), please specify

// create a build job for the branch, rebase 
// (, squash into one commit with message if message defined)
@ike push {
   message: "ARQ-513 Add support for bla bla"
}
@ike response:
  "Build started, jenkins_job_url"

  // when build complete
  "Failed to rebase, please fix issues and try again"
  "Build failed, jenkins_job_url, please fix issues and try again"
  "Build ok, jenkins_job_url. Request pushed upstream, upstream_commit_url" (close pull request)

Automated Validation

On PullRequest

  • if pullrequest is from a forked master branch

    • Ike could respond with information about topic branches and how to recover from squashed upstream master
  • if pullrequest commit messages does not contain a jira issue

    • Ike could respond with a note that a jira is 'required' pr commit
Clone this wiki locally