Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-55486

If lock() creates a new resource, there should be a choice to make it temporary

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      I'm using lock() in the stage options of a declarative pipeline and really like the feature to automatically create the resource if it does not yet exist.  That should save some maintenance.  However as time goes on and resources change, this means the number of resources builds up until someone cleans them out.

      We should have a choice for manually created locks to be temporary - i don't necessarily care whether the resource exists when no one is using it, just that only one job use it at a time.

       

      May be related to: JENKINS-34892

       

      The overall scenario is related to Jenkins agents - I want a stage to deploy a server, followed by stages to execute client tests, but I need the server locked the whole time so that no other job tries to use it.  Currently I'm stuck with double maintenance, keeping the same server list in both the agent and the lockable resources.  If lock() both lets me create resources on the fly and declare them temporary so they are deleted when no one is using them, then I don't need duplicate maintenance - I only need to maintain the agents, not the lock data.

        Attachments

          Issue Links

            Activity

            Hide
            wgc123 D Pasto added a comment -

            I can see several ways of addressing this issue - this ticket is a small improvement that will get us a nice improvement, while JENKINS-53332 addresses the scenario, and JENKINS-44141 is a larger goal but is short on detail

            Show
            wgc123 D Pasto added a comment - I can see several ways of addressing this issue - this ticket is a small improvement that will get us a nice improvement, while  JENKINS-53332 addresses the scenario, and  JENKINS-44141  is a larger goal but is short on detail
            Hide
            ethorsa ethorsa added a comment -

            There's a pending PR on Github addressing this .

            Show
            ethorsa ethorsa added a comment - There's a pending PR on Github addressing this .
            Hide
            ethorsa ethorsa added a comment -

            PR#138 has been merged so the next release should ship it. 

            Show
            ethorsa ethorsa added a comment - PR#138 has been merged so the next release should ship it. 
            Hide
            wgc123 D Pasto added a comment -

            Fantastic, thanks!  Unfortunately  I don't have a sandbox to try pre-release versions.  I see the last release of this plugin was in March, so I'll keep an eye out for it.

            Show
            wgc123 D Pasto added a comment - Fantastic, thanks!  Unfortunately  I don't have a sandbox to try pre-release versions.  I see the last release of this plugin was in March, so I'll keep an eye out for it.

              People

              • Assignee:
                Unassigned
                Reporter:
                wgc123 D Pasto
              • Votes:
                3 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated: