From afc971fd87cb1c8f9ccedf2d147f543b71467c89 Mon Sep 17 00:00:00 2001 From: Manuel Montecelo Date: Mon, 11 Dec 2017 16:58:28 +0100 Subject: [PATCH] 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 4f4c28d92db9af3be1f3919f46870482a5129ad2 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 --- release_dashboard/utils/build.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/release_dashboard/utils/build.py b/release_dashboard/utils/build.py index 6ee4b0c..db58662 100644 --- a/release_dashboard/utils/build.py +++ b/release_dashboard/utils/build.py @@ -14,6 +14,7 @@ # with this program. If not, see . 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)