From 1059461c6c11d6745f1d5890eb2c15194746e378 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Wed, 29 Jan 2014 12:44:31 -0800 Subject: [PATCH] Make requirement update proposals more robust. When proposing requirement update changes ensure that the proper branch can be checked out if the branch isn't master. To do this checkout origin/$BRANCH instead of just branch. Additonally, don't git review -d an existing change as it may have merge conflicts with the target branch. Instead make changes against the target branch, push them to the existing change as a new patchset, and ignore failures of git review when there are no new changes. This allows changes to the requirements files to happen out of band from these automated change proposals. Closes-Bug: 1274251 Change-Id: I7b81b87a90639a66dce5502cded5e37d96abd1f7 --- .../propose_requirements_update.sh | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/modules/jenkins/files/slave_scripts/propose_requirements_update.sh b/modules/jenkins/files/slave_scripts/propose_requirements_update.sh index c57a6c116f..339a449dd3 100755 --- a/modules/jenkins/files/slave_scripts/propose_requirements_update.sh +++ b/modules/jenkins/files/slave_scripts/propose_requirements_update.sh @@ -16,6 +16,7 @@ INITIAL_COMMIT_MSG="Updated from global requirements" TOPIC="openstack/requirements" USERNAME=${USERNAME:-$USER} BRANCH=$ZUUL_REF +ALL_SUCCESS=0 if [ -z "$BRANCH" ] ; then echo "No branch set, exiting." @@ -60,11 +61,8 @@ EOF # make sure the project even has this branch if git branch -a | grep -q "^ remotes/origin/$BRANCH$" ; then - git checkout $BRANCH + git checkout origin/${BRANCH} git review -s - if [ -n "$change_id" ] ; then - git review -d $change_id - fi popd python update.py $PROJECT_DIR @@ -73,15 +71,22 @@ EOF if ! git diff --exit-code HEAD ; then # Commit and review git_args="-a -F-" - if [ -n "$change_id" ] ; then - git_args="--amend $git_args" - fi git commit $git_args <