[JIRA] (JENKINS-52774) Restart from Stage doesn't restore global variable

2019-12-06 Thread frankgenera...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Frank Gen commented on  JENKINS-52774  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Restart from Stage doesn't restore global variable   
 

  
 
 
 
 

 
 Hello, We're using a lot of classes in our pipeline libraries, and instead of passing the WorkflowScript in every single function, we are keeping a reference of that WorkflowScript in a Singleton in order to access Pipeline Functions from any of the classes. We are initializing that singleton at the beginning of our pipelines. I just noticed that we are losing the reference on the WorkflowScript on restarts, so our Pipeline is failing on the next access to the WorkflowScript singleton... Would it be somehow possible for us to reset that reference? Maybe adding some kind of configurable `onResume` callback where we could reset some of those global/singletons ourselves? Thanks  
 

  
 
 
 
 

 
 
 

 
 
 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.192670.1532690554000.2338.1575675300519%40Atlassian.JIRA.


[JIRA] (JENKINS-52774) Restart from Stage doesn't restore global variable

2019-11-02 Thread amle...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Alistair Leszkiewicz edited a comment on  JENKINS-52774  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Restart from Stage doesn't restore global variable   
 

  
 
 
 
 

 
 [~abayer] This issue is affecting us also, if you can suggest a temporary work around that would help us Thanks Restarting a stage from the original build will work, but restarting a stage twice does not work (restarting a failed restarted stage) . We rely on environment variables instead of global variables  
 

  
 
 
 
 

 
 
 

 
 
 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.192670.1532690554000.7620.1572719222035%40Atlassian.JIRA.


[JIRA] (JENKINS-52774) Restart from Stage doesn't restore global variable

2019-11-02 Thread amle...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Alistair Leszkiewicz edited a comment on  JENKINS-52774  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Restart from Stage doesn't restore global variable   
 

  
 
 
 
 

 
 [~abayer] This issue is affecting us also, if you can suggest a temporary work around that would help us Thanks  Restarting a stage from the original build will work, but restarting a stage twice does not work (restarting a failed restarted stage)  
 

  
 
 
 
 

 
 
 

 
 
 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.192670.1532690554000.7576.1572719221481%40Atlassian.JIRA.


[JIRA] (JENKINS-52774) Restart from Stage doesn't restore global variable

2019-11-02 Thread amle...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Alistair Leszkiewicz commented on  JENKINS-52774  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Restart from Stage doesn't restore global variable   
 

  
 
 
 
 

 
 Andrew Bayer This issue is affecting us also, if you can suggest a temporary work around that would help us Thanks  
 

  
 
 
 
 

 
 
 

 
 
 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.192670.1532690554000.7561.1572719040393%40Atlassian.JIRA.


[JIRA] (JENKINS-52774) Restart from Stage doesn't restore global variable

2018-11-16 Thread fnas...@redhat.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Fernando Nasser commented on  JENKINS-52774  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Restart from Stage doesn't restore global variable   
 

  
 
 
 
 

 
 Daniel Kurzynski I saved some state in a file and if it fails and is restarted I read what I need from that file (you need set preserveStashes() I believe, I did it but I am not sure). It worked fine. For skipping steps, etc., there is a JIRA to get the isRestartedRun() and isRestartedStage() into variables that can be used outside of the when{}  
 

  
 
 
 
 

 
 
 

 
 
 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-52774) Restart from Stage doesn't restore global variable

2018-11-16 Thread andrew.ba...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Andrew Bayer commented on  JENKINS-52774  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Restart from Stage doesn't restore global variable   
 

  
 
 
 
 

 
 Daniel Kurzynski - no, just stashes - preserving program state (like global variables or singletons) is a deeper, more complex problem area than Declarative goes, and is replete with painpoints. Sorry.  
 

  
 
 
 
 

 
 
 

 
 
 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-52774) Restart from Stage doesn't restore global variable

