[JIRA] (JENKINS-49794) BooleanParam default value is always true

2020-04-06 Thread quirin_hu...@yahoo.de (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Quirin Huber commented on  JENKINS-49794  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: BooleanParam default value is always true   
 

  
 
 
 
 

 
 Boolean parameter is not of type boolean but string. (You are comparing apples to pears) try:  

 

script {
 if (params.RUN_TESTS.toBoolean() == true) {
 echo "true: $RUN_TESTS"
 }
 else echo "false: $RUN_TESTS"
 }
 

  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.188745.1519826985000.6956.1586173980182%40Atlassian.JIRA.


[JIRA] (JENKINS-49794) BooleanParam default value is always true

2020-02-12 Thread kamil.we...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 kamil wezka commented on  JENKINS-49794  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: BooleanParam default value is always true   
 

  
 
 
 
 

 
 I just wanted add my comment. Should the script be: 

 

script {
 if (params.RUN_TESTS == true) {
 echo "true: $RUN_TESTS"
 }
 else echo "false: $RUN_TESTS"
 }
 

 because I think the `params.RUN_TESTS` is just a pointer to parameter reference that is always non null so if you don't use equality operators it is always true. Possibly this is not clear?    
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

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

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.188745.1519826985000.8154.1581519660186%40Atlassian.JIRA.


[JIRA] (JENKINS-49794) BooleanParam default value is always true

2018-11-27 Thread daniel.watr...@trinet.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Daniel Watrous commented on  JENKINS-49794  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: BooleanParam default value is always true   
 

  
 
 
 
 

 
 I also tried going in to the config.xml for that job and manually removing the parameters 

 


 myParameter
 Set to true if you want to live
 true
  

 They were rewritten with the updated default value, but the build still ignores the default value and uses whatever the parameters were for that last build. I can't find a workaround other than committing this file into the repository and using "build with parameters", which isn't really a workaround. I guess another workaround would be to just change everywhere in the Jenkinsfile that references the parameter to the desired boolean value. It's not really testing what you plan to commit, but it simulates the desired behavior.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

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

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-49794) BooleanParam default value is always true

2018-11-27 Thread daniel.watr...@trinet.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Daniel Watrous commented on  JENKINS-49794  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: BooleanParam default value is always true   
 

  
 
 
 
 

 
 The way I use the Replay feature is to work through changes to my Jenkinsfile without committing a bunch of intermediate changes that may or may not work.  I think the best way to "improve" this would be to add the parameters to the top of the replay page, as if I had clicked "build with parameters".  I thought a workaround might be to go into the configuration of that pipeline and either delete the parameter or change its value. In my case, the pipeline is part of a multibranch pipeline and doesn't allow me to save changes to the pipeline. If this isn't a feature, there should at least be a workaround...  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

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

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-49794) BooleanParam default value is always true

2018-03-12 Thread valentina.armen...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 valentina armenise commented on  JENKINS-49794  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: BooleanParam default value is always true   
 

  
 
 
 
 

 
 So say I run a build without specifying parameters, it takes the default ones. Then I replay the same but I modify the script to have different default parameters. From a user perspective it s confusing if it does not take the new default values. Maybe there should be condition for which if the replayed run was using the default parameters, those have to be computed again as the script may have changed. In any case it s a minor, I let you decide if to close it or put it lowest priority.     
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-49794) BooleanParam default value is always true

2018-03-12 Thread andrew.ba...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Andrew Bayer commented on  JENKINS-49794  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: BooleanParam default value is always true   
 

  
 
 
 
 

 
 It’s not a defect - this is how it should work. Replay doesn’t mean “undo the previous build and run it fresh”, it just means “run the previous build again”.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-49794) BooleanParam default value is always true

2018-03-12 Thread valentina.armen...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 valentina armenise commented on  JENKINS-49794  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: BooleanParam default value is always true   
 

  
 
 
 
 

 
 yeah makes sense but it's not ideal. Is there something we can do or you think it's a non-defect? It makes testing harder  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-49794) BooleanParam default value is always true

2018-03-09 Thread andrew.ba...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Andrew Bayer commented on  JENKINS-49794  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: BooleanParam default value is always true   
 

  
 
 
 
 

 
 Ah, ok, I think I know what's happening here. When you replay the build with job parameter definitions already in place, that results in the run actually having those parameters as part of it - so params.RUN_TESTS in the replayed build isn't getting the default value as it is in the first build, it's getting the actual value of the parameter RUN_TESTS. And that actual value is true, since that was the default value for RUN_TESTS when the build started.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-49794) BooleanParam default value is always true

2018-03-09 Thread valentina.armen...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 valentina armenise edited a comment on  JENKINS-49794  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: BooleanParam default value is always true   
 

  
 
 
 
 

 
 Ok I can reproduce it in this way.  * create the pipeline job and set the default to true. * hit on REPLAY but in the script section, modify the default to false * execute  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-49794) BooleanParam default value is always true

