-
Notifications
You must be signed in to change notification settings - Fork 830
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 icons in folders #1258
Support icons in folders #1258
Conversation
As for the failing test, I have no idea how to fix it if I'm honest other than removing the example. Any hints are highly appreciated. |
@jamietanna Can you take a look please ? |
Ping @jenkinsci/job-dsl-plugin-developers |
@jamietanna Any update on this? Just wondering if there is anything I could do to get this merged. |
Stack trace from failing test is:
I'd wager that the custom icon plugin is not installed in the test instance and therefore the test script cannot be applied. The problem is that I don't know how to fix this, a couple ideas:
Unfortunately, I'm far from a Gradle pro and I didn't manage to tweak this project's |
@quilicicf sums it up perfectly.
I do second this, however I yet have to find a way to change that.
I would prefer the 2nd option where my plugin is only pulled as a "test dependency" but should by no means be a required dependency of the job-dsl-plugin otherwise.
My plugin uses the intended way of extending the Folders plugin and provides additional functionality alongside its own configuration. There is no clash in any way. To elaborate further, the "icon" property of a folder is intended to be overwritten but this was not foreseen in the job-dsl-plugin implementation - which is exactly what this PR is trying to change.
I'm in the same boat as you and since there is basically little to no documentation for the gradle build process of Jenkins plugins or other plugin projects using gradle to look at I desperately hope for @jamietanna to help me out here and get this PR merged. |
It would be super nice if the Job DSL plugin allowed extensions like this indeed. |
Apparently the plugin will switch to maven build (#1265) |
@jonesbusy I will look into this PR again once #1265 is merged ✌🏼 |
Thanks folks, sorry for the delay, but with the Maven changes in it may resolve the build issues 🤞🏽 |
} | ||
|
||
// use https://github.com/jenkinsci/custom-folder-icon-plugin for ionicons | ||
folder('ionicon') { |
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.
@strangelookingnerd Should we also have a test for new emoji type icons ?
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.
job-dsl-plugin
requires Jenkins 2.361.4
whereas custom-folder-icon-plugin
2.5
(which includes the emoji icons) requires 2.387.1
- so I guess this won't be possible right now.
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 can probably get a release out next week. Once that's done I would have no problem with revving the minimum Jenkins core to 2.387.1.
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.
@basil That would be great! On a side-note I found that the tests in javaposse.jobdsl.dsl.doc.ExampleValidationSpec
do not seem to be run during the build anymore or are at least not reporting any failing tests. Running them manually however shows that the test for my icon.groovy
example still fails. Before the switch to Maven the behavior was different. Any idea why that is?
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 think it has something to do with the use of @Unroll
with file << findAllExamples()
, where the right-hand side is a function call rather than a static set of values. Seems that JUnit isn't able to invoke the function call correctly. Are you interested in opening a PR that removes the use of @Unroll
in favor of a simple for
loop inside of the test?
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.
@jamietanna I cannot get the I would still love to see this merged eventually. |
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 have not reviewed this change thoroughly. At minimum it is missing @RequiresPlugin
/@RequiresPlugins
and the icon examples need to be restored.
@basil The |
I took a closer look. It looks like Since the Dynamic DSL is not available in (No LLMs were consulted during the writing of this answer.) |
@basil Thanks again for you help. As requested I added tests for every icon type we currently have, excluding the |
|
Added a test for the |
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.
Thanks!
Released in 1.83. |
This PR enables the
icon
configuration on folders, multi-branch projects and organization folders to be accessible. This way one can customize the folder icon via jenkinsci/custom-folder-icon-plugin.See jenkinsci/custom-folder-icon-plugin#92 as well for details and use case.
Here the jenkinsci/custom-folder-icon-plugin is installed, by default there is only
stockFolderIcon
andmetaDataActionFolderIcon
available.Example configuration: