Example #1
0
def list(state='open'):
    """List code reviews (Github Pull Request)

    state: filter by the current state of the review (open | closed)
    """
    reviews = parse(gh_request('GET', '/repos/:user/:repo/pulls'))
    printers.print_review_list(reviews)
Example #2
0
def show(ID):
    """Shows a single code review by its number.

    ID: identifier of the review to be shown 
    """
    review = parse(gh_request('GET', '/repos/:user/:repo/pulls/:id', uri_vars={'id': ID}))
    printers.print_review(review)
Example #3
0
def create(title, head, base='master', message=''):
    """Create a new code review.

    title: short title of the review
    head: reference to changes being merged in
    base: destination of where merge will be applied
    message: long description of review
    """
    review_info = {
        'title': title,
        'body': message,
        'head': head,
        'base': base,
    }

    data = json_encode(review_info)
    review = parse(gh_request('POST', '/repos/:user/:repo/pulls', body=data))
    printers.print_review_created(review)