Ejemplo n.º 1
0
def should_backport(labels=None, milestone=None):
    """return set of PRs marked for backport"""
    if labels is None and milestone is None:
        raise ValueError("Specify one of labels or milestone.")
    elif labels is not None and milestone is not None:
        raise ValueError("Specify only one of labels or milestone.")
    if labels is not None:
        issues = get_issues_list("statsmodels/statsmodels",
                                 labels=labels,
                                 state='closed',
                                 auth=True)
    else:
        milestone_id = get_milestone_id("statsmodels/statsmodels",
                                        milestone,
                                        auth=True)
        issues = get_issues_list("statsmodels/statsmodels",
                                 milestone=milestone_id,
                                 state='closed',
                                 auth=True)

    should_backport = []
    merged_dates = []
    for issue in issues:
        if not is_pull_request(issue):
            continue
        pr = get_pull_request("statsmodels/statsmodels",
                              issue['number'],
                              auth=True)
        if not pr['merged']:
            print("Marked PR closed without merge: %i" % pr['number'])
            continue
        if pr['number'] not in should_backport:
            merged_dates.append(pr['merged_at'])
            should_backport.append(pr['number'])
    return Series(merged_dates, index=should_backport)
Ejemplo n.º 2
0
def should_backport(labels=None, milestone=None):
    """return set of PRs marked for backport"""
    if labels is None and milestone is None:
        raise ValueError("Specify one of labels or milestone.")
    elif labels is not None and milestone is not None:
        raise ValueError("Specify only one of labels or milestone.")
    if labels is not None:
        issues = get_issues_list("ipython/ipython",
                labels=labels,
                state='closed',
                auth=True,
        )
    else:
        milestone_id = get_milestone_id("ipython/ipython", milestone,
                auth=True)
        issues = get_issues_list("ipython/ipython",
                milestone=milestone_id,
                state='closed',
                auth=True,
        )

    should_backport = set()
    for issue in issues:
        if not is_pull_request(issue):
            continue
        pr = get_pull_request("ipython/ipython", issue['number'],
                auth=True)
        if not pr['merged']:
            print ("Marked PR closed without merge: %i" % pr['number'])
            continue
        should_backport.add(pr['number'])
    return should_backport
Ejemplo n.º 3
0
def should_backport(labels=None, milestone=None):
    """return set of PRs marked for backport"""
    if labels is None and milestone is None:
        raise ValueError("Specify one of labels or milestone.")
    elif labels is not None and milestone is not None:
        raise ValueError("Specify only one of labels or milestone.")
    if labels is not None:
        issues = get_issues_list("statsmodels/statsmodels",
                labels=labels,
                state='closed',
                auth=True,
        )
    else:
        milestone_id = get_milestone_id("statsmodels/statsmodels", milestone,
                auth=True)
        issues = get_issues_list("statsmodels/statsmodels",
                milestone=milestone_id,
                state='closed',
                auth=True,
        )

    should_backport = []
    merged_dates = []
    for issue in issues:
        if not is_pull_request(issue):
            continue
        pr = get_pull_request("statsmodels/statsmodels", issue['number'],
                auth=True)
        if not pr['merged']:
            print ("Marked PR closed without merge: %i" % pr['number'])
            continue
        if pr['number'] not in should_backport:
            merged_dates.append(pr['merged_at'])
            should_backport.append(pr['number'])
    return Series(merged_dates, index=should_backport)
Ejemplo n.º 4
0
def should_backport(labels=None, milestone=None, project="ipython/ipython"):
    """return set of PRs marked for backport"""
    if labels is None and milestone is None:
        raise ValueError("Specify one of labels or milestone.")
    elif labels is not None and milestone is not None:
        raise ValueError("Specify only one of labels or milestone.")
    if labels is not None:
        issues = get_issues_list(project,
                                 labels=labels,
                                 state="closed",
                                 auth=True)
    else:
        milestone_id = get_milestone_id(project, milestone, auth=True)
        issues = get_issues_list(project,
                                 milestone=milestone_id,
                                 state="closed",
                                 auth=True)

    should_backport = set()
    for issue in issues:
        if not is_pull_request(issue):
            continue
        pr = get_pull_request(project, issue["number"], auth=True)
        if not pr["merged"]:
            print("Marked PR closed without merge: %i" % pr["number"])
            continue
        if pr["base"]["ref"] != "master":
            continue
        should_backport.add(pr["number"])
    return should_backport
