Skip to content

Commit

Permalink
Merge pull request #971 from daspilker/JENKINS-40191
Browse files Browse the repository at this point in the history
[JENKINS-40191] fixed problem with API URI
  • Loading branch information
daspilker committed Dec 21, 2016
2 parents bd6073b + 2ac48b0 commit abe2f5b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
5 changes: 4 additions & 1 deletion docs/Home.md
Expand Up @@ -37,7 +37,10 @@ Browse the Jenkins issue tracker to see any [open issues](https://issues.jenkins
* Changed embedded API Viewer to work without Internet connectivity
([JENKINS-40205](https://issues.jenkins-ci.org/browse/JENKINS-40205))
* The short URL for the embedded API Viewer ()http://localhost:8080/plugin/job-dsl/api-viewer) is deprecated, see
[Migration](Migration#migrating-to-154)
[Migration](Migration#migrating-to-154)
* Fixed problem with
[GitHub Branch Source Plugin](https://wiki.jenkins-ci.org/display/JENKINS/GitHub+Branch+Source+Plugin)
([JENKINS-40191](https://issues.jenkins-ci.org/browse/JENKINS-40191))
* Added a workaround for a problem with XStream conversion
([JENKINS-40130](https://issues.jenkins-ci.org/browse/JENKINS-40130))
* Support for the [S3 Plugin](https://wiki.jenkins-ci.org/display/JENKINS/S3+Plugin) is deprecated, see
Expand Down
Expand Up @@ -59,7 +59,9 @@ class BranchSourcesContext extends AbstractExtensibleContext {
branchSourceNodes << new NodeBuilder().'jenkins.branch.BranchSource' {
source(class: 'org.jenkinsci.plugins.github_branch_source.GitHubSCMSource') {
id(UUID.randomUUID())
apiUri(context.apiUri ?: '')
if (context.apiUri) {
apiUri(context.apiUri)
}
scanCredentialsId(context.scanCredentialsId ?: '')
checkoutCredentialsId(context.checkoutCredentialsId ?: '')
repoOwner(context.repoOwner ?: '')
Expand Down
Expand Up @@ -4,7 +4,7 @@ import javaposse.jobdsl.dsl.AbstractContext
import javaposse.jobdsl.dsl.JobManagement

class GitHubBranchSourceContext extends AbstractContext {
String apiUri = 'https://api.github.com'
String apiUri
String scanCredentialsId
String checkoutCredentialsId = 'SAME'
String repoOwner
Expand All @@ -17,7 +17,7 @@ class GitHubBranchSourceContext extends AbstractContext {
}

/**
* Sets the GitHub API URI. Defaults to {@code 'https://api.github.com'}.
* Sets the GitHub API URI. Defaults to GitHub.
*/
void apiUri(String apiUri) {
this.apiUri = apiUri
Expand Down
Expand Up @@ -93,9 +93,8 @@ class BranchSourcesContextsSpec extends Specification {
name() == 'jenkins.branch.BranchSource'
children().size() == 2
with(source[0]) {
children().size() == 8
children().size() == 7
id[0].value() instanceof UUID
apiUri[0].value() == 'https://api.github.com'
scanCredentialsId[0].value().empty
checkoutCredentialsId[0].value() == 'SAME'
repoOwner[0].value().empty
Expand Down

0 comments on commit abe2f5b

Please sign in to comment.