Add draft ItemConfigurator support for Folder - #749
Conversation
| folder = jenkins.createProject(Folder.class, name); | ||
| } | ||
|
|
||
| Mapping mapping = config.asMapping(); |
There was a problem hiding this comment.
I assume this doesn't work with credentials as yet? Credentials are the biggest pain point I'm aware of with folders and job dsl
There was a problem hiding this comment.
Not yet. At the moment, this configurator only supports creating/updating the folder itself, along with description and displayName. I haven't added support for configuring folder credentials yet.
There was a problem hiding this comment.
I implemented folder-scoped credentials support and verified that it works. However, adding cloudbees-folder and credentials as compile-time dependencies to JCasC core introduces architectural problems because those plugins already integrate with JCasC. Rather than introducing reflection or other workarounds, I think the correct home for the folder-specific configurators is the cloudbees-folder plugin itself.
There was a problem hiding this comment.
yes all plugin specific configurator's should be in the plugins themselves.
JCasC only provides direct implementations for Jenkins core features
See jenkinsci/configuration-as-code-plugin#2881.
Add a draft
FolderItemConfiguratordemonstrating how the proposedItemConfiguratorextension point can be implemented by the CloudBees Folder plugin to create and configureFolderinstances through JCasC. As a proof of concept, this implementation supports configuring a folder's name, display name, and description, illustrating that the API can be extended beyond freestyle and pipeline jobs.Example configuration:
Proposed changelog entries
Submitter checklist
* Use the
Internal:prefix if the change has no user-visible impact (API, test frameworks, etc.)