Do not generate new translation proposal if one is in the gate
Do not generate a new translation proposal patch if there is currently an approved patch in the queue. This helps with overlong queues or approvals close to the job run. Change-Id: I1ca73a03c67b34878244a3ebd926eb9bd60845f7
This commit is contained in:
parent
7a19e14546
commit
675cdf8d66
@ -172,6 +172,30 @@ Change-Id: $change_id
|
||||
EOF
|
||||
set -e
|
||||
fi
|
||||
# If the open change an already approved, let's not queue a new
|
||||
# patch but let's merge the other patch first.
|
||||
# This solves the problem that when the gate pipeline backup
|
||||
# reaches roughly a day, no matter how quickly you approve the new
|
||||
# update it will always get sniped out of the gate by another.
|
||||
# It also helps, when you approve close to the time this job is
|
||||
# run.
|
||||
if [ "x${previous}" != "x" ] ; then
|
||||
# Use the JSON format since it is very compact and easy to grep
|
||||
change_info=`ssh -p 29418 proposal-bot@review.openstack.org gerrit query --current-patch-set --format=JSON $change_id`
|
||||
# Check for:
|
||||
# 1) Workflow approval (+1)
|
||||
# 2) no -1/-2 by Jenkins
|
||||
# 3) no -2 by reviewers
|
||||
# 4) and no Workflow -1 (WIP)
|
||||
#
|
||||
if `echo $change_info|grep -q '{"type":"Workflow","description":"Workflow","value":"1"'` \
|
||||
&& ! `echo $change_info|grep -q '{"type":"Verified","description":"Verified","value":"-1","grantedOn":[0-9]*,"by":{"name":"Jenkins","username":"jenkins"}}'` \
|
||||
&& ! `echo $change_info|grep -q '{"type":"Code-Review","description":"Code-Review","value":"-2"'` \
|
||||
&& ! `echo $change_info|grep -q '{"type":"Workflow","description":"Workflow","value":"-1"'` ; then
|
||||
echo "Job already approved, exiting"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Propose patch using COMMIT_MSG
|
||||
|
Loading…
x
Reference in New Issue
Block a user