Skip to content

Add draft ItemConfigurator support for Folder - #749

Draft
somiljain2006 wants to merge 2 commits into
jenkinsci:masterfrom
somiljain2006:POC
Draft

Add draft ItemConfigurator support for Folder#749
somiljain2006 wants to merge 2 commits into
jenkinsci:masterfrom
somiljain2006:POC

Conversation

@somiljain2006

Copy link
Copy Markdown

See jenkinsci/configuration-as-code-plugin#2881.

Add a draft FolderItemConfigurator demonstrating how the proposed ItemConfigurator extension point can be implemented by the CloudBees Folder plugin to create and configure Folder instances 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:

items:
  - folder:
      name: "team-alpha-jobs"
      displayName: "Team Alpha"
      description: "All CI/CD jobs for Team Alpha"

Proposed changelog entries

Submitter checklist

  • JIRA issue is well described
  • Changelog entry appropriate for the audience affected by the change (users or developer, depending on the change).
    * Use the Internal: prefix if the change has no user-visible impact (API, test frameworks, etc.)
  • Appropriate autotests or explanation to why this change has no tests

@somiljain2006 somiljain2006 changed the title Ad draft ItemConfigurator support for Folder Add draft ItemConfigurator support for Folder Jul 31, 2026
folder = jenkins.createProject(Folder.class, name);
}

Mapping mapping = config.asMapping();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants