Skip to content

Add support for jobs without jobdsl (freestyle only to start) - #2881

Merged
timja merged 13 commits into
jenkinsci:masterfrom
somiljain2006:Support-for-jobs
Aug 2, 2026
Merged

timja merged 13 commits into
jenkinsci:masterfrom
somiljain2006:Support-for-jobs

Conversation

@somiljain2006

@somiljain2006 somiljain2006 commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1604

Introduce JCasC support for configuring Jenkins items through YAML by adding an items root configurator and ItemConfigurator extension point. This enables plugins to provide native YAML configuration for jobs and folders without
relying on Job DSL.

Your checklist for this pull request

🚨 Please review the guidelines for contributing to this repository.

  • Make sure you are requesting to pull a topic/feature/bugfix branch (right side) and not your master branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or in Jenkins JIRA
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Did you provide a test case? That demonstrates the feature works or fixes the issue.

@somiljain2006
somiljain2006 requested a review from a team as a code owner July 27, 2026 05:46
@timja timja added the feature A PR that adds a feature - used by Release Drafter label Jul 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Introduces an items root element to Jenkins Configuration as Code (JCasC) to allow defining Jenkins items (jobs/folders) via native YAML, backed by a new ItemConfigurator extension point so plugins can implement YAML-backed item creation/update without relying on Job DSL.

Changes:

  • Add ItemsRootConfigurator root element that iterates items: YAML and delegates item creation/update to ItemConfigurator implementations.
  • Introduce ItemConfigurator<T extends TopLevelItem> extension point for plugins to provide native YAML item configuration.
  • Add test coverage and YAML fixtures validating success paths and key failure modes (unknown type, missing name, malformed structure).

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test-harness/src/test/resources/io/jenkins/plugins/casc/core/ItemsRootConfiguratorTest.yml Positive fixture: creates/updates an item via items: using a dummy configurator.
test-harness/src/test/resources/io/jenkins/plugins/casc/core/ItemsRootConfiguratorTest_unknown.yml Negative fixture: unknown item type.
test-harness/src/test/resources/io/jenkins/plugins/casc/core/ItemsRootConfiguratorTest_missingName.yml Negative fixture: missing required name.
test-harness/src/test/resources/io/jenkins/plugins/casc/core/ItemsRootConfiguratorTest_malformed.yml Negative fixture: malformed items shape (mapping vs sequence).
test-harness/src/test/java/io/jenkins/plugins/casc/core/ItemsRootConfiguratorTest.java Test harness validating delegation, update behavior, and error cases.
plugin/src/main/java/io/jenkins/plugins/casc/ItemConfigurator.java New extension point for plugin-provided YAML-backed item configuration.
plugin/src/main/java/io/jenkins/plugins/casc/core/ItemsRootConfigurator.java New root configurator implementing items: parsing and delegation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread plugin/src/main/java/io/jenkins/plugins/casc/core/ItemsRootConfigurator.java Outdated
@somiljain2006

Copy link
Copy Markdown
Contributor Author

@timja Can you review this pr?

@timja

timja commented Jul 28, 2026

Copy link
Copy Markdown
Member

It is on my list.
Got a few bigger ones like this to check though.

@adityajalkhare

Copy link
Copy Markdown

Meanwhile, @somiljain2006, can you add some documentation highlighting how to use this new feature?

@somiljain2006

Copy link
Copy Markdown
Contributor Author

@timja Can you take a look

@somiljain2006
somiljain2006 requested a review from timja July 31, 2026 22:38
Comment thread plugin/src/main/java/io/jenkins/plugins/casc/core/FreestyleItemConfigurator.java Outdated
@somiljain2006
somiljain2006 requested a review from timja August 1, 2026 11:33
@somiljain2006
somiljain2006 requested a review from timja August 1, 2026 22:05

@timja timja left a comment

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.

Thanks!

Comment thread demos/jobs/freestyle.yaml Outdated
@somiljain2006
somiljain2006 requested a review from timja August 2, 2026 12:24

@timja timja left a comment

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.

Thanks!

@timja
timja merged commit 475308a into jenkinsci:master Aug 2, 2026
17 checks passed
@timja timja changed the title Add native YAML support for Jenkins items Add support for jobs without jobdsl (freestyle only to start) Aug 2, 2026
@somiljain2006
somiljain2006 deleted the Support-for-jobs branch August 3, 2026 00:03
@jglick

jglick commented Aug 3, 2026

Copy link
Copy Markdown
Member

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

Labels

feature A PR that adds a feature - used by Release Drafter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for job and folder definitions as YAML

5 participants