Now that shelving of plain {{hudson.model.Item}}s is possible in 5dc264b, it would be great to have an API for shelving a bunch of Item-instances in one go. This would take care of resolving the minimum set of items to shelve (e.g. if a parent item shall be shelved, do not shelve the child items as well). Currently, the job-dsl-plugin invokes the shelving like this:
jenkins.getQueue().schedule(new ShelveProjectTask(item), 0);
The new API might be something as simple as this:
List<Item> items = ...;
List<Item> itemsToBeShelved = new ShelveItemResolver().resolve(items);
jenkins.getQueue().schedule(new ShelveItemsTask(itemsToBeShelved), 0);
WDYT? |