repeatableHeteroProperty and doFillItems

7 views
Skip to first unread message

Gavin “halkeye” Mogan

unread,
Feb 11, 2026, 11:35:04 PM (12 hours ago) Feb 11
to Jenkins Developers
Hey everyone

Long time no jenkins
I'm working on upgrading the digitalocean plugin to make it easier to select base images for agents by adding filters. I was thinking of getting fancy by added a repeatableHeteroProperty as filters as you can have 0 or more filters, and have classes for each filter type and how it would affect the api call.

After a lot of re-learning things, this seemed to work pretty well, except for the doFillItems call to populate the select box of images

Originally it was:
public ListBoxModel doFillImageIdItems(@RelativePath("..") @QueryParameter String authTokenCredentialId) throws Exception {

I was hoping to expand it to 
public ListBoxModel doFillImageIdItems(@RelativePath("..") @QueryParameter String authTokenCredentialId, @QueryParameter List<ImageFilter> imageFilters) throws Exception {

But it seems like stapler doesn't like the conversion to list
java.lang.IllegalArgumentException: Unable to convert to interface java.util.List

Is there any way to handle this? I'd settle for a json blob or something i'd have to handle manually. I'm just not sure what my options are.

Thanks,
Gavin

Jesse Glick

unread,
10:56 AM (25 minutes ago) 10:56 AM
to jenkin...@googlegroups.com
Last I checked, `validate*` and `fill*` and `complete*` endpoints do not support structured data. `@RelativePath` may not work in all cases either. So if you were planning to use this filter list to dynamically constrain a huge list of potential images to a small enough number to fit into a combo box, I do not think this can work.

The best you could do is offer a list of images based on the last-saved filter list, so the user would need to configure filters, save, then go back and reconfigure the plugin to select images based on those filters.

I would not recommend trying to write custom JS for this use case. You could probably make it work, but it is going to be fragile in the face of core changes. KISS

CONFIDENTIALITY NOTICE: This email and any attachments contain confidential and proprietary information of CloudBees intended only for the named recipient(s). Unauthorized use or distribution is prohibited. If you received this in error, please notify the sender and delete this email.
Reply all
Reply to author
Forward
0 new messages