[JIRA] (JENKINS-61606) Gracefully handle missing Jenkins root URL

1 view
Skip to first unread message

bryan.burke@cgifederal.com (JIRA)

unread,
Mar 20, 2020, 3:51:02 PM3/20/20
to jenkinsc...@googlegroups.com
Bryan Burke created an issue
 
Jenkins / Improvement JENKINS-61606
Gracefully handle missing Jenkins root URL
Issue Type: Improvement Improvement
Assignee: Kristy Hughes
Attachments: stack-trace.txt
Components: atlassian-bitbucket-server-integration-plugin, job-dsl-plugin
Created: 2020-03-20 19:50
Environment: atlassian-bitbucket-server-integration Plugin Version: 1.1.0
job-dsl Plugin version: 1.77
Priority: Minor Minor
Reporter: Bryan Burke

When testing out the new multibranch pipeline support in version 1.1.0 of the plugin, I discovered that creation of a multibranch pipeline job via Job DSL fails when the Jenkins root URL is not set. It seems that the plugin tries to register the webhook but does not catch the exception thrown when the Jenkins root URL is unset. Full stack trace: stack-trace.txt

Here is the Job DSL for the multibranch pipeline:

multibranchPipelineJob('test') {
    branchSources {
        branchSource {
            source {
                BbS {
                    credentialsId('Build-User')
                    id('test')
                    mirrorName(null)
                    projectName('TEST')
                    repositoryName('test')
                    serverId('Bitbucket')
                    traits {
                        cleanBeforeCheckoutTrait {
                            extension {
                                deleteUntrackedNestedRepositories(true)
                            }
                        }
                        gitBranchDiscovery()
                        localBranchTrait()
                        pruneStaleBranchTrait()
                    }
                }
            }
        }
    }
}

The equivalent multibranch pipeline definition for the CloudBees Bitbucket Branch Source plugin gracefully handles the exception and skips webhook registration when the Jenkins root URL is unset. Example:

multibranchPipelineJob('test') {
    branchSources {
        branchSource {
            source {
                bitbucket {
                    credentialsId('Build-User')
                    id('test')
                    repoOwner('TEST')
                    repository('test')
                    serverUrl('https://redacted.com/scm')
                    traits {
                        bitbucketBranchDiscovery {
                            strategyId(1)
                        }
                        bitbucketPullRequestDiscovery {
                            strategyId(1)
                        }
                        cleanBeforeCheckoutTrait {
                            extension {
                                deleteUntrackedNestedRepositories(true)
                            }
                        }
                        localBranchTrait()
                        pruneStaleBranchTrait()
                    }
                }
            }
        }
    }
}
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages