Closed deiga closed 3 years ago
Okay, this was resolved finally
@deiga could u provide more information about how it was solved ? Did it have to do with GQL ? Maybe it could help others. Thanks anyway
The solution was to not use static references:
@Grab("com.github.grooviter:gql-core:0.4.0")
@GrabExclude('org.codehaus.groovy:groovy-all')
import gql.DSL
import groovy.json.JsonOutput
import com.cloudbees.groovy.cps.NonCPS
@NonCPS
Boolean call(String repoName, String branchName = BRANCH_NAME) {
String queryString = DSL.buildQuery {
query('repository', [owner: 'foobar', name: repoName]) {
query('pullRequests', [first: 10, headRefName: branchName, state: [OPEN]] {
returns {
totalCount
}
}
}
}
...
}
:+1: Perfect, thanks for the feedback
We are trying to use the gql library to do GQL calls from inside a Jenkinsfile
In a Shared Library we have the following snippet defined:
And when calling it inside a Jenkins Declarative Pipeline we get the following error message:
I've tried to figure what the matter here is, but I'm falling short on understanding how Groovy and Jenkins really works in this aspect. Do you have any ideas what could be the matter here?