Update the UPPER_CONSTRAINTS_FILE url to include the new branch

The danger here is that if the branch doesn't exisit and the review
merges the new branch or $project will be unconstrained and therefore
testing is somewhat voided.

We need to manage that externally to this process

Change-Id: Iae6aefefcd6b7e96d15bd5d373ae439e4fe80daf
This commit is contained in:
Tony Breeds 2016-07-27 15:36:06 -05:00
parent a249c17893
commit 13121d0d60
2 changed files with 20 additions and 0 deletions

View File

@ -82,6 +82,25 @@ defaultbranch=$branch"
}
function update_upper_constraints {
typeset branch="$1"
typeset uc_server='git.openstack.org'
typeset uc_path='cgit/openstack/requirements/plain/upper-constraints.txt'
typeset uc_url="https://${uc_server}/${uc_path}?h=${branch}"
title "Updating tox.ini for upper-constraints"
git checkout $branch
sed -i~ -e "s,-c.*{\(env:UPPER_CONSTRAINTS_FILE\)[^ ]*} ,-c{\1:$uc_url}," tox.ini
if ! git diff --exit-code >/dev/null 2>&1 ; then
git add tox.ini
git commit -m "Update UPPER_CONSTRAINTS_FILE for $branch"
git show
local shortbranch=$(basename $branch)
git review -t "create-${shortbranch}"
fi
}
function clone_repo {
typeset repo="$1"
typeset branch="$2"

View File

@ -55,6 +55,7 @@ REALSHA=`git show-ref -s $NEW_BRANCH`
git push gerrit $NEW_BRANCH
update_gitreview "$NEW_BRANCH"
update_upper_constraints "$NEW_BRANCH"
if [[ -d releasenotes/source ]]; then
# Also update the reno settings, in master
title "Updating reno"