Code Monkey home page Code Monkey logo

github-api-global-lib's Issues

org.kohsuke.groovy.sandbox.SandboxTransformer.mightBePositionalArgumentConstructor(Lorg/codehaus/groovy/ast/expr/VariableExpression;)Z

I have added this to shared libraries on a indows jenkins controller and the the job is run on a ubuntu agent.

I get the error

Checking out Revision bfe1e14 (main)

C:\Program Files\Git\cmd\git.exe config core.sparsecheckout # timeout=10
C:\Program Files\Git\cmd\git.exe checkout -f bfe1e14 # timeout=10
Commit message: "only script"
C:\Program Files\Git\cmd\git.exe rev-list --no-walk bfe1e14 # timeout=10
java.lang.NoSuchMethodError: org.kohsuke.groovy.sandbox.SandboxTransformer.mightBePositionalArgumentConstructor(Lorg/codehaus/groovy/ast/expr/VariableExpression;)Z
at com.cloudbees.groovy.cps.SandboxCpsTransformer.visitAssignmentOrCast(SandboxCpsTransformer.java:93)
at com.cloudbees.groovy.cps.CpsTransformer$42.run(CpsTransformer.java:1171)
at com.cloudbees.groovy.cps.CpsTransformer.makeChildren(CpsTransformer.java:446)
at com.cloudbees.groovy.cps.CpsTransformer.makeNode(CpsTransformer.java:409)
at com.cloudbees.groovy.cps.CpsTransformer.visitDeclarationExpression(CpsTransformer.java:1164)
at org.codehaus.groovy.ast.expr.DeclarationExpression.visit(DeclarationExpression.java:89)
at com.cloudbees.groovy.cps.CpsTransformer.visit(CpsTransformer.java:357)
at com.cloudbees.groovy.cps.CpsTransformer.visitExpressionStatement(CpsTransformer.java:589)
at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:42)
at com.cloudbees.groovy.cps.CpsTransformer.visit(CpsTransformer.java:357)
at com.cloudbees.groovy.cps.CpsTransformer.visit(CpsTransformer.java:363)
at com.cloudbees.groovy.cps.CpsTransformer$5.run(CpsTransformer.java:515)
at com.cloudbees.groovy.cps.CpsTransformer.makeChildren(CpsTransformer.java:446)
at com.cloudbees.groovy.cps.CpsTransformer.makeNode(CpsTransformer.java:409)
at com.cloudbees.groovy.cps.CpsTransformer.visitBlockStatement(CpsTransformer.java:512)
at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:71)
at com.cloudbees.groovy.cps.CpsTransformer.visit(CpsTransformer.java:357)
at com.cloudbees.groovy.cps.CpsTransformer$2.run(CpsTransformer.java:388)
at com.cloudbees.groovy.cps.CpsTransformer.makeChildren(CpsTransformer.java:446)
at com.cloudbees.groovy.cps.CpsTransformer.makeNode(CpsTransformer.java:409)
at com.cloudbees.groovy.cps.CpsTransformer.visitWithSafepoint(CpsTransformer.java:374)
at com.cloudbees.groovy.cps.CpsTransformer.visitMethod(CpsTransformer.java:231)
at com.cloudbees.groovy.cps.SandboxCpsTransformer.visitMethod(SandboxCpsTransformer.java:73)
at com.cloudbees.groovy.cps.CpsTransformer.call(CpsTransformer.java:136)
at com.cloudbees.groovy.cps.SandboxCpsTransformer.call(SandboxCpsTransformer.java:29)
at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1087)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:624)
at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:602)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:579)
at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:323)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:293)
at groovy.lang.GroovyShell.parseClass(GroovyShell.java:677)
at groovy.lang.GroovyShell.parse(GroovyShell.java:689)
at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:142)
at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:127)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:571)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:523)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:335)
at hudson.model.ResourceController.execute(ResourceController.java:101)
at hudson.model.Executor.run(Executor.java:442)

Here is the config (Q : should the pipeline be run on the master machine as the component? )
image

Difference between....?

Is there a technical difference between

  sh "curl ...."

and

loadLinuxScript(name: 'script-which-calls-curl')
sh 'script-which-calls-curl'

I know the loadLinuxScript will execute on the worker. Will the inline curl execute on the worker or the master?

The nested block depth is 6 GroovyLint(NestedBlockDepth-42)

Hello @darinpope
I'm trying to implement a Jenkins declarative pipeline with parallel stages, but I've run into an issue with the GroovyLint tool. It's complaining about The nested block depth is 6 GroovyLint(NestedBlockDepth-42). I've seen similar issues in certain parts of your library and was wondering if there's a way to manage this complexity across libraries? For example, can I delegate particular parts of the declarative pipeline like all constructions inside parallel block to a shared library so that the nested block depth isn't an issue?

image

Here is an example that I didn't find in your library.

Jenkinsfile:
parallel {
    executeStagesInParallel()
}

executeStagesInParallel.groovy:
void call() {
    stage('Stage a') {
        steps {
            echo env.STAGE_NAME
        }
    }
    stage('Stage b') {
        steps {
            echo env.STAGE_NAME
        }
    }
}

How can we use "AddSidebarLinkAction.groovy" for adding sidebar link without installing "sidebar-link" plugin?

Hello Darin,

Since "sidebar-link" plugin is no longer supported, It would be fantastic if we could use "AddSidebarLinkAction" Groovy Class for adding a link in sidebar of a job build without installing any plugins.
I've checked the Class and also all its prior commits, but I cannot figure out how should I use it.
Could you please let me know whether it's possible to have a sidebar link without installing the plugin or not? If so, how should I implement it?

Thanks in advance,
Hamid

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.