2018-10-11 Thread daniel.kurzyn...@sap.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Daniel Kurzynski edited a comment on  JENKINS-52774  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Restart from Stage doesn't restore global variable   
 

  
 
 
 
 

 
 What about the original issue? Is there a plan to restore more in the future than just the stashes. Our use case is, that we are reading some configuration in the init stage and store them in a global variable or singleton object (object defined in vars of a lib). The configuration is basically about which stages in the declarative pipeline should be skipped but it contains also information  the  to  define the behavior of stages, e.g. where to deploy. Without that configuration it does not make sense to restart at a certain stage, because it will not skip stages as defined in the configuration or deployment information are missing. Thus, we need  to  the  possibility to restore additional state or have some initialization method in case the pipeline is restarted at a later  state  stage .  
 

  
 
 
 
 

 
 
 

 
 
 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-52774) Restart from Stage doesn't restore global variable

2018-10-11 Thread daniel.kurzyn...@sap.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Daniel Kurzynski commented on  JENKINS-52774  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Restart from Stage doesn't restore global variable   
 

  
 
 
 
 

 
 What about the original issue? Is there a plan to restore more in the future than just the stashes.  Our use case is, that we are reading some configuration in the init stage and store them in a global variable or singleton object (object defined in vars of a lib). The configuration is basically about which stages in the declarative pipeline should be skipped but it contains also information the define the behavior of stages, e.g. where to deploy.  Without that configuration it does not make sense to restart at a certain stage, because it will not skip stages as defined in the configuration or deployment information are missing.  Thus, we need to possibility to restore additional state or have some initialization method in case the pipeline is restarted at a later state.  
 

  
 
 
 
 

 
 
 

 
 
 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-52774) Restart from Stage doesn't restore global variable

2018-08-22 Thread andrew.ba...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Andrew Bayer assigned an issue to Andrew Bayer  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-52774  
 
 
  Restart from Stage doesn't restore global variable   
 

  
 
 
 
 

 
Change By: 
 Andrew Bayer  
 
 
Assignee: 
 Andrew Bayer  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396)  
 

  
 

   





-- 
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-52774) Restart from Stage doesn't restore global variable

2018-08-22 Thread andrew.ba...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Andrew Bayer commented on  JENKINS-52774  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Restart from Stage doesn't restore global variable   
 

  
 
 
 
 

 
 I feel like it's probably not ideal for that latter scenario, but I'll talk about that over on JENKINS-53913. =)  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396)  
 

  
 

   





-- 
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-52774) Restart from Stage doesn't restore global variable

2018-08-22 Thread fnas...@redhat.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Fernando Nasser commented on  JENKINS-52774  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Restart from Stage doesn't restore global variable   
 

  
 
 
 
 

 
 Wow!  That would indeed solve my problem at least: I just need to save a number.  For a few values this would be more than enough.  And for something more elaborate the stash/unstash would be justifiable. This could perhaps provide another workaround for https://issues.jenkins-ci.org/browse/JENKINS-53193  as checking for the value of a variable can indicate if it is a restart or not.    
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396)  
 

  
 

   





-- 
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-52774) Restart from Stage doesn't restore global variable

2018-08-22 Thread andrew.ba...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Andrew Bayer commented on  JENKINS-52774  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Restart from Stage doesn't restore global variable   
 

  
 
 
 
 

 
 Lemme think on this. It may be viable for us to be able to do something like record some information in the previous build explicitly and then be able to refer to that data in the restarted build. Like (and this is really, really hand-wave-y, so don't take this as anything but speculation) this, maybe? 

 

stage('some-stage') {
  steps {
setPersistentEnv(key: "FOO", value: "abcd")
  }
}
stage('stage-to-restart') {
  steps {
echo "FOO is ${env.FOO}"
  }
}
 

 Again, totally not sure if that's actually useful or if it's even possible to implement cleanly.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396)  
 

  
 

   





-- 
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-52774) Restart from Stage doesn't restore global variable

2018-08-22 Thread fnas...@redhat.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Fernando Nasser commented on  JENKINS-52774  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Restart from Stage doesn't restore global variable   
 

  
 
 
 
 

 
 My use case is that I need my step to work differently on restart, so I need to save a value from the previous attempt. The restart feature is wonderful and flexible but loses all data, so we have currently a mandatory process for all restarts that need some data from the previous attempt:   write to file -> stash (restart) unstash -> read from file   It seems to be a very common use case, so some way of preserving some data will very much enhance the experience with restarts.    
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396)  
 

  
 

   





-- 
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.