2018-03-09 Thread valentina.armen...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 valentina armenise commented on  JENKINS-49794  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: BooleanParam default value is always true   
 

  
 
 
 
 

 
 Ok I can reproduce it in this way.   
 
create the pipeline job and set the default to true. 
hit on REPLAY but in the script section, modify the default to false 
execute 
  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-49794) BooleanParam default value is always true

2018-03-09 Thread valentina.armen...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 valentina armenise commented on  JENKINS-49794  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: BooleanParam default value is always true   
 

  
 
 
 
 

 
 mm I could reproduce when hitting on REPLAY (as opposite of starting a new build). Can it make any difference? I can do some more tests  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-49794) BooleanParam default value is always true

2018-03-07 Thread andrew.ba...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Andrew Bayer commented on  JENKINS-49794  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: BooleanParam default value is always true   
 

  
 
 
 
 

 
 Hrm, I can't reproduce this running the following: ``` pipeline { agent any parameters  { booleanParam(name: 'RUN_TESTS', defaultValue: false, description: 'Do you want to run the build with tests?') }  stages { stage('foo') { steps { script { if (params.RUN_TESTS) { echo "true: $ {params.RUN_TESTS}" } else echo "false: ${params.RUN_TESTS} " }  } } } } ```  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-49794) BooleanParam default value is always true

2018-03-07 Thread andrew.ba...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Andrew Bayer edited a comment on  JENKINS-49794  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: BooleanParam default value is always true   
 

  
 
 
 
 

 
 Hrm, I can't reproduce this running the following: ``` {code} pipeline {agent anyparameters {booleanParam(name: 'RUN_TESTS', defaultValue: false, description: 'Do you want to run the build with tests?')}stages {stage('foo') {steps {script {if (params.RUN_TESTS) { echo "true: ${params.RUN_TESTS}"}else echo "false: ${params.RUN_TESTS}"}}}}} ``` {code}  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-49794) BooleanParam default value is always true

2018-02-28 Thread valentina.armen...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 valentina armenise commented on  JENKINS-49794  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: BooleanParam default value is always true   
 

  
 
 
 
 

 
 plugin versions are attached as screenshot  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-49794) BooleanParam default value is always true

2018-02-28 Thread valentina.armen...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 valentina armenise updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-49794  
 
 
  BooleanParam default value is always true   
 

  
 
 
 
 

 
Change By: 
 valentina armenise  
 
 
Attachment: 
 Screen Shot 2018-02-28 at 15.12.16.png  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-49794) BooleanParam default value is always true

2018-02-28 Thread valentina.armen...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 valentina armenise updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-49794  
 
 
  BooleanParam default value is always true   
 

  
 
 
 
 

 
Change By: 
 valentina armenise  
 
 
Component/s: 
 workflow-job-plugin  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-49794) BooleanParam default value is always true

2018-02-28 Thread valentina.armen...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 valentina armenise updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-49794  
 
 
  BooleanParam default value is always true   
 

  
 
 
 
 

 
Change By: 
 valentina armenise  
 

  
 
 
 
 

 
 My pipeline defines a parameter with sth like:    {noformat}parameters { booleanParam(name: 'RUN_TESTS', defaultValue: false, description: 'Do you want to run the build with tests?') }{noformat}    Printing the param value with{code:java}script { if (params.RUN_TESTS) { echo "true: $RUN_TESTS" } else echo "false: $RUN_TESTS" }{code}shows that the value is always TRUE and the tests are always executed.   I think this is somewhat related to  I think this is somewhat related to  https://issues.jenkins-ci.org/browse/JENKINS-36543     
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit 

[JIRA] (JENKINS-49794) BooleanParam default value is always true

2018-02-28 Thread valentina.armen...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 valentina armenise created an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-49794  
 
 
  BooleanParam default value is always true   
 

  
 
 
 
 

 
Issue Type: 
  Bug  
 
 
Assignee: 
 Unassigned  
 
 
Components: 
 pipeline  
 
 
Created: 
 2018-02-28 14:09  
 
 
Priority: 
  Minor  
 
 
Reporter: 
 valentina armenise  
 

  
 
 
 
 

 
 My pipeline defines a parameter with sth like:     

 
parameters {
 booleanParam(name: 'RUN_TESTS', defaultValue: false, description: 'Do you want to run the build with tests?')
 } 

     Printing the param value with 

 

script {
 if (params.RUN_TESTS) {
 echo "true: $RUN_TESTS"
 }
 else echo "false: $RUN_TESTS"
 } 

 shows that the value is always TRUE and the tests are always executed.   I think this is somewhat related to  I think this is somewhat related to https://issues.jenkins-ci.org/browse/JENKINS-36543