From 40f58462809777fb4b73fa488f65c6a287055aee Mon Sep 17 00:00:00 2001 From: Armando Migliaccio Date: Fri, 26 Aug 2016 12:24:29 -0700 Subject: [PATCH] Make milestone-review-dash script pull all Stadium projects Change-Id: I2ba04d777001ebac12e5cbeaf5d530c932cc99f7 --- tools/milestone-review-dash.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/tools/milestone-review-dash.py b/tools/milestone-review-dash.py index bc26729fc64..aa485769cb2 100755 --- a/tools/milestone-review-dash.py +++ b/tools/milestone-review-dash.py @@ -11,8 +11,11 @@ # 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 argparse import sys +import urllib2 +import yaml from launchpadlib.launchpad import Launchpad @@ -113,6 +116,13 @@ def write_queries_for_project(f, project, milestone): write_section(f, section_name, query) +def get_stadium_projects(): + data = urllib2.urlopen("http://git.openstack.org/cgit/openstack/" + "governance/plain/reference/projects.yaml") + governance = yaml.load(data) + return governance["neutron"]["deliverables"].keys() + + parser = argparse.ArgumentParser( description='Create dashboard for critical/high bugs, approved rfe and' ' blueprints. A .dash file will be created in the current' @@ -146,12 +156,12 @@ with open(file_name, 'w') as f: title = "[dashboard]\ntitle = Neutron %s Review Inbox\n" % milestone f.write(title) f.write("description = Review Inbox\n") - f.write("foreach = (project:openstack/neutron OR " - "project:openstack/python-neutronclient OR " - "project:openstack/neutron-specs OR " - "project:openstack/neutron-fwaas OR " - "project:openstack/neutron-lbaas OR " - "project:openstack/neutron-vpnaas) status:open NOT owner:self " + f.write("foreach = (") + projects_query = [ + "project:openstack/%s" % p for p in get_stadium_projects() + ] + f.write(' OR '.join(projects_query)) + f.write(") status:open NOT owner:self " "NOT label:Workflow<=-1 " "NOT label:Code-Review>=-2,self branch:master\n") f.write("\n")