-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
Environment 1:
* Pipeline: Shared Groovy Libraries 2.8
* core: 2.60.3
* credentials: 2.1.13
Environment 2:
* Pipeline: Shared Groovy Libraries 2.16
* core: 2.227
* credentials: 2.3.5
Issue
It is not possible to add credentials when configuring for example a shared library from the global configuration Manage Jenkins > Configure System > Global Pipeline Libraries. This is not only impacting Pipeline Shared Library. Other plugins that accepts credentials in the Jenkins global configuration seem to be impacted too.
Analysis
Digging a bit into this, I could narrow down the problem: the issue seems to happen when the component that hold the credentials dropdown is created from an f:repeatableProperty or f:repeatable. It only happens on newly added configuration in the UI: for example in the global config, you must first add a Shared Library and then the Shared Library item that you added has a credentials dropdown.
Example of plugins affected:
Apparently it does not affect plugins that use the repeatableHeteroProperty:
How to reproduce
- Start a new Jenkins instance with no global credentials.
- Go to Manage Jenkins > Configure System > Global Pipeline Libraries
- Add a library
- Use a "Modern SCM" and either "Git" or "GitHub"
- Try to add credentials clicking on Add, it does not work..
Workarounds
1. Create credentials from Manage Jenkins > Manage Credentials and then the credentials will be selectable in the global configuration.
2. Partially fill the information for the shared library (without the credentials), save the configuration, go back to the configuration. It is now possible to "Add" credentials
I suppose that using repeatableHetero could be a workaround. But there is a bug here, in either core or credentials-plugin. Also I wonder if the issue https://issues.jenkins-ci.org/browse/JENKINS-39324 does capture the problem ? it does look really specific though.