Add an updateLock step to alter resources in pipelines#305
Add an updateLock step to alter resources in pipelines#305gaspardpetit wants to merge 4 commits intojenkinsci:masterfrom
Conversation
|
I just realized the |
|
I take this back, working straight on the |
|
I worked a bit more on this - so the original pipeline looks like this - using the LockableResourcesManager directly: With this propose change, I am simplifying it down to After this change, the step I'd be missing would be a |
jimklimov
left a comment
There was a problem hiding this comment.
I haven't mastered step creation yet, so this PR looks great to me (possibly also as a pattern/checklist to look up to in the future) and has it all - with UI, help and tests included :)
src/main/java/org/jenkins/plugins/lockableresources/UpdateLockStepExecution.java
Outdated
Show resolved
Hide resolved
|
Any update on this? this feature will be super useful for our use case... in fact, many PR requests by @gaspardpetit are exactly what I am looking for to fully adopt this plugin. |
| resource.setDescription(""); | ||
| resource.setLabels(""); | ||
| resource.setNote(""); | ||
| resource.setEphemeral(true); |
There was a problem hiding this comment.
the user shall be inform about that
- in the job log
- in the UI like setting some other description. ( in this case I will not change note, labels) Just set ephemeral = true.
One hit more. What happens, when other job is waiting for this resource? This one will be on release deleted. The next one will create it again, or in worst case crashed the job.
This PR proposes to add a new
updateLockstep which can be used to alter the resource configuration. MaybeupdateResourcewould be better, but I thought users of this plugin would findupdateLockmore intuitive.With this change, the following can be altered:
New locks are created persistent (non-ephemeral). The use case for this can be having a job that would configure the locks based on an external source (ex. scm). I have not yet figured out how the sync could remove invalid locks (we will probably need a way to list locks so the ones removed from scm can be deleted - open for discussion)
Deleted locks are set to ephemeral if currently locked.
Once #299 is in, I will submit another PR to allow properties to be altered as well.