Merge "Stable identifier for branch sources in multibranch job"

This commit is contained in:
Zuul 2018-07-12 14:35:33 +00:00 committed by Gerrit Code Review
commit 746a089d4a
12 changed files with 19 additions and 18 deletions

View File

@ -70,7 +70,6 @@ import logging
import xml.etree.ElementTree as XML
import jenkins_jobs.modules.base
import jenkins_jobs.modules.helpers as helpers
import uuid
import six
from jenkins_jobs.errors import InvalidAttributeError
@ -328,7 +327,8 @@ def bitbucket_scm(xml_parent, data):
'plugin': 'cloudbees-bitbucket-branch-source',
})
source_mapping = [
('', 'id', str(uuid.uuid4())),
('', 'id', '-'.join(['bb', data.get('repo-owner', ''),
data.get('repo', '')])),
('repo-owner', 'repoOwner', None),
('repo', 'repository', None),
]
@ -414,7 +414,7 @@ def gerrit_scm(xml_parent, data):
'plugin': 'gerrit',
})
source_mapping = [
('', 'id', str(uuid.uuid4())),
('', 'id', '-'.join(['gr', data.get('url', '')])),
('url', 'remote', None),
('credentials-id', 'credentialsId', ''),
('includes', 'includes', '*'),
@ -485,7 +485,7 @@ def git_scm(xml_parent, data):
'plugin': 'git',
})
source_mapping = [
('', 'id', str(uuid.uuid4())),
('', 'id', '-'.join(['gt', data.get('url', '')])),
('url', 'remote', None),
('credentials-id', 'credentialsId', ''),
]
@ -556,7 +556,8 @@ def github_scm(xml_parent, data):
'plugin': 'github-branch-source',
})
mapping = [
('', 'id', str(uuid.uuid4())),
('', 'id', '-'.join(['gh', data.get('repo-owner', ''),
data.get('repo', '')])),
('repo-owner', 'repoOwner', None),
('repo', 'repository', None),
]

View File

@ -37,7 +37,7 @@
<data>
<jenkins.branch.BranchSource>
<source class="com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource" plugin="cloudbees-bitbucket-branch-source">
<id>1-1-1-1-1</id>
<id>bb-SANDBOX-test</id>
<repoOwner>SANDBOX</repoOwner>
<repository>test</repository>
<credentialsId>secret</credentialsId>
@ -46,7 +46,7 @@
</jenkins.branch.BranchSource>
<jenkins.branch.BranchSource>
<source class="jenkins.plugins.git.GitSCMSource" plugin="git">
<id>1-1-1-1-1</id>
<id>gt-https://example.com/jonhndoe/keep-frontend.git</id>
<remote>https://example.com/jonhndoe/keep-frontend.git</remote>
<credentialsId>secret</credentialsId>
<traits>
@ -56,7 +56,7 @@
</jenkins.branch.BranchSource>
<jenkins.branch.BranchSource>
<source class="org.jenkinsci.plugins.github_branch_source.GitHubSCMSource" plugin="github-branch-source">
<id>1-1-1-1-1</id>
<id>gh-johndoe-foo</id>
<repoOwner>johndoe</repoOwner>
<repository>foo</repository>
<credentialsId>secret</credentialsId>

View File

@ -32,7 +32,7 @@
<data>
<jenkins.branch.BranchSource>
<source class="org.jenkinsci.plugins.github_branch_source.GitHubSCMSource" plugin="github-branch-source">
<id>1-1-1-1-1</id>
<id>gh-johndoe-foo</id>
<repoOwner>johndoe</repoOwner>
<repository>foo</repository>
<credentialsId>secret</credentialsId>

View File

@ -32,7 +32,7 @@
<data>
<jenkins.branch.BranchSource>
<source class="com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource" plugin="cloudbees-bitbucket-branch-source">
<id>1-1-1-1-1</id>
<id>bb-SANDBOX-test</id>
<repoOwner>SANDBOX</repoOwner>
<repository>test</repository>
<credentialsId>secret</credentialsId>

View File

@ -32,7 +32,7 @@
<data>
<jenkins.branch.BranchSource>
<source class="com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource" plugin="cloudbees-bitbucket-branch-source">
<id>1-1-1-1-1</id>
<id>bb-SANDBOX-test</id>
<repoOwner>SANDBOX</repoOwner>
<repository>test</repository>
<traits/>

View File

@ -32,7 +32,7 @@
<data>
<jenkins.branch.BranchSource>
<source class="jenkins.plugins.gerrit.GerritSCMSource" plugin="gerrit">
<id>1-1-1-1-1</id>
<id>gr-https://review.gerrithub.io/johndoe/foo</id>
<remote>https://review.gerrithub.io/johndoe/foo</remote>
<credentialsId>secret</credentialsId>
<includes>*</includes>

View File

@ -32,7 +32,7 @@
<data>
<jenkins.branch.BranchSource>
<source class="jenkins.plugins.gerrit.GerritSCMSource" plugin="gerrit">
<id>1-1-1-1-1</id>
<id>gr-https://review.gerrithub.io/johndoe/foo</id>
<remote>https://review.gerrithub.io/johndoe/foo</remote>
<credentialsId/>
<includes>*</includes>

View File

@ -32,7 +32,7 @@
<data>
<jenkins.branch.BranchSource>
<source class="jenkins.plugins.git.GitSCMSource" plugin="git">
<id>1-1-1-1-1</id>
<id>gt-https://example.com/jonhndoe/keep-frontend.git</id>
<remote>https://example.com/jonhndoe/keep-frontend.git</remote>
<credentialsId>secret</credentialsId>
<traits>

View File

@ -32,7 +32,7 @@
<data>
<jenkins.branch.BranchSource>
<source class="jenkins.plugins.git.GitSCMSource" plugin="git">
<id>1-1-1-1-1</id>
<id>gt-https://example.com/jonhndoe/keep-frontend.git</id>
<remote>https://example.com/jonhndoe/keep-frontend.git</remote>
<credentialsId/>
<traits>

View File

@ -32,7 +32,7 @@
<data>
<jenkins.branch.BranchSource>
<source class="org.jenkinsci.plugins.github_branch_source.GitHubSCMSource" plugin="github-branch-source">
<id>1-1-1-1-1</id>
<id>gh-example-owner-example-repo</id>
<repoOwner>example-owner</repoOwner>
<repository>example-repo</repository>
<apiUri>http://example.org/github</apiUri>

View File

@ -32,7 +32,7 @@
<data>
<jenkins.branch.BranchSource>
<source class="org.jenkinsci.plugins.github_branch_source.GitHubSCMSource" plugin="github-branch-source">
<id>1-1-1-1-1</id>
<id>gh-johndoe-foo</id>
<repoOwner>johndoe</repoOwner>
<repository>foo</repository>
<traits>

View File

@ -32,7 +32,7 @@
<data>
<jenkins.branch.BranchSource>
<source class="org.jenkinsci.plugins.github_branch_source.GitHubSCMSource" plugin="github-branch-source">
<id>1-1-1-1-1</id>
<id>gh-johndoe-foo</id>
<repoOwner>johndoe</repoOwner>
<repository>foo</repository>
<traits>