My team manages a large shared pipeline library, and I'm working on breaking it up. Recently we migrated to new Jenkins infrastructure and I found that my project was no longer working. To demonstrate the problem, I have a global parent library P which dynamically loads child library C. P is globally configured and loaded explicitly in Jenkinsfile J using `@Library()`. J --> P --> C C contains steps X and Y; X calls Y twice. (see [stepFromChild.groovy](https://github.com/skinitimski/library.child/blob/master/vars/stepFromChild.groovy)) P contains step Z which calls X. (see [fail.groovy](https://github.com/skinitimski/library.parent/blob/master/vars/fail.groovy#L14)) When J calls X() X(), no problem. But when J calls Z (which in turn calls X() X()), the second call to X results in "java.lang.NoSuchMethodError: No such DSL method 'call' found among steps ..." (even though globals very clearly includes X, and `call` isn't the right method name – see consoleText-failing.txt). On an older Jenkins, I see no failure (see attached log consoleText-sucess.txt) So far I have found no workaround to this problem. Steps to reproduce, given a Jenkins instance with a valid GitHub credential and plugins installed: 1. Configure a global library in "Manage Jenkins" called 'timski', pointing at https://github.com/skinitimski/library.parent 2. Create a Pipeline job with the following pipeline script:
@Library('timski@master') _
env.SECRET_ID = 'github-credential-id' // TODO: replace this with the id of a valid GitHub credential
fail()
3. Run the job and observe a failure. |