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

Locked resource(s) should be inherited from calling job

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Labels:
      None
    • Environment:
      Jenkins 2.263.4, lockable-resources-plugin 2.10
    • Similar Issues:

      Description

      In a declarative pipeline, I typically do

      pipeline {
        options { lock(extra: [[resource: "A"], [resource: "B"], [resource: "C"]]) }
        stages { stage('A') { ... } }
      }
      

      or something like that to lock resources for the job.

      If I call another build in one of the stages

      stage('A') {
        steps {
          script { build job: 'path-to-job' }
        }
      }

      that build must not try to lock the same resources, because they are already locked by the calling job and hence not available.

      Ideally, the plugin would check whether the resources are locked by the calling job, so the called/nested job need not wait for the resources because they are basically already locked for them.

      There might be an elaborate (hence "Major") workaround to implement that check manually and it to the jobs that are called by others, but ideally the plugin itself would handle this case.
       

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            raketenolli Oliver
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: