[JIRA] (JENKINS-60495) Downstream multibranch pipeline does not receive parameters for initial build

3 views
Skip to first unread message

jacklu@jacklu.me (JIRA)

unread,
Dec 16, 2019, 2:21:02 AM12/16/19
to jenkinsc...@googlegroups.com
Jack Lu created an issue
 
Jenkins / Bug JENKINS-60495
Downstream multibranch pipeline does not receive parameters for initial build
Issue Type: Bug Bug
Assignee: Unassigned
Components: pipeline
Created: 2019-12-16 07:20
Environment: jenkins 2.176.3
pipeline plugin 2.6
Priority: Minor Minor
Reporter: Jack Lu

I have a downstream multibranch pipeline a that has a parameter a, and an upstream pipeline b, whose pipeline script is:

 

pipeline {
  agent any
  stages {
    stage('') {
      steps {
        build job: "a/1.0", parameters: [string(name: 'a', value: 'abc')]
      }
    }
  }
}

I've just created these 2 jobs and branch 1.0 is discovered on initial scan of a, but no builds are triggered. Now I trigger b for the first time, a does not receive the parameter, but if I trigger b again, a receives it, and always receives it in future builds.

As I tested, this does not happen for freestyle project and ordinary pipeline(pipeline that is not multibranch).

Is this a bug?

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

jsoref+jenkins@gmail.com (JIRA)

unread,
Jan 20, 2020, 1:06:06 AM1/20/20
to jenkinsc...@googlegroups.com
Josh Soref commented on Bug JENKINS-60495
 
Re: Downstream multibranch pipeline does not receive parameters for initial build

I suspect you're running into a problem relating to the fact that pipelines only seem to be willing to deliver parameters they know about to jobs. And since the first time a job runs, the system doesn't know about parameters, it can't deliver yours.

As a workaround, I'd probably just adjust the pipeline to recognize the first-run case, declare its parameters, and stop (possibly w/ some magic code that enables the caller to check for it).

You could then have the caller job recognize that case and trigger the job again.

I haven't really looked into this much. We hit it – whenever we add a new value to a parameter, we can't use that value until we let the system build once normally.

Reply all
Reply to author
Forward
0 new messages