def test_deliverable_name(self): repos = governance.get_repositories( TEAM_DATA, None, 'cookies', [], code_only=False, ) repo_names = sorted(r.name for r in repos) self.assertEqual( ['openstack-test/cookies-cookiecutter'], repo_names, )
def test_deliverable_tag(self): repos = governance.get_repositories( TEAM_DATA, None, None, ['tc-approved-release'], code_only=False, ) repo_names = sorted(r.name for r in repos) self.assertEqual( ['openstack/cinder'], repo_names, )
def test_team_name(self): repos = governance.get_repositories( TEAM_DATA, 'Cookies', None, [], code_only=False, ) repo_names = [r.name for r in repos] self.assertEqual( ['openstack-test/cookies-cookiecutter'], repo_names, )
def test_team_tag(self): repos = governance.get_repositories( TEAM_DATA, None, None, ['team:diverse-affiliation'], code_only=False, ) repo_names = sorted(r.name for r in repos) self.assertEqual( sorted(['openstack/cinder', 'openstack/cinder-specs', 'openstack/os-brick', 'openstack/python-cinderclient']), repo_names, )
def test_team_tag(self): repos = governance.get_repositories( TEAM_DATA, None, None, ['team:diverse-affiliation'], code_only=False, ) repo_names = sorted(r.name for r in repos) self.assertEqual( sorted([ 'openstack/cinder', 'openstack/cinder-specs', 'openstack/os-brick', 'openstack/python-cinderclient' ]), repo_names, )
def test_code_only(self): repos = governance.get_repositories( TEAM_DATA, None, None, [], code_only=True, ) repo_names = sorted(r.name for r in repos) self.assertEqual( sorted([ 'openstack/barbican', 'openstack/python-barbicanclient', 'openstack/castellan', 'openstack/kite', 'openstack/python-kiteclient', 'openstack/cinder', 'openstack/os-brick', 'openstack/python-cinderclient' ]), repo_names, )
def test_code_only(self): repos = governance.get_repositories( TEAM_DATA, None, None, [], code_only=True, ) repo_names = sorted(r.name for r in repos) self.assertEqual( sorted(['openstack/barbican', 'openstack/python-barbicanclient', 'openstack/castellan', 'openstack/kite', 'openstack/python-kiteclient', 'openstack/cinder', 'openstack/os-brick', 'openstack/python-cinderclient']), repo_names, )
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)
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)
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