Exemplo n.º 1
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument(
        '--project-list',
        default=governance.PROJECTS_LIST,
        help='a URL pointing to a projects.yaml file, defaults to %(default)s',
    )
    parser.add_argument(
        '--code-only',
        default=False,
        action='store_true',
        help='only show repositories containing code, not docs or templates',
    )
    parser.add_argument(
        '--team',
        help='the name of the project team, such as "Nova" or "Oslo"',
    )
    parser.add_argument(
        '--deliverable',
        help='the name of the deliverable, such as "nova" or "oslo.config"',
    )
    parser.add_argument(
        '--tag',
        action='append',
        default=[],
        help='the name of a tag, such as "release:managed"',
    )
    args = parser.parse_args()

    team_data = governance.get_team_data()
    repos = governance.get_repositories(
        team_data,
        args.team,
        args.deliverable,
        args.tag,
        code_only=args.code_only,
    )
    for repo in sorted(repos, key=operator.attrgetter('name')):
        print(repo.name)
Exemplo n.º 2
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument(
        '--project-list',
        default=governance.PROJECTS_LIST,
        help='a URL pointing to a projects.yaml file, defaults to %(default)s',
    )
    parser.add_argument(
        '--code-only',
        default=False,
        action='store_true',
        help='only show repositories containing code, not docs or templates',
    )
    parser.add_argument(
        '--team',
        help='the name of the project team, such as "Nova" or "Oslo"',
    )
    parser.add_argument(
        '--deliverable',
        help='the name of the deliverable, such as "nova" or "oslo.config"',
    )
    parser.add_argument(
        '--tag',
        action='append',
        default=[],
        help='the name of a tag, such as "release:managed"',
    )
    args = parser.parse_args()

    team_data = governance.get_team_data(url=args.project_list)
    repos = governance.get_repositories(
        team_data,
        args.team,
        args.deliverable,
        args.tag,
        code_only=args.code_only,
    )
    for repo in sorted(repos, key=operator.attrgetter('name')):
        print(repo.name)
Exemplo n.º 3
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument(
        '--email-tag',
        action='store_true',
        default=False,
        help='print as an email tag for release notes',
    )
    parser.add_argument(
        'repository',
        help='the name of the repository, such as "openstack/nova"',
    )
    args = parser.parse_args()

    team_data = governance.get_team_data()
    try:
        name = governance.get_repo_owner(team_data, args.repository)
    except ValueError as e:
        parser.error(str(e))
    else:
        if args.email_tag:
            name = '[' + name.split(' ')[0].lower() + ']'
        print(name)
Exemplo n.º 4
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument(
        '--project-list',
        default=governance.PROJECTS_LIST,
        help='a URL pointing to a projects.yaml file, defaults to %(default)s',
    )
    parser.add_argument(
        '--releases-repo',
        default=os.path.expanduser('~/repos/openstack/releases'),
        help='path to local copy of the releases repository',
    )
    parser.add_argument(
        '--format', '-f',
        choices=['csv', 'etherpad'],
        default='csv',
    )
    parser.add_argument(
        'series',
        help='the series name',
    )
    args = parser.parse_args()

    # Load all of the existing deliverable data and determine the most
    # recent version tagged.
    latest_versions = {}
    pat = os.path.join(
        args.releases_repo,
        'deliverables',
        args.series,
        '*.yaml',
    )
    for fn in glob.glob(pat):
        with open(fn, 'r') as f:
            y = yaml.safe_load(f.read())
        deliverable = os.path.basename(fn)[:-5]
        v = y['releases'][-1]['version']
        latest_versions[deliverable] = v

    team_data = governance.get_team_data()
    teams = {
        n.lower(): governance.Team(n, i)
        for n, i in team_data.items()
    }

    # Organize deliverables by their release model, whether they are
    # managed, and the team that owns them.
    deliverables_by_model = {
        MILESTONE: {
            'managed': {},
            'unmanaged': {},
        },
        INTERMEDIARY: {
            'managed': {},
            'unmanaged': {},
        },
    }
    for t in teams.values():
        for dn, di in t.deliverables.items():
            for model in deliverables_by_model.keys():
                if model in di.tags:
                    if 'release:managed' in di.tags:
                        managed = 'managed'
                    else:
                        managed = 'unmanaged'
                    dbm_team = deliverables_by_model[model][managed].setdefault(
                        di.team.name.lower(), [])
                    dbm_team.append(di)
                    break

    # Dump the dashboard data
    if args.format == 'csv':
        writer = csv.writer(sys.stdout)
        writer.writerow(
            ('Managed',
             'Release Model',
             'Team',
             'PTL Nick',
             'PTL Email',
             'IRC Channel',
             'Deliverable Type',
             'Deliverable Name',
             'Latest Version'))
        for managed in ['managed', 'unmanaged']:
            for model in [MILESTONE, INTERMEDIARY]:
                short_model = model.rpartition('-')[-1]
                dbm_teams = sorted(deliverables_by_model[model][managed].items())
                for team_name, team_deliverables in dbm_teams:
                    team = teams[team_name]
                    for d in sorted(team_deliverables, key=lambda d: d.name):
                        writer.writerow(
                            (managed,
                             short_model,
                             team.name.lower(),
                             team.data['ptl']['irc'],
                             team.data['ptl']['email'],
                             team.data.get('irc-channel'),
                             d.type,
                             d.name,
                             latest_versions.get(d.name, 'not found')))
    else:
        for managed in ['managed', 'unmanaged']:
            print('{}\n'.format(managed))
            for model in [MILESTONE, INTERMEDIARY]:
                print('  * {}\n'.format(model))
                dbm_teams = sorted(deliverables_by_model[model][managed].items())
                for team_name, team_deliverables in dbm_teams:
                    team = teams[team_name]
                    print('    * {}'.format(team_name))
                    print('      * PTL: {} - {}'.format(
                        team.data['ptl']['irc'],
                        team.data['ptl']['email'],
                    ))
                    print('      * IRC: {}'.format(team.data.get('irc-channel', '')))
                    print('      * Deliverables')
                    for d in sorted(team_deliverables, key=lambda d: d.name):
                        v = latest_versions.get(d.name, 'not found')
                        print('        * {d.name} ({d.type}) [{v}]'.format(d=d, v=v))
                    print()
Exemplo n.º 5
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument(
        '--project-list',
        default=governance.PROJECTS_LIST,
        help='a URL pointing to a projects.yaml file, defaults to %(default)s',
    )
    parser.add_argument(
        '--releases-repo',
        default=os.path.expanduser('~/repos/openstack/releases'),
        help='path to local copy of the releases repository',
    )
    parser.add_argument(
        '--format',
        '-f',
        choices=['csv', 'etherpad'],
        default='csv',
    )
    parser.add_argument(
        'series',
        help='the series name',
    )
    args = parser.parse_args()

    # Load all of the existing deliverable data and determine the most
    # recent version tagged.
    latest_versions = {}
    pat = os.path.join(
        args.releases_repo,
        'deliverables',
        args.series,
        '*.yaml',
    )
    for fn in glob.glob(pat):
        with open(fn, 'r') as f:
            y = yaml.safe_load(f.read())
        deliverable = os.path.basename(fn)[:-5]
        v = y['releases'][-1]['version']
        latest_versions[deliverable] = v

    team_data = governance.get_team_data()
    teams = {n.lower(): governance.Team(n, i) for n, i in team_data.items()}

    # Organize deliverables by their release model, whether they are
    # managed, and the team that owns them.
    deliverables_by_model = {
        MILESTONE: {
            'managed': {},
            'unmanaged': {},
        },
        INTERMEDIARY: {
            'managed': {},
            'unmanaged': {},
        },
    }
    for t in teams.values():
        for dn, di in t.deliverables.items():
            for model in deliverables_by_model.keys():
                if model in di.tags:
                    if 'release:managed' in di.tags:
                        managed = 'managed'
                    else:
                        managed = 'unmanaged'
                    dbm_team = deliverables_by_model[model][
                        managed].setdefault(di.team.name.lower(), [])
                    dbm_team.append(di)
                    break

    # Dump the dashboard data
    if args.format == 'csv':
        writer = csv.writer(sys.stdout)
        writer.writerow(('Managed', 'Release Model', 'Team', 'PTL Nick',
                         'PTL Email', 'IRC Channel', 'Deliverable Type',
                         'Deliverable Name', 'Latest Version'))
        for managed in ['managed', 'unmanaged']:
            for model in [MILESTONE, INTERMEDIARY]:
                short_model = model.rpartition('-')[-1]
                dbm_teams = sorted(
                    deliverables_by_model[model][managed].items())
                for team_name, team_deliverables in dbm_teams:
                    team = teams[team_name]
                    for d in sorted(team_deliverables, key=lambda d: d.name):
                        writer.writerow(
                            (managed, short_model, team.name.lower(),
                             team.data['ptl']['irc'],
                             team.data['ptl']['email'],
                             team.data.get('irc-channel'), d.type, d.name,
                             latest_versions.get(d.name, 'not found')))
    else:
        for managed in ['managed', 'unmanaged']:
            print('{}\n'.format(managed))
            for model in [MILESTONE, INTERMEDIARY]:
                print('  * {}\n'.format(model))
                dbm_teams = sorted(
                    deliverables_by_model[model][managed].items())
                for team_name, team_deliverables in dbm_teams:
                    team = teams[team_name]
                    print('    * {}'.format(team_name))
                    print('      * PTL: {} - {}'.format(
                        team.data['ptl']['irc'],
                        team.data['ptl']['email'],
                    ))
                    print('      * IRC: {}'.format(
                        team.data.get('irc-channel', '')))
                    print('      * Deliverables')
                    for d in sorted(team_deliverables, key=lambda d: d.name):
                        v = latest_versions.get(d.name, 'not found')
                        print('        * {d.name} ({d.type}) [{v}]'.format(
                            d=d, v=v))
                    print()
Exemplo n.º 6
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument(
        '--project-list',
        default=governance.PROJECTS_LIST,
        help='a URL pointing to a projects.yaml file, defaults to %(default)s',
    )
    parser.add_argument(
        '--releases-repo',
        '-r',
        default='.',
        help='path to the releases repository for automatic scanning',
    )
    parser.add_argument(
        '--team',
        help='the name of the project team, such as "Nova" or "Oslo"',
    )
    parser.add_argument(
        '--tag',
        action='append',
        default=[],
        help='the name of a tag, such as "release:managed"',
    )
    parser.add_argument(
        '--verbose',
        '-v',
        action='store_true',
        default=False,
        help='produce detailed output',
    )
    parser.add_argument('series',
                        help='the name of the release series to work on')
    args = parser.parse_args()

    team_data = governance.get_team_data()
    if args.verbose:
        print('# Filtering on team: {}'.format(args.team))
        print('# Filtering on tags: {}'.format(args.tag))
    filtered_repos = {
        r.name
        for r in governance.get_repositories(team_data=team_data,
                                             team_name=args.team,
                                             tags=args.tag,
                                             code_only=True)
    }

    pattern = os.path.join(args.releases_repo, 'deliverables', args.series,
                           '*.yaml')
    deliverable_files = sorted(glob.glob(pattern))

    for filename in deliverable_files:
        if args.verbose:
            print('\n# {}'.format(filename))
        with open(filename, 'r') as f:
            deliverable_data = yaml.safe_load(f)
        releases = deliverable_data.get('releases')
        if not releases:
            if args.verbose:
                print('#  no releases')
            continue
        latest_release = releases[-1]
        projects = latest_release.get('projects')
        if not projects:
            if args.verbose:
                print('#  no projects')
            continue
        for project in projects:
            repo = project['repo']
            if repo in filtered_repos:
                print('make_stable_branch.sh {series} {repo} {version}'.format(
                    series=args.series,
                    repo=repo,
                    version=latest_release['version'],
                ))
            elif args.verbose:
                print('#  {} does not match search criteria'.format(repo))

    return 0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument(
        '--project-list',
        default=governance.PROJECTS_LIST,
        help='a URL pointing to a projects.yaml file, defaults to %(default)s',
    )
    parser.add_argument(
        '--releases-repo', '-r',
        default='.',
        help='path to the releases repository for automatic scanning',
    )
    parser.add_argument(
        '--team',
        help='the name of the project team, such as "Nova" or "Oslo"',
    )
    parser.add_argument(
        '--tag',
        action='append',
        default=[],
        help='the name of a tag, such as "release:managed"',
    )
    parser.add_argument(
        '--verbose', '-v',
        action='store_true',
        default=False,
        help='produce detailed output',
    )
    parser.add_argument(
        'series',
        help='the name of the release series to work on'
    )
    args = parser.parse_args()

    team_data = governance.get_team_data()
    if args.verbose:
        print('# Filtering on team: {}'.format(args.team))
        print('# Filtering on tags: {}'.format(args.tag))
    filtered_repos = {
        r.name
        for r in governance.get_repositories(team_data=team_data,
                                             team_name=args.team,
                                             tags=args.tag,
                                             code_only=True)
    }

    pattern = os.path.join(args.releases_repo, 'deliverables',
                           args.series, '*.yaml')
    deliverable_files = sorted(glob.glob(pattern))

    for filename in deliverable_files:
        if args.verbose:
            print('\n# {}'.format(filename))
        with open(filename, 'r') as f:
            deliverable_data = yaml.safe_load(f)
        releases = deliverable_data.get('releases')
        if not releases:
            if args.verbose:
                print('#  no releases')
            continue
        latest_release = releases[-1]
        projects = latest_release.get('projects')
        if not projects:
            if args.verbose:
                print('#  no projects')
            continue
        for project in projects:
            repo = project['repo']
            if repo in filtered_repos:
                print('make_stable_branch.sh {series} {repo} {version}'.format(
                    series=args.series,
                    repo=repo,
                    version=latest_release['version'],
                ))
            elif args.verbose:
                print('#  {} does not match search criteria'.format(repo))

    return 0