-
Notifications
You must be signed in to change notification settings - Fork 185
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
Add an updateLock step to alter resources in pipelines #305
base: master
Are you sure you want to change the base?
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
|
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
updateLock
step which can be used to alter the resource configuration. MaybeupdateResource
would be better, but I thought users of this plugin would findupdateLock
more 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.