[JIRA] (JENKINS-54386) preserveStashes does not work with parameter

1 view
Skip to first unread message

jan.hoppe@heidelberg.com (JIRA)

unread,
Nov 1, 2018, 3:35:02 AM11/1/18
to jenkinsc...@googlegroups.com
Jan Hoppe created an issue
 
Jenkins / Bug JENKINS-54386
preserveStashes does not work with parameter
Issue Type: Bug Bug
Assignee: Andrew Bayer
Components: pipeline-model-definition-plugin
Created: 2018-11-01 07:34
Environment: Plugins:
Pipeline: Declarative 1.3.2
Pipeline: Basic Steps 2.11
Priority: Minor Minor
Reporter: Jan Hoppe

I tried the pipeline script below, I get 
     WorkflowScript: 4: "preserveStashes" should have 0 arguments but has 1 arguments instead. @ line 4, column 9.
 

w/o parameter restart with unstash works (by the way, multiple unstashes in one pipe is working too, as expected!)

 
http://kie-jenkinslts.ppe.kie.de.heidelberg.com:8080/blue/organizations/jenkins/StashUnstash/detail/StashUnstash/9/pipeline#log-12 preserveStashes(5)
pipeline

{     agent \{label 'master'}

    options

{         preserveStashes(5)     }

    stages{
        stage('create stash'){
            steps

{                  //create file                  writeFile file: './myFile.txt', text: 'fun stuff'                  stash includes: '*.txt', name: 'funstufftxt'               }

         }
         stage('unstash first'){
         steps{
             dir('first') {
                 unstash 'funstufftxt'
                 script

{                        def funtxt = readFile 'myFile.txt'                        println funtxt                  }

             }
         }
   }
   stage('unstash second'){

         steps{
             dir('second') {
                  unstash 'funstufftxt'
                  script

{                       def funtxt = readFile 'myFile.txt'                       println funtxt                   }

             }
         }
     }
   }
}

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

andrew.bayer@gmail.com (JIRA)

unread,
Nov 14, 2018, 2:48:06 PM11/14/18
to jenkinsc...@googlegroups.com
Andrew Bayer commented on Bug JENKINS-54386
 
Re: preserveStashes does not work with parameter

Interesting and a bit odd - we'll look into it.

andrew.bayer@gmail.com (JIRA)

unread,
Nov 16, 2018, 1:25:02 PM11/16/18
to jenkinsc...@googlegroups.com
Andrew Bayer updated an issue
 
Change By: Andrew Bayer
Labels: stage-restart-improvements

jose-francisco.ravelo@inova-software.com (JIRA)

unread,
Nov 23, 2018, 5:32:02 AM11/23/18
to jenkinsc...@googlegroups.com
JF Ravelo commented on Bug JENKINS-54386
 
Re: preserveStashes does not work with parameter

The problem is that preserveStashes() receives a named parameter, so instead of:

 preserveStashes(5)

the value has to be passed this way:

 preserveStashes(buildCount: 5)

 

jan.hoppe@heidelberg.com (JIRA)

unread,
Nov 23, 2018, 5:40:01 AM11/23/18
to jenkinsc...@googlegroups.com

jose-francisco.ravelo@inova-software.com (JIRA)

unread,
Nov 23, 2018, 5:54:02 AM11/23/18
to jenkinsc...@googlegroups.com

Btw Andrew Bayer, I think there is a problem of consistency in the docs regarding this point: in Preserving stashes for use with restarted stages it's mentioned as a normal parameter, but in Pipeline syntax it's documented as a named parameter.

jose-francisco.ravelo@inova-software.com (JIRA)

unread,
Nov 23, 2018, 5:54:02 AM11/23/18
to jenkinsc...@googlegroups.com
JF Ravelo edited a comment on Bug JENKINS-54386
Btw [~abayer], I think there is a problem of consistency in the docs regarding this point: in [Preserving stashes for use with restarted stages|https://jenkins.io/doc/book/pipeline/running-pipelines/#preserving-stashes-for-use-with-restarted-stages] it's mentioned as a normal named parameter, but in [Pipeline syntax|https://jenkins.io/doc/book/pipeline/syntax/#options] it's documented as a named normal parameter.

andrew.bayer@gmail.com (JIRA)

unread,
Dec 10, 2018, 11:57:01 AM12/10/18
to jenkinsc...@googlegroups.com

Yup, that's a doc issue indeed - I'll fix that.

andrew.bayer@gmail.com (JIRA)

unread,
Dec 10, 2018, 12:13:01 PM12/10/18
to jenkinsc...@googlegroups.com
Andrew Bayer started work on Bug JENKINS-54386
 
Change By: Andrew Bayer
Status: Open In Progress

andrew.bayer@gmail.com (JIRA)

unread,
Dec 10, 2018, 12:13:02 PM12/10/18
to jenkinsc...@googlegroups.com

andrew.bayer@gmail.com (JIRA)

unread,
Dec 10, 2018, 12:13:03 PM12/10/18
to jenkinsc...@googlegroups.com

andrew.bayer@gmail.com (JIRA)

unread,
Dec 18, 2018, 10:35:03 AM12/18/18
to jenkinsc...@googlegroups.com
Change By: Andrew Bayer
Status: In Review Resolved
Resolution: Fixed

bitwiseman@gmail.com (JIRA)

unread,
Oct 22, 2019, 11:24:28 PM10/22/19
to jenkinsc...@googlegroups.com
Liam Newman closed an issue as Fixed
 

Bulk closing resolved issues.

Change By: Liam Newman
Status: Resolved Closed
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages