bbc/github_informer

Name: github_informer

Owner: BBC

Description: Gem for submitting useful metadata to github to inform pull requests

Created: 2015-07-29 09:22:07.0

Updated: 2015-08-07 12:38:04.0

Pushed: 2015-08-07 13:16:33.0

Homepage: null

Size: 244

Language: Ruby

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

github_informer

Gem for submitting useful metadata to github to inform pull requests

Submitting CI information

GithubInformer lets you wrap execution of your test or build scripts with github hooks to let you add CI status check information to your commits. These status checks appear alongside your pull request discussion in github and help with the conversation.

Authentication

github_informer uses OAuth access tokens to manage access. You should set the



Using the CLI

CLI is the easiest method of capturing your status checks. Simply install
gem and wrap your ci commands like this example:

gh_execute --cmd 'bundle exec rspec'

can add a context to the execution so it's more identifiable in github:

gh_execute --context 'Rspec tests' --cmd 'bundle exec rspec'

e are numerous optional arguments for more control:

gh_execute --cmd 'bundle exec rspec'
          [--context <CONTEXT>]
          [--path <PATH_TO_CHECKOUT>]
          [--url <URL_LINK_TO_CI_JOB>]

ou're running in jenkins, url will automatically get picked up by the
ronment.

Using the API

can have much more control over the messages that get reported into github
ou write a ruby script to wrap your execution. For example, the following
pt gives comprehensive failure messages:

# Create new informer
g = GithubInformer.new(:context => 'HiveCI', :url => ENV['HIVE_JOB_URL'] )

# Add a pending status check to github
g.report_start( :description => 'Executing unit tests in Hive environment')

# Wrap execution of the script
g.execute( 'bundle exec rake unittests' )

# Report a different message depending on the exit value of the script
g.report_end( 0      => [:pass, 'Unit tests were fine: good to merge'],
              1      => [:pending, 'Tests are re-running. Hold off merge.'],
              2..200 => [:fail, 'Unit test failure. Do not merge'] )

icense

ubInformer is available to everyone under the terms of the MIT open source licence. 
 a look at the LICENSE file in the code.

right (c) 2015 BBC

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.