jenkinsci / jenkinsci/lockable-resources-plugin
[JENKINS-65604] The resources do not persist reservation when reload JCasC configuration
- Dominant language
- Java
- Stars
- 99
- Forks
- 205
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 8
Description
Hello,
I hit an issue with Lockable resources plugin (2.8) together with JCasC configuration (Jenkins 2.277.2).
We define our resources in JCasC and then some of our jobs are locking and releasing these statically defined resources.
unclassified:
lockableResourcesManager:
declaredResources:
- description: "My resource 1"
labels: res1
name: res1
# I omit the reservedBy field on the purpose in the hope that jcasc will not re-configure it
Unfortunately every time the JCasC configuration is reloaded it resets/release all reservations of resources. I don't set the reservedBy field in our JCasC, in that way I was hoping that it will not touch that value, but that is not a case.
I also tried to set reservedBy to null, if it helps but unfortunately it doesn't.
unclassified:
lockableResourcesManager:
declaredResources:
- description: "My resource 1"
labels: res1
name: res1
reservedBy: null
Maybe I am doing something wrong. What can I do to persist current status of reserved resources?
---
Originally reported by lukas_bednar, imported from: The resources do not persist reservation when reload JCasC configuration
Raw content of original issue
Hello,
I hit an issue with Lockable resources plugin (2.8) together with JCasC configuration (Jenkins 2.277.2).
We define our resources in JCasC and then some of our jobs are locking and releasing these statically defined resources.
unclassified:
lockableResourcesManager:
declaredResources:
- description: "My resource 1"
labels: res1
name: res1
# I omit the reservedBy field on the purpose in the hope that jcasc will not re-configure itUnfortunately every time the JCasC configuration is reloaded it resets/release all reservations of resources. I don't set the reservedBy field in our JCasC, in that way I was hoping that it will not touch that value, but that is not a case.
I also tried to set reservedBy to null, if it helps but unfortunately it doesn't.
unclassified:
lockableResourcesManager:
declaredResources:
- description: "My resource 1"
labels: res1
name: res1
reservedBy: nullMaybe I am doing something wrong. What can I do to persist current status of reserved resources?
Contributor guide
Research direction
Reproduce the issue in the lockable-resources-plugin using the JCasC configuration shown and reload the configuration while a resource is reserved. Then trace the plugin's JCasC handling for declaredResources; done means existing reservations remain intact after reload, with a regression test covering the behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- ci-cd
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100