Exemple #1
0
def openedx_release_repos(hub, orgs=None, branches=None):
    """
    Return a subset of the repos with openedx.yaml files: the repos
    with an `openedx-release` section.

    Arguments:
        hub (:class:`~github3.GitHub`): an authenticated GitHub instance.
        orgs (list of str): The GitHub organizations to scan. Defaults to edx, edx-ops, and
              edx-solutions.
        branches (list of str): The branches to scan in all repos in the selected
                  orgs, defaulting to the repo's default branch.

    Returns:
        A dict from :class:`~github3.Repository` objects to openedx.yaml data for all of the
        repos with an ``openedx-release`` key specified.

    """
    if not orgs:
        orgs = ['edx', 'edx-ops', 'edx-solutions']

    repos = {}

    for repo, data in tqdm(iter_openedx_yaml(hub, orgs=orgs,
                                             branches=branches),
                           desc='Find repos'):
        if data.get('openedx-release'):
            repo = repo.refresh()
            repos[repo] = data

    return repos
Exemple #2
0
def openedx_release_repos(hub, orgs=None, branches=None):
    """
    Return a subset of the repos with openedx.yaml files: the repos
    with an `openedx-release` section.


    Arguments:
        hub (GitHub): an authenticated GitHub instance.
        orgs: The list of GitHub orgs to scan. Defaults to edx, edx-ops, and
              edx-solutions.
        branches: The list of branches to scan in all repos in the selected
                  orgs.

    Returns:
        A dict from Repository objects to openedx.yaml data for all of the
        repos with an ``openedx-release`` key specified.
    """
    if not orgs:
        orgs = ['edx', 'edx-ops', 'edx-solutions']

    return {
        repo: data
        for repo, data in iter_openedx_yaml(
            hub,
            orgs=orgs,
            branches=branches,
        )
        if data.get('openedx-release')
    }
Exemple #3
0
def sync_labels(hub, repo_tools_data, org, repo, dry):
    if repo is not None:
        repos = [(hub.repository(*repo.split('/')), None)]
    else:
        repos = sorted(iter_openedx_yaml(hub, org))
    for repo, _ in repos:
        print("Updating labels in {}".format(repo))
        set_or_delete_labels(dry, repo, repo_tools_data.labels)
def implode(hub, org, branch):
    """
    Implode all openedx.yaml files, and print the results as formatted output.
    """
    data = {
        repo.full_name: openedx_yaml
        for repo, openedx_yaml
        in iter_openedx_yaml(hub, org, branch)
    }
    click.echo(yaml.safe_dump(data, encoding=None, indent=4))
Exemple #5
0
def sync_labels(hub, repo_tools_data, org, repo, dry):
    """Update the labels in repos to have consistent text and colors."""
    if repo is not None:
        repos = [(hub.repository(*repo.split('/')), None)]
    else:
        repos = sorted(iter_openedx_yaml(hub, org))
    for repo, _ in repos:
        print("Updating labels in {}".format(repo))
        set_or_delete_labels(
            dry,
            repo,
            repo_tools_data.labels
        )
Exemple #6
0
def sync_labels(hub, repo_tools_data, org, dry):
    for repo, openedx_yaml in sorted(iter_openedx_yaml(hub, org)):
        print("Copying labels into {}".format(repo))
        set_or_delete_labels(dry, repo, repo_tools_data.labels)