Default gitlab to newest plugin config format
Change-Id: I51ca15b9bfef42b79e03c4a2ba0bb9f23d880188 Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
This commit is contained in:
parent
8cfe815e88
commit
70e6adb4eb
jenkins_jobs/modules
tests/triggers/fixtures
@ -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"):
|
||||
|
3
tests/triggers/fixtures/gitlab001.plugins_info.yaml
Normal file
3
tests/triggers/fixtures/gitlab001.plugins_info.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
- longName: 'GitLab Plugin'
|
||||
shortName: 'gitlab-plugin'
|
||||
version: "0"
|
3
tests/triggers/fixtures/gitlab002.plugins_info.yaml
Normal file
3
tests/triggers/fixtures/gitlab002.plugins_info.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
- longName: 'GitLab Plugin'
|
||||
shortName: 'gitlab-plugin'
|
||||
version: "0"
|
3
tests/triggers/fixtures/gitlab003.plugins_info.yaml
Normal file
3
tests/triggers/fixtures/gitlab003.plugins_info.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
- longName: 'GitLab Plugin'
|
||||
shortName: 'gitlab-plugin'
|
||||
version: "0"
|
Loading…
x
Reference in New Issue
Block a user