Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Jesse Glick
    @jglick
    @oleg-nenashev I would certainly not recommend using Blue Ocean as a BOM. JENKINS-47498 remains my recommendation. Needs a champion to actively drive the effort, and some support from the Jenkins infra team.
    Craig Rodrigues
    @rodrigc

    @abayer I'm still seeing this: https://issues.jenkins-ci.org/browse/JENKINS-55287

    Creating placeholder flownodes because failed loading originals.
    java.io.IOException: Tried to load head FlowNodes for execution Owner[DEV/Porx-01/104:DEV/Porx-01 #104] but FlowNode was not found in storage for head id:FlowNodeId 1:114

    No one is assigned that bug. If there is no bugfix for this, can you recommend a workaround?

    I'm pushing heavier and heavier to use pipeline at my current job, and I don't know how to debug stuff like this in Jenkins.

    R. Tyler Croy
    @rtyler
    @bitwiseman rumor has it that you may be pondering some matrix syntax improvements for declarative?
    R. Tyler Croy
    @rtyler
    :wave:
    naveeenkumarreddy-polaka
    @naveeenkumarreddy-polaka
    hi
    Naginator plugin will work in pipeline or not
    borisivan
    @borisivan
    Is there a way to have separate test reports in a pipeline when there are separate stages that each do different sets of testing? If not, are there any plans?
    Marky Jackson
    @markyjackson-taulia
    Currently, to my knowledge there is no way to do this. It is something that could be added. As for as plan to add it, I would say the best thing to do would be to open a JIRA and we can look it over and decide the level of effort, or you can open a PR
    borisivan
    @borisivan
    Thanks @markyjackson-taulia
    Marky Jackson
    @markyjackson-taulia
    Most welcome!
    Jeff Pearce
    @jeffpearce
    The code coverage API plugin supports combining of multiple reports https://github.com/jenkinsci/code-coverage-api-plugin
    That's probably not what you want, but that might be a good place to look at adding support, since it can deal with multiple reports
    borisivan
    @borisivan
    Thx @jeffpearce
    Michael Werner
    @Xaseron
    expected to call dhl.tools.Maven.tool but wound up catching dhl.tools.Maven.invokeMethod; How can i suppress these warnings?
    Are there any annotations?
    steven-terrana
    @steven-terrana

    @Xaseron - i added an exception for this kind of metaprogramming to groovy-cps in cloudbees/groovy-cps#99

    it was incorpated into the workflow-cps plugin in 2.73.

    are you on the latest version of workflow-cps?

    if not - what context is that method call happening from? a shared library, a plugin, etc?

    Michael Werner
    @Xaseron
    i've updated to 2.73
    we are using this groovy feature in our shared library heavily:
        def invokeMethod(String name, Object args) {
            script.invokeMethod(name, args)
        }
    script is a reference to the WorkflowScript in this class
    steven-terrana
    @steven-terrana
    try script.metaClass.invokeMethod
    Michael Werner
    @Xaseron
    hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method: groovy.lang.ExpandoMetaClass.tool() is applicable for argument types: (java.lang.String) values: [Maven 3.3.3]
    this doesn't work :-(
    steven-terrana
    @steven-terrana
    is this for a plugin?
    Michael Werner
    @Xaseron
    shared library
    steven-terrana
    @steven-terrana

    gotcha. i’m definitely not an expert for this :) I just know that i had to refactor a huge part of the Templating Engine Plugin (https://plugins.jenkins.io/templating-engine) when these log messages appeared to resolve the logging issue.

    for us - we’re using InvokerHelper under the hood to do some meta programming that seems to be in a similar vein to what you’re doing.

    so you might be able to use InvokerHelper.getMetaClass(object).invokeMethod(object, method name, arguments) in your Maven.invokeMethod and see if that resolves the issue

    Michael Werner
    @Xaseron
    hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method: WorkflowScript.tool() is applicable for argument types: (java.lang.String) values: [Maven 3.3.3]
    nope, still fails :/
    Michael Werner
    @Xaseron
    i get 1,303 cps warnings in a single pipeline run
    Michael Werner
    @Xaseron
    @steven-terrana i don't find any InvokerHelper in the JTE repository
    Michael Werner
    @Xaseron
    i don't see any benefit from these warnings
    How can i add my classes to the white list?
    steven-terrana
    @steven-terrana

    I would open a ticket on Jenkins JIRA tagging the workflow-cps plugin as the component describing your use case that’s resulting in the CPS mismatch logs being invoked.

    https://issues.jenkins-ci.org

    here’s a similar ticket related to the same thing: https://issues.jenkins-ci.org/browse/JENKINS-58643

    cc: @jglick @dwnusbaum
    Michael Werner
    @Xaseron
    i'll try the fix tomorrow
    steven-terrana
    @steven-terrana
    :+1:
    Jesse Glick
    @jglick
    i get 1,303 cps warnings in a single pipeline run
    ^^^ probably ought to be capped to, say, 5 per build and then a message printed just saying that further warnings of this type will be suppressed
    Michael Werner
    @Xaseron
    This would help a lot
    Suresh babu Kasthuri
    @suresh753
    Hi
    '''pipeline {
    agent none
    stages {
    stage('Example Build') {
    steps {
    script{
    getDatabaseConnection(type: 'GLOBAL') {
    sql sql: "CREATE DATABASE testjenkins;"
    }
    }
    }
    }
    }
    }'''
    i'm using jenkins Mysql database plugin
    to connect to mysql database.
    image.png
    Could any one help me how to get output of the sql query?
    Liam Newman
    @bitwiseman
    @suresh753 which plugin is that? It isn’t included in the step documentation currently. https://jenkins.io/doc/pipeline/steps/
    Nick Stolwijk
    @nickstolwijk

    Hello list,

    We are busy converting our jobs to the Multibranch Pipeline.

    We had a lot of jobs generated by the JobDSL.

    • Build develop
    • Build feature branches
    • Sonar builds for develop and feature branches

    We configured our jobs in the same repository as our JobDSL.

    For the Multibranch Pipeline, we want to create a shared library, so we can have a common ground for all our old jobs.

    We based our shared library on one we found on Github [1] and called the builder as follows:

    @Library('chefci') _
    org.typo3.chefci.v2.cookbook.CookbookPipeline.builder(this, steps)
    .buildDefaultPipeline()
    .execute()
    Then we wanted to change the stages to suit our needs and created a Maven stage:
    @Override
    void execute() {
    script.stage(stageName) {
    script.when(script.branch('feature/*'))
    script.withMaven(
    mavenSettingsConfig: 'e6609549-d884-4978-9750-61bdb982db2e',
    publisherStrategy: 'EXPLICIT',
    options: [
    script.pipelineGraphPublisher(),
    script.mavenLinkerPublisher(),
    script.junitPublisher(healthScaleFactor: 1.0),
    script.dependenciesFingerprintPublisher(),
    script.artifactsPublisher()],
    ) {
    script.sh "mvn clean --batch-mode --update-snapshots -Pintegration deploy"
    }
    script.chuckNorris()
    }
    }
    This didn't work, because of the script.when line.
    Is it possible to have a when block when using this method?
    Also, is this a good way to setup a shared library for the declarative pipeline? Are there anymore good examples? I find a lot of documentation, but a lot is unclear if it is for the scripted or declarative pipeline.
    I hope someone can help me with this.

    [1] https://github.com/TYPO3-infrastructure/jenkins-pipeline-global-library-chefci

    Liam Newman
    @bitwiseman
    @nickstolwijk Could you put triple backtick around your code snippet it would help with formatting/reading.
    @nickstolwijk stage is a declarative directive. It can’t be used at part of a scripted pipeline like that.
    If you want this to use declarative pipeline in a shared library, it will need to look more like this: https://mtijhof.wordpress.com/2019/04/22/jenkins-running-a-declarative-pipeline-from-your-shared-library/
    Liam Newman
    @bitwiseman
    That is, the top for your shared library method will need to be pipeline.
    Austin
    @awittha
    This message was deleted

    I've got a thought-provoker regarding the new CPS warning "expected to call X but wound up catching Y" warning (https://wiki.jenkins.io/display/JENKINS/Pipeline+CPS+method+mismatches ).

    I have CPS-transformed groovy code that implements Groovy's methodMissing, which then calls CpsScript#invokeMethod( ... ) to invoke a pipeline step (regular java-defined step w/ StepDescriptor, etc). This is triggering the warning, as the CPS invocation expects "OriginalTransformedGroovyClass.methodThatDoesntExist" but that ends up calling some other "regular" pipeline step.

    Looking through ContinuationGroup.java, I see a few method names are whitelisted in some situtations, e.g. .run ( https://github.com/cloudbees/groovy-cps/blob/4fed4a02733b8fa2db3eb741e761f54e62e716f4/lib/src/main/java/com/cloudbees/groovy/cps/impl/ContinuationGroup.java#L73 ) and .call.

    However... in my situation the expected method names are unknown until runtime as are the OriginalTransformedGroovyClass names. Got any ideas for how I would go about quieting this warning?

    William Hetherington
    @willwh
    hi folks, sorry cross posting from the jenkins channel, I'm curious, does anyone have something like the following working? I can't seem to get it to fly, the build just immediately succeeds:
    pipeline {
        agent { label 'windows' }
        stages {
            stage('Deploy') {
                agent { label 'windows' }
                steps {
                    script {
                        def proceed = true
                        try {
                            timeout(time: 15, unit: 'SECONDS') {
                                input {
                                    message "Is this deployment allowed to continue?"
                                    submitter "Deployment Group"
                                    submitterParameter "APPROVER"
                                    parameters {
                                        choice(
                                            name: 'TARGET_ENV',
                                            choices: "Dev\nTest\nProd",
                                            description: "Please choose an environment target"
                                        )
                                    }
                                }
                            }
                        } catch (err) {
                            proceed = false
                        }
                        if(proceed) {
                            powershell "Write-Host Deployment to $env.TARGET_ENV just approved by $env.APPROVER"
                        }
                    }
                }
            }
        }
    }