-
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
Update to the latest jenkins plugin version 4.8 #50
Conversation
fd008db
to
cf9f43b
Compare
* update the pom definition to the jenkins plugin version 4.1 * update the plugin specific code to support plugin version 4.1 and be fully compatible with the casc plugin (configuration as code)
We are very interested to get this plugin working with Configuration as Code. Any chance this will get implemented in the near future? |
@fr123k thank you for taking the time to do this! I'm also very interested in using priority sorter with JCasC. Are there any news on that front? |
Upcoming week i will update the PR and hope for green build light. |
pom.xml
Outdated
<parent> | ||
<groupId>org.jenkins-ci.plugins</groupId> | ||
<artifactId>plugin</artifactId> | ||
<version>4.1</version> |
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.
Now there is 4.8 with a few more updates
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.
Just a few comments. Looks very promising!
FTR Ownership transfer request: https://groups.google.com/g/jenkinsci-dev/c/7s2xdiHg0QA |
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.
Would be also great to clean up the commented code. We have commit history if we ever need to retrieve it.
Otherwise it is nice to have a comment explaining why it is commented
The maintainer information is extracted from the [repository-permissions-updater](https://github.com/jenkins-infra/repository-permissions-updater) instead. [WEBSITE-658](https://issues.jenkins-ci.org/browse/WEBSITE-658)
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.
I still need to go though the entire code. The changes look good overall, but ithe code does not retain binary compatibility with the previous version. I am also not sure about data compatibility.
What I recommend to do:
- Change the target version to 3.0-SNAPSHOT. It does not make much sense to try retainining binary compatibility here (famous last word? might make sense to check plugins depending on this one).
- Add tests which would load the old configuration file (
@LoadData
annotation in Jenkins Test Harness) and verify that they are properly loaded in the new version. If not, an additiona; migration code or documentation will be needed.
this.jobGroupStrategy = jobGroupStrategy; | ||
this.runExclusive = runExclusive; | ||
this.usePriorityStrategies = usePriorityStrategies; | ||
/* |
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.
Copy-pasted from newInstance()
? Please either cleanup the comment or add a TODO describing why t is commented out. Also, the entire newIInstance()
might not longer be needed when you have a constructor
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.
The newInstance
method is used by the PriorityConfiguration.doPriorityConfigSubmit
to serialize the changes done on the /advanced-build-queue configuration page.
At the moment i am missing knowledge on the how this jelly DataBinding works. If this setup is fixed then i guess this method is obsolete.
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.
For now i removed the not used full args constructor of the JobGroup class.
@@ -140,7 +196,7 @@ public int getPriority() { | |||
* @deprecated Used in 2.x now replaced with dynamic {@link JobGroup#jobGroupStrategy}, will return the view | |||
*/ | |||
@Deprecated | |||
@CheckForNull | |||
@CheckForNull |
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.
Tabs vs. spaces in this and other files. Maybe it makes sense to just add a bulk refactoring in a follow-up pull request
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.
In the single commit 89a142e
all tabs are replaced with whitespaces.
|
||
private JobGroup() { | ||
@DataBoundConstructor | ||
public JobGroup(int id, String description, int priority, JobInclusionStrategy jobGroupStrategy, boolean runExclusive, boolean usePriorityStrategies, List<? extends PriorityStrategy> priorityStrategies) { |
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.
It does not look like you use this constructor anywhere except data binding. For data binding there is no need to repeat fields in the constrictor if you have @DataBoundSetter
s defined
List<PriorityStrategy> B = priorityStrategyHolders.stream() | ||
.map(holder -> holder.priorityStrategy) | ||
.collect(Collectors.toList()); | ||
return B; | ||
} | ||
|
||
/** |
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.
Most likely, newInstance()
is no longer required,unless there are internal dependencies on this deprecated databinding mechanism
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.
Will keep newInstance and do a Refactoring to the new DataBound mechanism later.
Can you point me to a good documentation or example code of it.
Hi as ask in the FTR Ownership transfer request here is the release permission PR request for the [priority-sorter-plugin](https://github.com/jenkinsci/priority-sorter-plugin) [FTR Ownership tranfer request](https://groups.google.com/g/jenkinsci-dev/c/7s2xdiHg0QA) [Priority Sorter PR](jenkinsci/priority-sorter-plugin#50) Looking forward to my first release to the jenkins Artifactory. Co-authored-by: Frank Ittermann <frank.ittermann@data4life.care>
Also removed not necessary witespaces as well. * trailing * blank lines
Under There is only one test that is skipped now MatrixTest.matrix_and_jobs_with_no_configuration its shaky. At the moment there are no test for JCasC configuration. |
What you can do is to fork this branch and build the plugin your own and install it in jenkins On docker hub there is also a image provided that has the new version of this plugin already installed. For this checkout the following github repository https://github.com/fr123k/jocker (jocker - jenkins in docker). This way you can also provided feedback if something with JCasC and this version of the plugin is not working as expected. |
be fully compatible with the casc plugin (configuration as code)
The already defined tests are all passing at least most of the time. I also
tested the compatibility of the configuration with the version 3.6.0. But i can't
guaranty full compatibility at this point.
I would also like to take over the maintainer role of this plugin and will follow
the take over guide in the next days.
I just came across those plugin working on my own one that needed a way to
prioritize jobs. Instead of implementing this and i spend the time to update this
plugin to the latest jenkins version in order to use the jenkins casc plugin (configuration as code)
Thanks Brad Larson and Magnus Sandberg for providing amnd mainting this plugin.