Ejemplo n.º 5
0
def should_backport(labels):
    """return set of PRs marked for backport"""
    issues = get_issues_list("ipython/ipython",
            labels=labels,
            state='closed',
            auth=True,
    )
    should_backport = set()
    for issue in issues:
        if not is_pull_request(issue):
            continue
        pr = get_pull_request("ipython/ipython", issue['number'], auth=True)
        if not pr['merged']:
            print ("Marked PR closed without merge: %i" % pr['number'])
            continue
        should_backport.add(pr['number'])
    return should_backport
Ejemplo n.º 6
0
def should_backport(labels):
    """return set of PRs marked for backport"""
    issues = get_issues_list(
        "ipython/ipython",
        labels=labels,
        state='closed',
        auth=True,
    )
    should_backport = set()
    for issue in issues:
        if not is_pull_request(issue):
            continue
        pr = get_pull_request("ipython/ipython", issue['number'], auth=True)
        if not pr['merged']:
            print("Marked PR closed without merge: %i" % pr['number'])
            continue
        should_backport.add(pr['number'])
    return should_backport
Ejemplo n.º 7
0
    since = round_hour(since)

    milestone = opts.milestone
    project = opts.project

    print("fetching GitHub stats since %s (tag: %s, milestone: %s)" %
          (since, tag, milestone),
          file=sys.stderr)
    if milestone:
        milestone_id = get_milestone_id(project=project,
                                        milestone=milestone,
                                        auth=True)
        issues_and_pulls = get_issues_list(
            project=project,
            milestone=milestone_id,
            state='closed',
            auth=True,
        )
        issues, pulls = split_pulls(issues_and_pulls, project=project)
    else:
        issues = issues_closed_since(since, project=project, pulls=False)
        pulls = issues_closed_since(since, project=project, pulls=True)

    # For regular reports, it's nice to show them in reverse chronological order
    issues = sorted_by_field(issues, reverse=True)
    pulls = sorted_by_field(pulls, reverse=True)

    n_issues, n_pulls = map(len, (issues, pulls))
    n_total = n_issues + n_pulls

    # Print summary report we can directly include into release notes.
Ejemplo n.º 8
0
        if tz[0] == '-':
            since += td
        else:
            since -= td
    
    since = round_hour(since)
    
    milestone = opts.milestone

    print("fetching GitHub stats since %s (tag: %s, milestone: %s)" % (since, tag, milestone), file=sys.stderr)
    if milestone:
        milestone_id = get_milestone_id("ipython/ipython", milestone,
                auth=True)
        issues = get_issues_list("ipython/ipython",
                milestone=milestone_id,
                state='closed',
                auth=True,
        )
    else:
        issues = issues_closed_since(since, pulls=False)
    pulls = issues_closed_since(since, pulls=True)
    
    # For regular reports, it's nice to show them in reverse chronological order
    issues = sorted_by_field(issues, reverse=True)
    pulls = sorted_by_field(pulls, reverse=True)
    
    n_issues, n_pulls = map(len, (issues, pulls))
    n_total = n_issues + n_pulls
    
    # Print summary report we can directly include into release notes.
    
Ejemplo n.º 9
0
            since += td
        else:
            since -= td
    
    since = round_hour(since)
    
    milestone = opts.milestone
    project = opts.project

    print("fetching GitHub stats since %s (tag: %s, milestone: %s)" % (since, tag, milestone), file=sys.stderr)
    if milestone:
        milestone_id = get_milestone_id(project=project, milestone=milestone,
                auth=True)
        issues_and_pulls = get_issues_list(project=project,
                milestone=milestone_id,
                state='closed',
                auth=True,
        )
        issues, pulls = split_pulls(issues_and_pulls, project=project)
    else:
        issues = issues_closed_since(since, project=project, pulls=False)
        pulls = issues_closed_since(since, project=project, pulls=True)
    
    # For regular reports, it's nice to show them in reverse chronological order
    issues = sorted_by_field(issues, reverse=True)
    pulls = sorted_by_field(pulls, reverse=True)
    
    n_issues, n_pulls = map(len, (issues, pulls))
    n_total = n_issues + n_pulls
    
    # Print summary report we can directly include into release notes.
