-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support configuration as code #262
Support configuration as code #262
Conversation
The PrioritySorterConfiguration class couldn't be configured with CasC (Configuration as Code) jenkins plugin.
The configuration for the priority sorter plugin can be defined with the [configuration as code plugin](https://github.com/jenkinsci/configuration-as-code-plugin). This is the example from the junit test resource file `PriorityConfiguration.yaml` ``` unclassified: priorityConfiguration: jobGroups: - id: 0 priority: 1 description: "Complex" runExclusive: true usePriorityStrategies: true priorityStrategies: - userIdCauseStrategy: priority: 1 - upstreamCauseStrategy - userIdCauseStrategy: priority: 3 - cLICauseStrategy: priority: 4 - jobPropertyStrategy - buildParameterStrategy: parameterName: priority jobGroupStrategy: folderBased: folderName: "Jenkins" - id: 1 priority: 2 description: "Simple" runExclusive: false usePriorityStrategies: false jobGroupStrategy: allJobs ```
Extend the ConfigurationAsCodeTest test case to also assert the casc defined priorityStrategies configurations. The test casc configuration resource files for the ConfigurationAsCodeTest test case class are at a similar location then all the other configuration test files.
# Conflicts: # src/main/java/jenkins/advancedqueue/JobGroup.java
…d_use_data_bound_constructor
Includes configuration as code support from jenkinsci/priority-sorter-plugin#262
jenkinsci/priority-sorter-plugin#262 Configuration as code while trying to not lose the improvements from the master branch. Needs documentation of configuration as code sample configurations and needs compatibility testing.
Thanks very much for the pull request. I've added one of the changes from the master branch back into the pull request so that the new icon renders correctly on the pages. I've started testing the incremental build of this pull request in my configuration as code environment and it looks very good. The documentation in the README file needs a section that describes configuration as code examples. Would you be willing to add that documentation? @julianxhokaxhiu you mentioned in #62 (comment) that you were waiting for the next iteration. This is the next iteration. I'd love to have your help testing it to confirm that compatibility is retained and that configuration as code works as expected. @easybe you had tested the earlier pull request ( #62 ). It would be very nice if you could help with the testing of this pull request. |
Same here, hopefully someone will reach out soon :) Nevertheless, thanks for making this possible! |
I added README section with sample casc configuration. Is there something else I can do to speed up acceptance of this PR ? Are we just waiting for more people to test it? |
That was what I was seeking, since there were two users during the life of the pull request who had expressed interest in configuration as code and seemed like good candidates to test it. However, since they are both unavailable to test it, I think your testing and my testing are enough to declare it sufficient to release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Completed my interactive testing, confirmed that the configuration as code works in my installation, and implemented two additional tests to be sure.
This PR implements the needed changes to support the configuration of this plugin
with the configuration-as-code-plugin. It is my rework of previous work PR-62 by @fr123k . I submit it as a separate PR for my convenience, but if necessary I can apply patch on the original.
Initial pull request had problem with exporting configuration by
jenkins/manage/configuration-as-code/viewExport
, causing serialisation errors. To mitigate that, following this comment I had added DataBoundConstructor and DataBoundSetter annotation to some classes.I was aiming to preserve format of xml configuration for plugin, thus I haven't edited class hierarchy, but it results in slightly uglier casc configuration format - see tests.
This PR also implements the following jira ticket with the title Problem with jcasc compatibility plugin and job priority in Jenkins.
JENKINS-54571