[JIRA] (JENKINS-51865) Stage locks are created for skipped stages in declarative pipeline
Title: Message Title Falko Modler commented on JENKINS-51865 Re: Stage locks are created for skipped stages in declarative pipeline Liam Newman I have just resolved this ticket because the fix is in cluded in 1.4.0. I am not familiar with the overall ticket workflow, though. So I leave it up to you (or Andrew Bayer) to close this issue. 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.191345.1528726775000.13286.1573643640675%40Atlassian.JIRA.
[JIRA] (JENKINS-51865) Stage locks are created for skipped stages in declarative pipeline
Title: Message Title Falko Modler edited a comment on JENKINS-51865 Re: Stage locks are created for skipped stages in declarative pipeline [~bitwiseman] I have just resolved this ticket because the fix is included in cluded in 1.4.0. I am not familiar with the overall ticket workflow, though.So I leave it up to you (or [~abayer]) to close this issue. 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.191345.1528726775000.13288.1573643640774%40Atlassian.JIRA.
[JIRA] (JENKINS-51865) Stage locks are created for skipped stages in declarative pipeline
Title: Message Title Falko Modler updated JENKINS-51865 Jenkins / JENKINS-51865 Stage locks are created for skipped stages in declarative pipeline Change By: Falko Modler Status: Open Fixed but Unreleased Resolution: Fixed Released As: https://github.com/jenkinsci/pipeline-model-definition-plugin/releases/tag/pipeline-model-definition-1.4.0 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.191345.1528726775000.13264.1573643581543%40Atlassian.JIRA.
[JIRA] (JENKINS-51865) Stage locks are created for skipped stages in declarative pipeline
Title: Message Title Falko Modler updated JENKINS-51865 Jenkins / JENKINS-51865 Stage locks are created for skipped stages in declarative pipeline Change By: Falko Modler Status: Fixed but Unreleased Resolved 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.191345.1528726775000.13266.1573643581587%40Atlassian.JIRA.
[JIRA] (JENKINS-51865) Stage locks are created for skipped stages in declarative pipeline
Title: Message Title Falko Modler assigned an issue to Falko Modler Jenkins / JENKINS-51865 Stage locks are created for skipped stages in declarative pipeline Change By: Falko Modler Assignee: Andrew Bayer Falko Modler 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.191345.1528726775000.13245.1573643520439%40Atlassian.JIRA.
[JIRA] (JENKINS-51865) Stage locks are created for skipped stages in declarative pipeline
Title: Message Title Falko Modler commented on JENKINS-51865 Re: Stage locks are created for skipped stages in declarative pipeline I created a PR for this: https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/356 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.191345.1528726775000.8398.1571179260456%40Atlassian.JIRA.
[JIRA] (JENKINS-51865) Stage locks are created for skipped stages in declarative pipeline
Title: Message Title Falko Modler edited a comment on JENKINS-51865 Re: Stage locks are created for skipped stages in declarative pipeline [~wgc123]{quote}It also doesn’t work because either you hardcore “dummy” and potentially block on it{quote}Those potential blocks/locks are very short-lived. You could also define a pool of multiple "dummy" resources to further reduce the (already very small) impact.So this partial workaround is better than nothing.[~abayer]{quote}You can always put lock or timeout (and any other block-scoped options) in your steps instead.{quote}Unfortunately, this is no solution/workaround for {{post}} blocks. E.g. you lock some external resource/server and in ` {{ post ` }} you want to collect the server's logfiles (regardless of the build status).So IMHO, {{beforeOptions}} is still needed. 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-51865) Stage locks are created for skipped stages in declarative pipeline
Title: Message Title Falko Modler commented on JENKINS-51865 Re: Stage locks are created for skipped stages in declarative pipeline D Pasto It also doesn’t work because either you hardcore “dummy” and potentially block on it Those potential blocks/locks are very short-lived. You could also define a pool of multiple "dummy" resources to further reduce the (already very small) impact. So this partial workaround is better than nothing. Andrew Bayer You can always put lock or timeout (and any other block-scoped options) in your steps instead. Unfortunately, this is no solution/workaround for post blocks. E.g. you lock some external resource/server and in `post` you want to collect the server's logfiles (regardless of the build status). So IMHO, beforeOptions is still needed. 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-51865) Stage locks are created for skipped stages in declarative pipeline
Title: Message Title D Pasto commented on JENKINS-51865 Re: Stage locks are created for skipped stages in declarative pipeline It also doesn’t work because either you hardcore “dummy” and potentially block on it or you randomize and create all sorts of crap in your Jenkins config 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-51865) Stage locks are created for skipped stages in declarative pipeline
Title: Message Title Falko Modler commented on JENKINS-51865 Re: Stage locks are created for skipped stages in declarative pipeline Stephen Connolly thanks for sharing your workaround. Unfortunately this won't work in case the criteria to check of is calculcated in a previous stage, e.g.: pipeline { stages { stage('Calculate criteria') { steps { script { someCriteria = true } } } stage('Example stage') { when { _expression_ { return someCriteria } } options { lock resource: "${someCriteria ? 'example resource':'dummy'}" } steps { // ... } } } } This will fail in options with: groovy.lang.MissingPropertyException: No such property: someCriteria for class: groovy.lang.Binding 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-51865) Stage locks are created for skipped stages in declarative pipeline
Title: Message Title Stephen Connolly commented on JENKINS-51865 Re: Stage locks are created for skipped stages in declarative pipeline Ok that is an acceptable workaround for my use case 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-51865) Stage locks are created for skipped stages in declarative pipeline
Title: Message Title Stephen Connolly updated an issue Jenkins / JENKINS-51865 Stage locks are created for skipped stages in declarative pipeline Change By: Stephen Connolly Attachment: Screenshot 2019-01-30 at 10.56.27.png 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-51865) Stage locks are created for skipped stages in declarative pipeline
Title: Message Title Stephen Connolly commented on JENKINS-51865 Re: Stage locks are created for skipped stages in declarative pipeline so `quantity:0` doens't work as that is the default value and seems to indicate "grab all". I'm now trying: pipeline { stages { stage('Example stage') { when { branch 'master' } options { lock resource: "${BRANCH_NAME=='master' ? 'example resource':'dummy'}" } steps { // ... } } } } We'll see if that is an acceptable workaround for my use case 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-51865) Stage locks are created for skipped stages in declarative pipeline
Title: Message Title Stephen Connolly commented on JENKINS-51865 Re: Stage locks are created for skipped stages in declarative pipeline Andrew Bayer perhaps we could work around this by using an _expression_ in the quantity of the lock, e.g. pipeline { stages { stage('Example stage') { when { _expression_ { false } } options { lock resource: 'example resource', quantity: expr ? 1 : 0 } steps { // ... } } } } What I do not know is if declarative supports numerical expressions 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-51865) Stage locks are created for skipped stages in declarative pipeline
Title: Message Title Andrew Bayer commented on JENKINS-51865 Re: Stage locks are created for skipped stages in declarative pipeline So the only way we could address this directly would be to add a beforeOptions flag to when - but I'm not sure that's actually worth doing. You can always put lock or timeout (and any other block-scoped options) in your steps instead. The more complexity we add to when flags (since we're already adding beforeInput in JENKINS-50880), the hairier the code gets, and this case is one that can largely be worked around (unlike with agent and input). The workaround would create scenarios where, say, timeout or lock wouldn't be in place for acquiring the agent or waiting for input, but it would still work fine for everything in steps. Does that sound reasonable to you? 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.