コード例 #1
0
ファイル: tag_release.py プロジェクト: eduplusca/repo-tools
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
コード例 #2
0
ファイル: tag_release.py プロジェクト: edx/repo-tools
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')
    }
コード例 #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)
コード例 #4
0
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))
コード例 #5
0
ファイル: sync_labels.py プロジェクト: edx/repo-tools
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
        )
コード例 #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)