Exemple #1
0
def pull_from_github(repository_url):
    g = authenticate_github()
    repository = g.get_repo(repository_url)

    requirements = {issue.number: {'title': issue.title, 'description': remove_carriage_return(issue.body)}
                    for issue in repository.get_issues()
                    if 'requirement' in issue.labels}
    print('Found {} requirement(s)'.format(len(requirements)))

    problem_reports = {issue.number: {'title': issue.title, 'description': remove_carriage_return(issue.body)}
                       for issue in repository.get_issues()
                       if 'problem-report' in issue.labels}
    print('Found {} problem report(s)'.format(len(problem_reports)))

    return requirements, problem_reports
Exemple #2
0
def build_approval(github_review):
    return OrderedDict([
        ('id', str(github_review.id)),
        ('reviewer', build_person(github_review.user)),
        ('content', remove_carriage_return(github_review.body)),
        ('url', github_review.html_url),
    ])
Exemple #3
0
def change_body(body):
    cleaned = remove_carriage_return(body)
    lines = cleaned.split('\n')

    # Prune out lines that just display the issue number, since the association
    # to an issue is displayed already within the documents, and thus showing
    # it again in the body would be superfluous
    return '\n'.join(l for l in lines if not l.startswith('Issue #')).strip()
Exemple #4
0
def build_change_request(issue):
    # TODO: in all places where we use issue.body and pull_request.body,
    # replace @-mentions with the people's names.
    # TODO: figure out how to connect to parent change requests

    return OrderedDict([
        ('id', str(issue.number)),
        ('title', issue.title),
        ('content', remove_carriage_return(issue.body)),
        ('change_ids', []),
        ('is_problem_report', _is_problem_report(issue.labels)),
        ('url', issue.html_url),
        ('release_id', issue.milestone and issue.milestone.title),
    ])
Exemple #5
0
def build_change_request(issue):
    # TODO: in all places where we use issue.body and pull_request.body,
    # replace @-mentions with the people's names.
    # TODO: consider adding an explicity "approved_by" field, if there is a way
    # to derive this...
    # TODO: figure out how to connect to parent change requests
    return OrderedDict([
        ('id', str(issue.number)),
        ('title', issue.title),
        ('content', remove_carriage_return(issue.body)),
        ('change_ids', []),
        ('is_problem_report', _is_problem_report(issue.labels)),
        ('url', issue.html_url),
    ])