TT#26827 Release panel triggers jenkins jobs with branch=none

Attempt to fix problem when release panel triggers jenkins jobs
setting branch=none when tag=mrX.X.X.1, when the branch parameter
should have branch=mrX.X.X

This fix is basically the same as the one applied a few days ago in
4f4c28d92d for the file
(top)/build/utils.py which seems similar in purpose, I am not sure why
the duplicity, but this one seems to be the file mapped for the url
".../release_panel/build".

Change-Id: I04217f7f0d4a26802e4c3b808ef9732485d27edb
changes/04/17604/2
Manuel Montecelo 8 years ago
parent 4f4c28d92d
commit afc971fd87

@ -14,6 +14,7 @@
# with this program. If not, see <http://www.gnu.org/licenses/>.
import logging
import string
import uuid
import urllib
import requests
@ -85,6 +86,11 @@ def trigger_build(project, trigger_release=None,
if trigger_branch_or_tag.startswith("tag/"):
tag = trigger_branch_or_tag.split("tag/")[1]
params['tag'] = urllib.parse.quote(tag)
# branch is like tag but removing the last element,
# e.g. tag=mr5.5.2.1 -> branch=mr5.5.2
branch = string.join(tag.split(".")[0:-1], ".")
params['branch'] = urllib.parse.quote(branch)
elif trigger_branch_or_tag.startswith("branch/"):
branch = trigger_branch_or_tag.split("branch/")[1]
params['branch'] = urllib.parse.quote(branch)

Loading…
Cancel
Save