Ejemplo n.º 10
0
            since -= td

    since = round_hour(since)

    milestone = opts.milestone

    print("fetching GitHub stats since %s (tag: %s, milestone: %s)" %
          (since, tag, milestone),
          file=sys.stderr)
    if milestone:
        milestone_id = get_milestone_id("ipython/ipython",
                                        milestone,
                                        auth=True)
        issues_and_pulls = get_issues_list(
            "ipython/ipython",
            milestone=milestone_id,
            state='closed',
            auth=True,
        )
        issues, pulls = split_pulls(issues_and_pulls)
    else:
        issues = issues_closed_since(since, pulls=False)
        pulls = issues_closed_since(since, pulls=True)

    # For regular reports, it's nice to show them in reverse chronological order
    issues = sorted_by_field(issues, reverse=True)
    pulls = sorted_by_field(pulls, reverse=True)

    n_issues, n_pulls = map(len, (issues, pulls))
    n_total = n_issues + n_pulls

    # Print summary report we can directly include into release notes.
Ejemplo n.º 11
0
if __name__ == "__main__":

    if len(sys.argv) < 2:
        milestones = get_milestones("jupyter/nbgrader", auth=True)
    else:
        milestones = sys.argv[1:]

    users = set()
    for milestone in milestones:
        if milestone['title'] == "No action":
            continue

        print("Getting users for {}...".format(milestone['title']))

        # this returns both issues and PRs
        issues = get_issues_list("jupyter/nbgrader",
                                 state='all',
                                 milestone=milestone['number'],
                                 auth=True)

        for issue in issues:
            users.add(issue['user']['login'])

    users = {user.lower(): user for user in users}
    print()
    print("The following users have submitted issues and/or PRs:")
    print("-----------------------------------------------------")
    for user in sorted(users.keys()):
        print("{}".format(users[user]))
    print("-----------------------------------------------------")
Ejemplo n.º 12
0
    get_pulls_list,
    get_issues_list,
)

if __name__ == "__main__":

    if len(sys.argv) != 2:
        print(__doc__)
        sys.exit(1)

    milestone = sys.argv[1]

    milestone_id = get_milestone_id("jupyter/nbgrader", milestone)

    issues = get_issues_list("jupyter/nbgrader",
                             state='all',
                             milestone=milestone_id)

    pulls = get_pulls_list("jupyter/nbgrader",
                           state='merged',
                           milestone=milestone_id)

    users = set()
    for issue in issues:
        users.add(issue['user']['login'])
    for pull in pulls:
        users.add(pull['user']['login'])

    users = {user.lower(): user for user in users}
    print()
    print("The following users have submitted issues and/or PRs:")
)

if __name__ == "__main__":

    if len(sys.argv) != 2:
        print(__doc__)
        sys.exit(1)

    milestone = sys.argv[1]

    milestone_id = get_milestone_id(
        "jupyter/nbgrader",
        milestone)

    issues = get_issues_list(
        "jupyter/nbgrader",
        state='all',
        milestone=milestone_id)

    pulls = get_pulls_list(
        "jupyter/nbgrader",
        state='merged',
        milestone=milestone_id)

    users = set()
    for issue in issues:
        users.add(issue['user']['login'])
    for pull in pulls:
        users.add(pull['user']['login'])

    users = {user.lower(): user for user in users}
    print()
Ejemplo n.º 14
0
    if len(sys.argv) != 2:
        print(__doc__)
        sys.exit(1)

    milestone = sys.argv[1]

    milestone_id = get_milestone_id(
        "jupyter/nbgrader",
        milestone,
        auth=True)

    # this returns both issues and PRs
    issues = get_issues_list(
        "jupyter/nbgrader",
        state='closed',
        milestone=milestone_id,
        auth=True)

    users = set()
    for issue in issues:
        users.add(issue['user']['login'])

    users = {user.lower(): user for user in users}
    print()
    print("The following users have submitted issues and/or PRs:")
    print("-----------------------------------------------------")
    for user in sorted(users.keys()):
        print("- {}".format(users[user]))
    print("-----------------------------------------------------")
Ejemplo n.º 15
0
    if len(sys.argv) < 2:
        milestones = get_milestones("jupyter/nbgrader", auth=True)
    else:
        milestones = sys.argv[1:]

    users = set()
    for milestone in milestones:
        if milestone['title'] == "No action":
            continue

        print("Getting users for {}...".format(milestone['title']))

        # this returns both issues and PRs
        issues = get_issues_list(
            "jupyter/nbgrader",
            state='all',
            milestone=milestone['number'],
            auth=True)

        for issue in issues:
            users.add(issue['user']['login'])

    users = {user.lower(): user for user in users}
    print()
    print("The following users have submitted issues and/or PRs:")
    print("-----------------------------------------------------")
    for user in sorted(users.keys()):
        print("{}".format(users[user]))
    print("-----------------------------------------------------")