diff --git a/data/stackforge-renames b/data/stackforge-renames new file mode 100644 index 0000000000..3496251071 --- /dev/null +++ b/data/stackforge-renames @@ -0,0 +1,246 @@ +aeromancer +akanda +akanda-appliance +akanda-appliance-builder +akanda-horizon +akanda-neutron +akanda-rug +anvil +bansho +blazar +blazar-nova +cathead +ceilometer-powervm +ceilometer-zvm +cerberus +cerberus-dashboard +cl-openstack-client +cloud-init +cloudbase-init +cloudcafe +clouddocs-maven-plugin +cloudkitty +cloudkitty-dashboard +cloudpulse +cloudroast +cloudv-ostf-adapter +cognitive +compass-adapters +compass-core +compass-specs +compass-web +compute-hyperv +designate-msdnsagent +devstack-plugin-glusterfs +devstack-plugin-sheepdog +distil +doc8 +dox +drbd-devstack +driverlog +ec2-api +ec2-driver +entropy +faafo +flame +freezer +freezer-api +freezer-web-ui +fuel-agent +fuel-astute +fuel-dev-tools +fuel-devops +fuel-docs +fuel-library +fuel-main +fuel-mirror +fuel-nailgun-agent +fuel-octane +fuel-ostf +fuel-plugin-availability-zones +fuel-plugin-calamari +fuel-plugin-calico +fuel-plugin-ceilometer-redis +fuel-plugin-cinder-netapp +fuel-plugin-cisco-aci +fuel-plugin-contrail +fuel-plugin-dbaas-trove +fuel-plugin-detach-database +fuel-plugin-detach-keystone +fuel-plugin-detach-rabbitmq +fuel-plugin-elasticsearch-kibana +fuel-plugin-external-emc +fuel-plugin-external-glusterfs +fuel-plugin-external-zabbix +fuel-plugin-glance-nfs +fuel-plugin-ha-fencing +fuel-plugin-influxdb-grafana +fuel-plugin-ironic +fuel-plugin-ldap +fuel-plugin-lma-collector +fuel-plugin-lma-infrastructure-alerting +fuel-plugin-mellanox +fuel-plugin-midonet +fuel-plugin-neutron-fwaas +fuel-plugin-neutron-lbaas +fuel-plugin-neutron-vpnaas +fuel-plugin-nova-nfs +fuel-plugin-nsxv +fuel-plugin-opendaylight +fuel-plugin-saltstack +fuel-plugin-solidfire-cinder +fuel-plugin-swiftstack +fuel-plugin-tintri-cinder +fuel-plugin-tls +fuel-plugin-vmware-dvs +fuel-plugin-vxlan +fuel-plugin-zabbix-monitoring-emc +fuel-plugin-zabbix-monitoring-extreme-networks +fuel-plugin-zabbix-snmptrapd +fuel-plugins +fuel-qa +fuel-specs +fuel-stats +fuel-upgrade +fuel-web +gce-api +gerrit-dash-creator +gertty +git-upstream +golang-client +group-based-policy +group-based-policy-automation +group-based-policy-specs +group-based-policy-ui +inception +intel-nfv-ci-tests +kwapi +merlin +monasca-agent +monasca-api +monasca-ceilometer +monasca-common +monasca-log-api +monasca-notification +monasca-persister +monasca-statsd +monasca-thresh +monasca-ui +monasca-vagrant +monitoring-for-openstack +namos +nerd-reviewer +networking-6wind +networking-bagpipe-l2 +networking-brocade +networking-edge-vpn +networking-hyperv +networking-mlnx +networking-nec +networking-ovs-dpdk +networking-zvm +nova-docker +nova-powervm +nova-solver-scheduler +nova-zvm-virt-driver +ooi +opencafe +ops-tags-team +osprofiler +ospurge +packstack +poppy +powervc-driver +proliantutils +puppet-autossh +puppet-ceph +puppet-n1k-vsm +puppet-setproxy +puppet-surveil +pyghmi +python-blazarclient +python-cerberusclient +python-cloudkittyclient +python-cloudpulseclient +python-cognitiveclient +python-fuelclient +python-group-based-policy-client +python-jenkins +python-monascaclient +python-openstacksdk +python-opentsdbclient +python-rackclient +python-senlinclient +python-sticksclient +python-surveilclient +python-tackerclient +python-watcherclient +rack +radar +requests-mock +sahara-ci-config +senlin +senlin-dashboard +shaker +sqlalchemy-migrate +stackalytics +stacktach +stacktach-klugman +stacktach-notification-utils +stacktach-notigen +stacktach-quince +stacktach-quincy +stacktach-sandbox +stacktach-shoebox +stacktach-simport +stacktach-stackdistiller +stacktach-timex +stacktach-winchester +sticks +sticks-dashboard +surveil +surveil-specs +swift-ceph-backend +swift3 +swiftonfile +tacker +tacker-horizon +tacker-specs +tap-as-a-service +telcowg-usecases +terracotta +third-party-ci-tools +tricircle +turbo-hipster +vmtp +watcher +wsme +xenapi-os-testing +xstatic-angular +xstatic-angular-bootstrap +xstatic-angular-cookies +xstatic-angular-fileupload +xstatic-angular-gettext +xstatic-angular-lrdragndrop +xstatic-angular-mock +xstatic-angular-sanitize +xstatic-angular-smart-table +xstatic-bootstrap-datepicker +xstatic-bootstrap-scss +xstatic-bootswatch +xstatic-d3 +xstatic-font-awesome +xstatic-hogan +xstatic-jasmine +xstatic-jquery-migrate +xstatic-jquery.bootstrap.wizard +xstatic-jquery.quicksearch +xstatic-jquery.tablesorter +xstatic-jsencrypt +xstatic-magic-search +xstatic-mdi +xstatic-qunit +xstatic-rickshaw +xstatic-roboto-fontface +xstatic-spin +yaql diff --git a/data/stackforge-retirements b/data/stackforge-retirements new file mode 100644 index 0000000000..2672f3b9e3 --- /dev/null +++ b/data/stackforge-retirements @@ -0,0 +1,68 @@ +MRaaS +aviator +billingstack +bufunfa +cachemonkey +cinder-salt-formula +cloud-pydashie +cloudv-sdn-validation +compass-install +compass-monit +congressmiddleware +cookbook-pacemaker +fuel-ostf-plugin +fuel-provision +fuel-tasklib +glance-salt-formula +graffiti +haos +healthnmon +heat-coe-templates +horizon-salt-formula +i18n-test +keystone-salt-formula +kickstack +libra +logaas +mercador-pub +mercador-sub +milk +networking-bigswitch +networking-ibm +networking-portforwarding +neutron-salt-formula +nova-salt-formula +novaimagebuilder +occi-os +openstack-cli-powershell +openstack-salt-formula +openstack-sdk-dotnet +openstack-sdk-php +openstackdroid +openvz-nova-driver +packstack-vagrant +pecan +prep-source-repos +puppet-nslcd +puppet-openstack +puppet-openstack-cloud +puppet-openstack_dev_env +puppet_openstack_builder +python-cloudfoundryclient +python-libraclient +python-mercadorclient +python-rallyclient +rubick +sahara-guestagent +saml-generator +satori +sphinxcontrib-docbookrestapi +staccato +striker +swiftpolicy +swiftsync +tomograph +tripleo-ansible +warm +windows-diskimage-builder +xstatic-angular-animate diff --git a/tools/mass_rename_projects.py b/tools/mass_rename_projects.py new file mode 100755 index 0000000000..81ef5fdb61 --- /dev/null +++ b/tools/mass_rename_projects.py @@ -0,0 +1,197 @@ +#! /usr/bin/env python +# +# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This takes a list of projects from stdin in the format of +# aeromancer +# anvil +# blazar +# +# and renames stackforge/aeromancer, stackforge/anvil, and stackforge/blazar +# to openstack/aeromancer, openstack/anvil, and openstack/blazar respectively +# in +# gerrit/projects.yaml +# gerritbot/channels.yaml +# zuul/layout.yaml +# jenkins/jobs/* +# , as well as invoking a series of `git mv` and `git add` commands for +# renaming acl files and otherwise staging a single commit + +import functools +import locale +import os +import subprocess +import sys +import tempfile +import yaml +from collections import OrderedDict +import projectconfig_yamllib as pcy + +def build_list(prefix, renamelist): + return map(lambda x: "%s/%s" % (prefix, x), renamelist) + +def load_yaml_data(filename): + data = yaml.load(open(filename)) # TODO raise error if open fails + return data + +class ProjectData: + def __init__(self, data, gitmoves): + self.data = data + self.gitmoves = gitmoves + +def build_project_data(stacklist, data): + gitmoves = {} + + for project in data: + sproject = project['project'] + oproject = sproject.replace('stackforge','openstack',1) + if sproject in stacklist: + project['project'] = oproject + try: + old = project['acl-config'] + new = old.replace('stackforge','openstack',1) + project['acl-config'] = new + gitmoves[old.replace('/home/gerrit2','gerrit')] = new.replace('/home/gerrit2','gerrit') + except KeyError: + aclfile = "gerrit/acls/%s.config" % sproject + if os.path.isfile(aclfile): + gitmoves[aclfile] = aclfile.replace('stackforge','openstack',1) + + # this is mildly disgusting + sorteddata = sorted(data, key=lambda t: locale.strxfrm(t['project'].lower().replace("_", "}"))) + return ProjectData(sorteddata, gitmoves) + +def rename_in_projects_yaml(stacklist, data): + + errors = False # TODO add error checking + + newdata = build_project_data(stacklist,data).data + + with open('gerrit/projects.yaml', 'w') as out: # TODO raise error if open fails + out.write(yaml.dump(newdata, default_flow_style=False, + Dumper=pcy.IndentedDumper, width=80)) + + return True + +def load_channel_data(filename): + data = yaml.load(open(filename)) # TODO raise error if open fails + return data + +def build_channel_data(stacklist, data): + + for k,v in data.items(): + newprojects = [] + for i in v['projects']: + if i in stacklist: + newprojects.append(i.replace('stackforge','openstack',1)) + else: + newprojects.append(i) + + v['projects'] = sorted(newprojects) + + return data + +def rename_in_channels_yaml(stacklist, ydata): + + errors = False # TODO add error handling + + data = build_channel_data(stacklist, ydata) + + with open('gerritbot/channels.yaml', 'w') as out: + out.write('# This file is sorted alphabetically by channel name.\n') + first = True + for k, v in data.items(): + if not first: + out.write('\n') + first = False + out.write(yaml.dump({k: v}, default_flow_style=False, + Dumper=pcy.IndentedDumper, width=80, indent=2)) + + return True + +def rename_with_sed(zuullayout, targetfile, stacklist, openlist): + errors = False #TODO add error handling + + h, fn = tempfile.mkstemp() + with os.fdopen(h, 'w') as out: + for f,t in zip(stacklist,openlist): + if zuullayout: + out.write("s#name: %s[[:space:]]*$#name: %s#;\n" % (f,t)) + else: + out.write("s#%s\\([ /]\\)#%s\\1#;\n" % (f,t)) + out.write("s#%s$#%s#;\n" % (f,t)) + out.flush() + subprocess.call(['sed', '-f', fn, '-i', targetfile]) + os.unlink(fn) + + return True + +filesToChange = { + 'gerrit/projects.yaml' : { 'data': False, + 'func': rename_in_projects_yaml + }, + 'gerritbot/channels.yaml': { 'data': False, + 'func': rename_in_channels_yaml + }, + 'zuul/layout.yaml' : { 'data': False, + 'func': functools.partial(rename_with_sed, True, 'zuul/layout.yaml') + } +} + +def main(): + locale.setlocale(locale.LC_COLLATE, 'C') + + yaml.add_constructor(yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG, + pcy.construct_yaml_map) + + yaml.add_representer(OrderedDict, pcy.project_representer, + Dumper=pcy.IndentedDumper) + + if os.isatty(0): + sys.stderr.write('You appear to be typing in the list of projects by hand rather than\n') + sys.stderr.write('using file redirection or a pipe. If this is your intent, send an\n') + sys.stderr.write('EOF by typing Ctrl-D on a blank line after the complete list has\n') + sys.stderr.write('been entered.\n\n') + renamelist = [x.rstrip('\n') for x in sys.stdin.readlines()] + stacklist = build_list('stackforge', renamelist) + openlist = build_list('openstack', renamelist) + pdata = build_project_data(stacklist, load_yaml_data('gerrit/projects.yaml')) + + filesToChange['zuul/layout.yaml']['data'] = openlist + + # because Python isn't lazy + filesToChange['gerrit/projects.yaml']['data'] = pdata.data + filesToChange['gerritbot/channels.yaml']['data'] = load_yaml_data('gerritbot/channels.yaml') + + for f in filesToChange: + sys.stderr.write("working on %s\n" % f) + filesToChange[f]['func'](stacklist, filesToChange[f]['data']) + subprocess.call(['git', 'add', f]) + sys.stderr.write("updated %s\n" % f) + + for t in os.listdir('jenkins/jobs'): + f = os.path.join('jenkins/jobs', t) + sys.stderr.write("working on %s\n" % f) + rename_with_sed(False, f, stacklist, openlist) + subprocess.call(['git', 'add', f]) + sys.stderr.write("updated %s\n" % f) + + for s,o in pdata.gitmoves.items(): + sys.stderr.write("renaming %s to %s\n" % (s, o)) + subprocess.call(['git', 'mv', s, o]) + +if __name__ == '__main__': + main() diff --git a/tools/tests/mass_rename_projects_unit_test.py b/tools/tests/mass_rename_projects_unit_test.py new file mode 100755 index 0000000000..2527a7cc61 --- /dev/null +++ b/tools/tests/mass_rename_projects_unit_test.py @@ -0,0 +1,469 @@ +#! /usr/bin/env python +# +# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import unittest +import sys +import yaml +import six + +sys.path.append('tools/') +import mass_rename_projects + +class TestMassRenameProjects(unittest.TestCase): + + # Verify the files we're including in this change process + def test_filesToChange(self): + gotFilenames = mass_rename_projects.filesToChange.keys() + + expectedFilenames = [ + 'gerrit/projects.yaml', + 'gerritbot/channels.yaml', + 'zuul/layout.yaml' + ] + + six.assertCountEqual(self, gotFilenames, expectedFilenames, "Check that we're modifying the expected files") + + # TODO check projects yaml + def test_projects_yaml(self): + renamelist = [ + 'glance', # openstack project that doesn't need to be renamed + 'fuel', # fake project but this text exists in places in the projects.yaml file + 'fuel-tasklib', # stackforge project with groups and other nested attributes + 'xstatic-jquery.tablesorter', # stackforge project with acl attribute + 'anvil', # stackforge project, minimal attributes + 'fake-project', # project name doesn't exist + 'anvil-fake' # non-existant project with similar prefix + ] + + projectYaml = """ +- project: stackforge/anvil + description: A set of python scripts and utilities to forge raw OpenStack into a productive tool! +- project: openstack/glance + docimpact-group: openstack-manuals + description: OpenStack Image Management (Glance) + options: + - translate +- project: stackforge/fuel-stats + groups: + - fuel + description: Fuel anonymous statistics collector + docimpact-group: fuel +- project: stackforge/fuel-tasklib + description: Fuel tasks library. + docimpact-group: fuel + groups: + - fuel +- project: stackforge/xstatic-jquery.tablesorter + description: Tablesorter jQuery plugin packaged as XStatic. + acl-config: /home/gerrit2/acls/stackforge/xstatic.config +- project: stackforge/yaql + description: Yet another query language + """ + data = yaml.load(projectYaml) + + stacklist = mass_rename_projects.build_list("stackforge", renamelist) + + result = mass_rename_projects.build_project_data(stacklist, data) + gotData = result.data + gotGitmoves = result.gitmoves + + # check result + expectedData = [ + { + 'project': 'openstack/anvil', + 'description': 'A set of python scripts and utilities to forge raw OpenStack into a productive tool!' + }, + { + 'project': 'openstack/fuel-tasklib', + 'docimpact-group': 'fuel', + 'description': 'Fuel tasks library.', + 'groups': ['fuel'] + }, + { + 'project': 'openstack/glance', + 'docimpact-group': 'openstack-manuals', + 'description': 'OpenStack Image Management (Glance)', + 'options': ['translate']}, + { + 'project': 'stackforge/fuel-stats', + 'docimpact-group': 'fuel', + 'description': 'Fuel anonymous statistics collector', + 'groups': ['fuel'] + }, + { + 'project': 'openstack/xstatic-jquery.tablesorter', + 'acl-config': '/home/gerrit2/acls/openstack/xstatic.config', + 'description': 'Tablesorter jQuery plugin packaged as XStatic.'}, + { + 'project': 'stackforge/yaql', + 'description': 'Yet another query language' + } + ] + + six.assertCountEqual(self, gotData, expectedData, "Check results of projects.yaml renames") + + # check gitmoves, should only be stackforge projects + expectedGitmoves = { + 'gerrit/acls/stackforge/anvil.config' : 'gerrit/acls/openstack/anvil.config', + 'gerrit/acls/stackforge/xstatic.config' : 'gerrit/acls/openstack/xstatic.config', + 'gerrit/acls/stackforge/fuel-tasklib.config': 'gerrit/acls/openstack/fuel-tasklib.config' + } + + six.assertCountEqual(self, gotGitmoves, expectedGitmoves, "Check git command output for projects.yaml renames") + + def test_channels_yaml(self): + channelsYaml = """ +fuel-tracker: + events: + - patchset-created + - change-merged + - x-vrif-minus-2 + projects: + - openstack/fuel-plugin-bigswitch + - openstack/fuel-plugin-block-device + - openstack/fuel-plugin-openbook + - openstack/fuel-plugin-purestorage-cinder + - openstack/fuel-plugin-scaleio + - openstack/fuel-plugin-wstunnel + - openstack/fuel-plugin-xenserver + - openstack/fuel-plugin-zabbix-agents + - stackforge/fuel-agent + - stackforge/fuel-astute + - stackforge/fuel-dev-tools + - stackforge/fuel-devops + - stackforge/fuel-docs + - stackforge/fuel-library + - stackforge/fuel-main + - stackforge/fuel-mirror + - stackforge/fuel-nailgun-agent + - stackforge/fuel-octane + - stackforge/fuel-ostf + - stackforge/fuel-plugin-availability-zones + - stackforge/fuel-plugin-calamari + - stackforge/fuel-plugin-calico + - stackforge/fuel-plugin-ceilometer-redis + - stackforge/fuel-plugin-cinder-netapp + - stackforge/fuel-plugin-cisco-aci + - stackforge/fuel-plugin-contrail + - stackforge/fuel-plugin-dbaas-trove + - stackforge/fuel-plugin-detach-database + - stackforge/fuel-plugin-detach-keystone + - stackforge/fuel-plugin-detach-rabbitmq + - stackforge/fuel-plugin-elasticsearch-kibana + - stackforge/fuel-plugin-external-emc + - stackforge/fuel-plugin-external-glusterfs + - stackforge/fuel-plugin-external-zabbix + - stackforge/fuel-plugin-glance-nfs + - stackforge/fuel-plugin-ha-fencing + - stackforge/fuel-plugin-influxdb-grafana + - stackforge/fuel-plugin-ironic + - stackforge/fuel-plugin-ldap + - stackforge/fuel-plugin-lma-collector + - stackforge/fuel-plugin-lma-infrastructure-alerting + - stackforge/fuel-plugin-mellanox + - stackforge/fuel-plugin-midonet + - stackforge/fuel-plugin-neutron-fwaas + - stackforge/fuel-plugin-neutron-lbaas + - stackforge/fuel-plugin-neutron-vpnaas + - stackforge/fuel-plugin-nova-nfs + - stackforge/fuel-plugin-nsxv + - stackforge/fuel-plugin-opendaylight + - stackforge/fuel-plugin-saltstack + - stackforge/fuel-plugin-solidfire-cinder + - stackforge/fuel-plugin-swiftstack + - stackforge/fuel-plugin-tintri-cinder + - stackforge/fuel-plugin-tls + - stackforge/fuel-plugin-vmware-dvs + - stackforge/fuel-plugin-vxlan + - stackforge/fuel-plugin-zabbix-monitoring-emc + - stackforge/fuel-plugin-zabbix-monitoring-extreme-networks + - stackforge/fuel-plugin-zabbix-snmptrapd + - stackforge/fuel-plugins + - stackforge/fuel-provision + - stackforge/fuel-qa + - stackforge/fuel-specs + - stackforge/fuel-stats + - stackforge/fuel-tasklib + - stackforge/fuel-upgrade + - stackforge/fuel-web + - stackforge/python-fuelclient + branches: + - master +openstack-anvil: + events: + - patchset-created + - change-merged + - x-vrif-minus-2 + projects: + - stackforge/anvil + branches: + - master +openstack-glance: + events: + - patchset-created + - change-merged + - x-vrif-minus-2 + projects: + - openstack/glance + - openstack/glance-specs + - openstack/glance_store + - openstack/python-glanceclient + branches: + - master +openstack-horizon: + events: + - patchset-created + - change-merged + - x-vrif-minus-2 + projects: + - openstack/django-openstack-auth-kerberos + - openstack/django_openstack_auth + - openstack/horizon + - openstack/manila-ui + - openstack/tuskar-ui + - stackforge/xstatic-angular + - stackforge/xstatic-angular-animate + - stackforge/xstatic-angular-bootstrap + - stackforge/xstatic-angular-cookies + - stackforge/xstatic-angular-fileupload + - stackforge/xstatic-angular-lrdragndrop + - stackforge/xstatic-angular-mock + - stackforge/xstatic-angular-sanitize + - stackforge/xstatic-angular-smart-table + - stackforge/xstatic-bootstrap-datepicker + - stackforge/xstatic-bootstrap-scss + - stackforge/xstatic-d3 + - stackforge/xstatic-font-awesome + - stackforge/xstatic-hogan + - stackforge/xstatic-jasmine + - stackforge/xstatic-jquery-migrate + - stackforge/xstatic-jquery.bootstrap.wizard + - stackforge/xstatic-jquery.quicksearch + - stackforge/xstatic-jquery.tablesorter + - stackforge/xstatic-jsencrypt + - stackforge/xstatic-magic-search + - stackforge/xstatic-qunit + - stackforge/xstatic-rickshaw + - stackforge/xstatic-spin + branches: + - master + """ + + renamelist = [ + 'glance', # openstack project that doesn't need to be renamed + 'fuel', # fake project but this text exists in places in the projects.yaml file + 'fuel-tasklib', # stackforge project with groups and other nested attributes + 'xstatic-jquery.tablesorter', # stackforge project with acl attribute + 'anvil', # stackforge project, minimal attributes + 'fake-project', # project name doesn't exist + 'anvil-fake' # non-existant project with similar prefix + ] + + data = yaml.load(channelsYaml) + + stacklist = mass_rename_projects.build_list("stackforge", renamelist) + + gotData = mass_rename_projects.build_channel_data(stacklist, data) + + # check result + expectedData = { + 'fuel-tracker': { + 'branches': [ + 'master' + ], + 'events': [ + 'patchset-created', + 'change-merged', + 'x-vrif-minus-2' + ], + 'projects': [ + 'openstack/fuel-plugin-bigswitch', + 'openstack/fuel-plugin-block-device', + 'openstack/fuel-plugin-openbook', + 'openstack/fuel-plugin-purestorage-cinder', + 'openstack/fuel-plugin-scaleio', + 'openstack/fuel-plugin-wstunnel', + 'openstack/fuel-plugin-xenserver', + 'openstack/fuel-plugin-zabbix-agents', + 'openstack/fuel-tasklib', + 'stackforge/fuel-agent', + 'stackforge/fuel-astute', + 'stackforge/fuel-dev-tools', + 'stackforge/fuel-devops', + 'stackforge/fuel-docs', + 'stackforge/fuel-library', + 'stackforge/fuel-main', + 'stackforge/fuel-mirror', + 'stackforge/fuel-nailgun-agent', + 'stackforge/fuel-octane', + 'stackforge/fuel-ostf', + 'stackforge/fuel-plugin-availability-zones', + 'stackforge/fuel-plugin-calamari', + 'stackforge/fuel-plugin-calico', + 'stackforge/fuel-plugin-ceilometer-redis', + 'stackforge/fuel-plugin-cinder-netapp', + 'stackforge/fuel-plugin-cisco-aci', + 'stackforge/fuel-plugin-contrail', + 'stackforge/fuel-plugin-dbaas-trove', + 'stackforge/fuel-plugin-detach-database', + 'stackforge/fuel-plugin-detach-keystone', + 'stackforge/fuel-plugin-detach-rabbitmq', + 'stackforge/fuel-plugin-elasticsearch-kibana', + 'stackforge/fuel-plugin-external-emc', + 'stackforge/fuel-plugin-external-glusterfs', + 'stackforge/fuel-plugin-external-zabbix', + 'stackforge/fuel-plugin-glance-nfs', + 'stackforge/fuel-plugin-ha-fencing', + 'stackforge/fuel-plugin-influxdb-grafana', + 'stackforge/fuel-plugin-ironic', + 'stackforge/fuel-plugin-ldap', + 'stackforge/fuel-plugin-lma-collector', + 'stackforge/fuel-plugin-lma-infrastructure-alerting', + 'stackforge/fuel-plugin-mellanox', + 'stackforge/fuel-plugin-midonet', + 'stackforge/fuel-plugin-neutron-fwaas', + 'stackforge/fuel-plugin-neutron-lbaas', + 'stackforge/fuel-plugin-neutron-vpnaas', + 'stackforge/fuel-plugin-nova-nfs', + 'stackforge/fuel-plugin-nsxv', + 'stackforge/fuel-plugin-opendaylight', + 'stackforge/fuel-plugin-saltstack', + 'stackforge/fuel-plugin-solidfire-cinder', + 'stackforge/fuel-plugin-swiftstack', + 'stackforge/fuel-plugin-tintri-cinder', + 'stackforge/fuel-plugin-tls', + 'stackforge/fuel-plugin-vmware-dvs', + 'stackforge/fuel-plugin-vxlan', + 'stackforge/fuel-plugin-zabbix-monitoring-emc', + 'stackforge/fuel-plugin-zabbix-monitoring-extreme-networks', + 'stackforge/fuel-plugin-zabbix-snmptrapd', + 'stackforge/fuel-plugins', + 'stackforge/fuel-provision', + 'stackforge/fuel-qa', + 'stackforge/fuel-specs', + 'stackforge/fuel-stats', + 'stackforge/fuel-upgrade', + 'stackforge/fuel-web', + 'stackforge/python-fuelclient' + ] + }, + 'openstack-glance': { + 'branches': [ + 'master' + ], + 'events': [ + 'patchset-created', + 'change-merged', + 'x-vrif-minus-2' + ], + 'projects': [ + 'openstack/glance', + 'openstack/glance-specs', + 'openstack/glance_store', + 'openstack/python-glanceclient' + ] + }, + 'openstack-anvil': { + 'branches': [ + 'master' + ], + 'events': [ + 'patchset-created', + 'change-merged', + 'x-vrif-minus-2' + ], + 'projects': [ + 'openstack/anvil' + ] + }, + 'openstack-horizon': { + 'branches': [ + 'master' + ], + 'events': [ + 'patchset-created', + 'change-merged', + 'x-vrif-minus-2' + ], + 'projects': [ + 'openstack/django-openstack-auth-kerberos', + 'openstack/django_openstack_auth', + 'openstack/horizon', + 'openstack/manila-ui', + 'openstack/tuskar-ui', + 'openstack/xstatic-jquery.tablesorter', + 'stackforge/xstatic-angular', + 'stackforge/xstatic-angular-animate', + 'stackforge/xstatic-angular-bootstrap', + 'stackforge/xstatic-angular-cookies', + 'stackforge/xstatic-angular-fileupload', + 'stackforge/xstatic-angular-lrdragndrop', + 'stackforge/xstatic-angular-mock', + 'stackforge/xstatic-angular-sanitize', + 'stackforge/xstatic-angular-smart-table', + 'stackforge/xstatic-bootstrap-datepicker', + 'stackforge/xstatic-bootstrap-scss', + 'stackforge/xstatic-d3', + 'stackforge/xstatic-font-awesome', + 'stackforge/xstatic-hogan', + 'stackforge/xstatic-jasmine', + 'stackforge/xstatic-jquery-migrate', + 'stackforge/xstatic-jquery.bootstrap.wizard', + 'stackforge/xstatic-jquery.quicksearch', + 'stackforge/xstatic-jsencrypt', + 'stackforge/xstatic-magic-search', + 'stackforge/xstatic-qunit', + 'stackforge/xstatic-rickshaw', + 'stackforge/xstatic-spin' + ] + } +} + six.assertCountEqual(self, gotData, expectedData, "Check result for channels.yaml renames") + + # TODO check zuul layout + def test_zuul_layout(self): + renamelist = [ + 'glance', # openstack project that doesn't need to be renamed + 'fuel', # fake project but this text exists in places in the projects.yaml file + 'fuel-tasklib', # stackforge project with groups and other nested attributes + 'xstatic-jquery.tablesorter', # stackforge project with acl attribute + 'anvil', # stackforge project, minimal attributes + 'fake-project', # project name doesn't exist + 'anvil-fake' # non-existant project with similar prefix + ] + + # not currently needed because the actual script shells out to sed + layoutYaml = """ + """ + + openlist = mass_rename_projects.build_list('openstack', renamelist) # zuul layout just uses the openlist as its data + + expectedOpenlist = [ + 'openstack/glance', + 'openstack/fuel', + 'openstack/fuel-tasklib', + 'openstack/xstatic-jquery.tablesorter', + 'openstack/anvil', + 'openstack/fake-project', + 'openstack/anvil-fake' + ] + + six.assertCountEqual(self, openlist, expectedOpenlist, "Check zuul layout data") + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/tox.ini b/tox.ini index 0e111a4cc7..9764c6a353 100644 --- a/tox.ini +++ b/tox.ini @@ -87,3 +87,9 @@ deps = flake8 changedir = {toxinidir}/nodepool commands = dib-lint + +[testenv:renames] +deps = PyYAML + six +commands = + {toxinidir}/tools/tests/mass_rename_projects_unit_test.py