[JIRA] (JENKINS-58929) Bulk API for shelving projects

0 views
Skip to first unread message

carsten.pfeiffer@gebit.de (JIRA)

unread,
Aug 14, 2019, 8:43:02 AM8/14/19
to jenkinsc...@googlegroups.com
Carsten Pfeiffer created an issue
 
Jenkins / Improvement JENKINS-58929
Bulk API for shelving projects
Issue Type: Improvement Improvement
Assignee: Pierre Beitz
Components: shelve-project-plugin
Created: 2019-08-14 12:42
Priority: Minor Minor
Reporter: Carsten Pfeiffer

It would be nice if there was a bulk API for shelving projects in batch.

This would be used by seed jobs (via the job-dsl plugin) when unneeded jobs are automatically discarded and shelved. The bulk API would avoid avoid flooding the build queue with shelve tasks when there are many jobs to be discarded.

See https://github.com/jenkinsci/job-dsl-plugin/pull/1174#discussion_r292322461 for the request.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

carsten.pfeiffer@gebit.de (JIRA)

unread,
Aug 19, 2019, 9:03:03 AM8/19/19
to jenkinsc...@googlegroups.com
Carsten Pfeiffer commented on Improvement JENKINS-58929
 
Re: Bulk API for shelving projects

It would be great if this bulk mode would transparently handle jobs as well as folders. That way, the jobdsl plugin would not need to take care to first shelve jobs, wait for that to finish and then delete the folders, for example.

carsten.pfeiffer@gebit.de (JIRA)

unread,
Sep 9, 2019, 10:26:02 AM9/9/19
to jenkinsc...@googlegroups.com

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?

This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

pibeitz@gmail.com (JIRA)

unread,
Oct 6, 2019, 12:22:04 PM10/6/19
to jenkinsc...@googlegroups.com

Carsten Pfeiffer first sorry for the delay in answering you on this one...

The bulk API would avoid avoid flooding the build queue with shelve tasks when there are many jobs to be discarded.

I'm not really convinced of the added value of what you suggest as the shelve plugin is using lightweight executors therefore it should not be an issue to send multiple items to the queue.

 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).

This part is interesting indeed, this would address one of the fear I had on the JENKINS-27734 development. It would require quite some work though

I cannot currently commit on this development, happy to help/review if somebody want to take a shot at it. I'm not sure yet when I'll have enough bandwidth to work on this :/

Reply all
Reply to author
Forward
0 new messages