Unable to set branchDiscoveryTrait on globalLibraries
See original GitHub issueNever report security issues in github, follow the instruction from Jenkins Security to report it on Jenkins Jira
Please make sure to provide following information in your issue description
- Jenkins version: 2.138.1
- Plugin version: 1.3
- OS: CentOS 7.5
Context
I’m so close to being able to use this plugin in production for our team. The last piece missing is the branchDiscoveryTrait I’m trying to set on a global library.
Code snippet
jenkins:
[...]
unclassified:
[...]
globalLibraries:
libraries:
- name: <our repo name>
defaultVersion: master
implicit: true
includeInChangeSets: true
retriever:
modernSCM:
scm:
github:
apiUri: <our URL>
credentialsId: <our creds>
repoOwner: <our owner>
repository: <our repo>
traits:
- branchDiscoveryTrait # <--- issue right here
- originPullRequestDiscoveryTrait
- forkPullRequestDiscoveryTrait
Logs
Here are the logs when starting Jenkins:
INFO: Setting org.jenkinsci.plugins.github_branch_source.GitHubSCMSource{id='null'}.traits = [jenkins.plugins.git.traits.BranchDiscoveryTrait@3fb360b2, org.jenkinsci.plugins.github_branch_source.OriginPullRequestDiscoveryTrait@6b2b17b9, org.jenkinsci.plugins.github_branch_source.ForkPullRequestDiscoveryTrait@5938a4bb]
Result
originPullRequestDiscoveryTrait and forkPullRequestDiscoveryTrait are configured correctly, but branchDiscoveryTrait never appears. Note that applying the configuration does not result in an error/stack trace.
Any help would be fantastic. Excited to have a modern, ____-as-code approach to managing Jenkins. Thank you!
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (1 by maintainers)
Top GitHub Comments
When I try to export existing configuration after selecting the option with the UI, it still fails. Here’s the config in jenkins.yml that I use:
And I get this error when loading the config:
That’s great, thanks for following up and letting us know!