Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    steven-terrana
    @steven-terrana

    the test harness is included in the Jenkins Parent Pom that plugins extend in their own pom files.

    https://github.com/jenkinsci/plugin-pom/blob/master/pom.xml

    Marky Jackson
    @markyjackson-taulia
    Oleg Nenashev
    @oleg-nenashev
    Will join in 1 min
    Oleg Nenashev
    @oleg-nenashev
    I added Pipeline as YAML to the today's meeting agenda as it was discussed in the GSoC channels. No students tho
    Craig Rodrigues
    @rodrigc
    @markyjackson-taulia I keep hitting this: https://issues.jenkins-ci.org/browse/JENKINS-55287 , but it is not 100% reproducible. Devin Nusbaum tried to fix it but his fix didn't work out. Any idea how to proceed on this? Tried to load head FlowNodes for executio but FlowNode was not found in storage for head id:FlowNodeId 1:17
    Craig Rodrigues
    @rodrigc
    The error for that is super cryptic, so it is hard for a user to know how to work around the problem
    That problem was reported 2 years ago, and I have hit it many times. I just hit it today
    Jheison Rodriguez
    @jasonlll88
    Hello Everyone, I'd like to know some thoughts about your experience with Jenkins pipelines testing (Jenkinsfile, Shared libraries, CPS, declarative pipeline). We want to start implementing it in our Company.
    Whathever help will be appreciate
    Marky Jackson
    @markyjackson-taulia
    @oleg-nenashev I am going to cancel the EMEA version of the pipeline-authoring sig based on our last meeting topic
    Oleg Nenashev
    @oleg-nenashev
    @markyjackson-taulia +1
    Marky Jackson
    @markyjackson-taulia
    In preperation for tomorrow meeting, 1 action item I had was to draft a roadmap sheet and add a few items. Here it is (I only allowed comments for now but SIG leads have edit ability, we can open it up after the meeting): https://drive.google.com/file/d/11FnAebx82RO8ZljBXAW5wpx1cfsNihK0/view?usp=sharing
    Marky Jackson
    @markyjackson-taulia
    @/all I will not be able to make the meeting today due to a conflict. I am reaching out to @bitwiseman
    Liam Newman
    @bitwiseman
    The primary topic for today’s meeting is the roadmap. Unless others have topic they’d like to discuss today, I suggest we cancel today’s meeting.
    Marky Jackson
    @markyjackson-taulia
    I am a +1
    I will cancel todays meeting and send a note to the mailing list
    Craig Rodrigues
    @rodrigc
    Can we discuss JENKINS-55287 in the meeting?
    Marky Jackson
    @markyjackson-taulia
    @rodrigc I would prefer to review that separately first
    I will review that today and DM you if that is ok @rodrigc
    Craig Rodrigues
    @rodrigc
    Also I'd like to add JENKINS-52939 to the meeting agenda
    Marky Jackson
    @markyjackson-taulia
    I will add that to next weeks agenda. Is that ok?
    That will give people enough time to familiarize themselves with these issues and not take up meeting time understadning the context
    Craig Rodrigues
    @rodrigc
    I brought up JENKINS-52939 in a video chat with Jenn Briden, Joseph Brueggen, Jeremey Hartley, and Cyrille Le Clerc in a video chat with Cloudbees in May 2019, but it fell through the cracks
    Marky Jackson
    @markyjackson-taulia
    I will pick it up
    Craig Rodrigues
    @rodrigc
    Since I'm not a Cloudbees customer, that's OK, but both these issues are important
    Marky Jackson
    @markyjackson-taulia
    Oleg Nenashev
    @oleg-nenashev
    Roadmap could be discussed in the mailing list in an async mode
    FTR I may have difficulties with attending meetings going forward. Once the timezones change, it will be 6PM UTC in Europe again
    Marky Jackson
    @markyjackson-taulia
    Understandable
    Liejun Tao
    @liejuntao001
    Hi, I have a question regarding Jenkins Shared Library's security restriction. I
    I'm trying to add grgit in global shared lib to perform git operation ( like git clone/merge/push) using grgit to avoid depending on git command line output. I developed the shared lib and tested fine locally. however when putting to run on real Jenkins, grgit is not able to read/write the workspace.
    Liejun Tao
    @liejuntao001
      def clonedir = "${WORKSPACE}/test-repo1/"
      mygit.cloneShowStatus(clonedir, 'https://github.com/ajoberstar/test-repo.git')
    
    jenkins log:
    can not clone git to /home/jenkins/agent/workspace/testLibrary/test-repo1/ : org.eclipse.jgit.api.errors.JGitInternalException: Creating directories for /home/jenkins/agent/workspace/testLibrary/test-repo1/.git failed
    
      def selfdir = "${WORKSPACE}/"
      def self_status = mygit.showStatus(selfdir)
    jenkins log:
    can not open git folder /home/jenkins/agent/workspace/testLibrary/ : org.eclipse.jgit.errors.RepositoryNotFoundException: repository not found: /home/jenkins/agent/workspace/testLibrary
    I guess this is blocked by some security thing. I couldn't find any hit from Jenkins logs. Is there anything I could do to remove such restriction?
    Liejun Tao
    @liejuntao001
    the grgit I'm invoking in the shared lib is @Grab('org.ajoberstar.grgit:grgit-core:4.0.1')
    Liam Newman
    @bitwiseman
    This sounds like a pretty complex question. Like you have to show people the code of your shared library and pipeline. Question though, there might already be an existing step to do it. For instance, cloning is already provided by git or GitHub plugins.
    Liam Newman
    @bitwiseman
    @rodrigc Re https://issues.jenkins-ci.org/browse/JENKINS-55287 - we need more information to do anything about this. Even if not 100% repro, there’s plenty of other information we could use.
    Liam Newman
    @bitwiseman
    While I appreciate that it seems like an issue like this should never have been allowed to reach 1.5 years without progress, issues that old are hardly unusual in open source projects, especially for intermittent issues with insufficient information. Hopefully we can work together to figure it out.
    Liam Newman
    @bitwiseman

    @rodrigc re https://issues.jenkins-ci.org/browse/JENKINS-52939 I added the following comment: I completely agree with what you are asking for here, but this is at least two independent issues. Both/All of the issues are valid and worth fixing, but by mushing them together it makes them less well defined and harder to make progress on. Would you mind if we scope this down to just being able to call the linter from the Web UI?

    The problem of "reloading" the pipeline and refreshing parameters is related, but is actually a harder problem to solve.

    Marky Jackson
    @markyjackson-taulia
    @rodrigc pull request welcomed 😉
    Liejun Tao
    @liejuntao001

    My purpose is to do git operation out of SCM API. like automatic "git merge" in the pipeline after all checks pass.
    my code is quite straightforward:
    The problem seems only with the open the directory. I checked the contents of the directory are ok by

    sh 'ls -lsta '

    test pipeline:
    @Library("lib@test") _

    node() {
    def clonedir = "${WORKSPACE}/test-repo1/"
    mygit.cloneShowStatus(clonedir, 'https://github.com/ajoberstar/test-repo.git')

    def selfdir = "${WORKSPACE}/"
    def self_status = mygit.showStatus(selfdir)
    }

    Shared lib is set as global library
    vars/mygit.groovy

    import com.example.jenkins.MyGrGit
    
    def cloneShowStatus(String gitdir, String uri) {
      def gg = new MyGrGit()
      try {
        gg.clone(dir: gitdir, uri: uri)
      } catch (e) {
        echo "can not clone git to ${gitdir} : " + e
        return
      }
      def status = gg.status()
      gg.close()
      return status
    }
    
    def showStatus(String gitdir) {
      def gg = new MyGrGit()
      try {
        gg.open(dir: gitdir)
      } catch (e) {
        echo "can not open git folder ${gitdir} : " + e
        return
      }
    
      def status = gg.status()
      gg.close()
      return status
    }

    src/com/example/jenkins/MyGrGit

    package com.example.jenkins
    
    @Grab('org.ajoberstar.grgit:grgit-core:4.0.1')
    
    import org.ajoberstar.grgit.Grgit
    import org.ajoberstar.grgit.Status
    class MyGrGit {
      Grgit g
      def clone(Map opts = [:]) {
        Object dir = opts.get('dir', null)
        String uri = opts.get('uri', null)
        g = Grgit.clone(dir: dir, uri: uri)
      }
      def status() {
        Status s = g.status()
      }
      def close() {
        g.close()
      }
    }

    Missing one func in MyGrGit.groovy

    class MyGrGit {
      def open(Map opts = [:]) {
        Object dir = opts.get('dir', null)
        Object currentDir = opts.get('currentDir', null)
        g = Grgit.open(dir: dir, currentDir: currentDir)
      }
    }

    MyGrGit simply wrap a few Grgit functions by taking reference from http://ajoberstar.org/grgit/grgit-reference.html

    Dhruv Barochiya
    @dbarochiya
    Hello, anyone have any idea on getting to know during the pipeline run that it's a restart from stage and which stage ?
    Marky Jackson
    @markyjackson-taulia
    @dbarochiya This is not available in oss Jenkins. There is discussions https://issues.jenkins-ci.org/browse/JENKINS-33846) but nothing concrete. To date there is no ”offical” item to support this in oss Jenkins. There are hacks out there but I strongly suggest against using them in a production environment.
    Dhruv Barochiya
    @dbarochiya
    Thanks @markyjackson-taulia
    Marky Jackson
    @markyjackson-taulia
    Most welcome
    Dhruv Barochiya
    @dbarochiya
    Be safe man !
    Marky Jackson
    @markyjackson-taulia
    You as well and thank you
    steven-foster
    @steven-foster
    @dbarochiya are you using the declarative "restart from stage"?
    steven-foster
    @steven-foster
    there is a built-in when conditional called isRestartedRun() which will skip stages if it's a restarted build at all. looking further to get the specific restarted stage name, it seems to be recorded in the Cause object with no easy way to get it. You can probably do it with currentBuild.getBuildCauses('org.jenkinsci.plugins.pipeline.modeldefinition.causes.RestartDeclarativePipelineCause')
    this cause has a getOriginStage() but you might run into whitelisting issues
    Craig Rodrigues
    @rodrigc

    I am looking at this example for using a Secret Text credential in a declarative pipeline: https://jenkins.io/doc/book/pipeline/jenkinsfile/#secret-text

    that works OK for me.

    I want to define a Secret File credential, and use that in a declarative pipeline, but there is no good example on that doc page. Can anyone point me to something that works?