Pull stadium projects from governance.o.o in utility script

For housekeeping reasons we have abandon_old_reviews.sh that is
used to purge blocked reviews from Gerrit. The project query
should be extended to all stadium projects. To avoid hard coding,
fetch the list from governance.o.o, parse it and feed it to
the rest of the script.

Change-Id: Iad40d78b7a72a4435382406373bb9f15c0ffc4a7
This commit is contained in:
Armando Migliaccio 2016-07-05 16:22:11 -07:00
parent 15aa18673a
commit acb6a950ed

@ -50,9 +50,19 @@ function abandon_review {
fi
}
PROJECTS="(project:openstack/neutron OR project:openstack/neutron-fwaas OR \
project:openstack/neutron-lbaas OR project:openstack/neutron-vpnaas OR \
project:openstack/python-neutronclient OR project:openstack/neutron-specs)"
PROJECTS="($(
python - <<EOF
import urllib2
import yaml
data = urllib2.urlopen("https://raw.githubusercontent.com/openstack/"
"governance/master/reference/projects.yaml")
governance = yaml.load(data)
stadium = governance["neutron"]["deliverables"].keys()
query = ["project:openstack/%s" % p for p in stadium]
print ' OR '.join(query)
EOF
))"
blocked_reviews=$(ssh review.openstack.org "gerrit query --current-patch-set --format json $PROJECTS status:open age:4w label:Code-Review<=-2" | jq .currentPatchSet.revision | grep -v null | sed 's/"//g')