Locked resource(s) should be inherited from calling job

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      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.
       

            Assignee:
            Unassigned
            Reporter:
            Oliver
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: