Default gitlab to newest plugin config format

Change-Id: I51ca15b9bfef42b79e03c4a2ba0bb9f23d880188
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
This commit is contained in:
Thanh Ha 2017-06-28 18:59:29 -04:00
parent 8cfe815e88
commit 70e6adb4eb
No known key found for this signature in database
GPG Key ID: B0CB27E00DA095AA
4 changed files with 15 additions and 1 deletions

@ -32,6 +32,7 @@ Example::
import logging
import pkg_resources
import re
import sys
import xml.etree.ElementTree as XML
import six
@ -1238,8 +1239,12 @@ def gitlab(registry, xml_parent, data):
gitlab = XML.SubElement(
xml_parent, 'com.dabsquared.gitlabjenkins.GitLabPushTrigger'
)
plugin_info = registry.get_plugin_info('GitLab Plugin')
plugin_ver = pkg_resources.parse_version(plugin_info.get('version', "0"))
# Note: Assume latest version of plugin is preferred config format
plugin_ver = pkg_resources.parse_version(
plugin_info.get('version', str(sys.maxsize)))
valid_merge_request = ['never', 'source', 'both']
if plugin_ver >= pkg_resources.parse_version("1.1.26"):

@ -0,0 +1,3 @@
- longName: 'GitLab Plugin'
shortName: 'gitlab-plugin'
version: "0"

@ -0,0 +1,3 @@
- longName: 'GitLab Plugin'
shortName: 'gitlab-plugin'
version: "0"

@ -0,0 +1,3 @@
- longName: 'GitLab Plugin'
shortName: 'gitlab-plugin'
version: "0"