Project

pully

0.0
No commit activity in last 3 years
No release in over 3 years
Create your own pull request GitHub bot with ease
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6
~> 10.3
~> 3.2

Runtime

~> 0.12.17
~> 1.2.9.1
~> 3.0
~> 0.19
 Project Readme

pully: A ruby library for managing GitHub pull requests

Gem Version Build Status Bitdeli Badge License

What is this?

Pully is a ruby library for managing GitHub pull requests; purpose built for our continuous integration & deployment infrastructure at FittrĀ®.

Selling points

  1. It's easy to use
  2. It has full code coverage on tests involving GitHub's API
  3. While it uses the pull request interface on GitHub, it does not use the big green button to perform a merge.

Basic usage

require 'pully'

#Create a new pully object, each pully object targets (1) repository.
pully = Pully.new(user:"github_username", pass:"github_password", repo:"my_repository")

#Get a list of all open pull requests (An array of pull numbers)
open = pully.pull_requests

#Get a list of all open pull requests marked as pending or success
open_and_pending_or_success = pully.open_or_pending_pull_requests

#Create a new pull request to merge 'my_branch' into 'master' with the title 'My pull request' and the message 'Hey XXX...'
pull_number = pully.create_pull_request(from:"my_branch", to:"master", subject:"My pull request", message:"Hey XXXX, can you merge this for me?")

#Comment on that pull request
pully.write_comment_to_pull_request(pull_number, "Test Comment")

#Get all comments
comments = pully.comments_for_pull_request(pull_number)

#Get the SHA of the 'from' branch of a certain pull request
pully.sha_for_pull_request(pull_number)

#Set the status of a pull request to pending (Other options include 'error', 'failed', and 'success')
pully.set_pull_request_status(pull_number, "pending")

#Set the status of a pull request to ready
pully.set_pull_request_status(pull_number, "success")

#Merge the request (Will NOT use GitHub's pull request merge, will merge commits into history as-is)
pully.merge_pull_request(pull_number)

Organization Repositories

If your repositories are not owner by you, i.e. they are owned by an organization or another user who has granted you permissions, you will need to pass the owner field for the other individual or organization.

#Create a new pully object, each pully object targets (1) repository in an organization.
pully = Pully.new(user:"github_username", pass:"github_password", repo:"my_repository", owner:"my_organization")

Requirements

  • Ruby 2.1 or Higher

Communication

  • If you found a bug, submit a pull request.
  • If you have a feature request, submit a pull request.
  • If you want to contribute, submit a pull request.

Installation

Run sudo gem install pully

Known issues

  1. GitHub does not register commits immediately after a push is received. Things like sha_for_pull_request will return old values if you don't wait several seconds
  2. GitHub's status API for pull requests returns 'pending' even if the UI says 'success'. We account for this bug, but if it is fixed in the future, then our specs will catch it

FAQ

When should I use pully?

When you want to automate GitHub pull requests. Pully provides the necessary facilities for you to authenticate and control GitHub pull requests in any way you wish. Duplicate the functionality of many popular CI solutions.

What's Fittr?

Fittr is a SaaS company that focuses on providing personalized workouts and health information to individuals and corporations through phenomenal interfaces and algorithmic data-collection and processing.


Creator

License

pully is released under the MIT license. See LICENSE for details.