[JIRA] (JENKINS-41012) when {branch} stage conditional is busted (mostly)

3 views
Skip to first unread message

smazurov@gmail.com (JIRA)

unread,
Jan 11, 2017, 7:44:01 PM1/11/17
to jenkinsc...@googlegroups.com
Stepan Mazurov updated an issue
 
Jenkins / Bug JENKINS-41012
when {branch} stage conditional is busted (mostly)
Change By: Stepan Mazurov
Summary: when { } branch } stage conditional is busted (mostly)
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

andrew.bayer@gmail.com (JIRA)

unread,
Jan 11, 2017, 7:47:01 PM1/11/17
to jenkinsc...@googlegroups.com
Andrew Bayer assigned an issue to rsandell
Change By: Andrew Bayer
Assignee: Andrew Bayer rsandell

andrew.bayer@gmail.com (JIRA)

unread,
Jan 11, 2017, 7:48:01 PM1/11/17
to jenkinsc...@googlegroups.com

andrew.bayer@gmail.com (JIRA)

unread,
Jan 11, 2017, 8:36:01 PM1/11/17
to jenkinsc...@googlegroups.com
Andrew Bayer assigned an issue to Andrew Bayer
 
Change By: Andrew Bayer
Assignee: rsandell Andrew Bayer

andrew.bayer@gmail.com (JIRA)

unread,
Jan 11, 2017, 8:37:01 PM1/11/17
to jenkinsc...@googlegroups.com
Andrew Bayer started work on Bug JENKINS-41012
 
Change By: Andrew Bayer
Status: Open In Progress

andrew.bayer@gmail.com (JIRA)

unread,
Jan 11, 2017, 8:38:01 PM1/11/17
to jenkinsc...@googlegroups.com
 
Re: when {branch} stage conditional is busted (mostly)

Check that, I got it. getContextVariables() basically did nothing useful - it was always getting a null step and so not giving us a context to work with. I've got a branch that'll be up for review momentarily that changes the branch and env conditions to get passed the value to check against rather than trying to find it for themselves. Also we only had negative tests for branch and env, which is...embarrassing.

andrew.bayer@gmail.com (JIRA)

unread,
Jan 11, 2017, 8:42:01 PM1/11/17
to jenkinsc...@googlegroups.com

andrew.bayer@gmail.com (JIRA)

unread,
Jan 11, 2017, 8:42:01 PM1/11/17
to jenkinsc...@googlegroups.com

scm_issue_link@java.net (JIRA)

unread,
Jan 12, 2017, 10:13:01 AM1/12/17
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Andrew Bayer
Path:
pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/when/impl/BranchConditional.java
pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/when/impl/EnvironmentConditional.java
pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/when/impl/BranchConditionalScript.groovy
pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/when/impl/EnvironmentConditionalScript.groovy
pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/AbstractModelDefTest.java
pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/BasicModelDefTest.java
pipeline-model-definition/src/test/resources/json/whenBranch.json
pipeline-model-definition/src/test/resources/json/whenBranchFalse.json
pipeline-model-definition/src/test/resources/json/whenEnv.json
pipeline-model-definition/src/test/resources/json/whenEnvFalse.json
pipeline-model-definition/src/test/resources/whenBranch.groovy
pipeline-model-definition/src/test/resources/whenBranchFalse.groovy
pipeline-model-definition/src/test/resources/whenBranchTrue.groovy
pipeline-model-definition/src/test/resources/whenEnv.groovy
pipeline-model-definition/src/test/resources/whenEnvFalse.groovy
pipeline-model-definition/src/test/resources/whenEnvTrue.groovy
http://jenkins-ci.org/commit/pipeline-model-definition-plugin/4af77f00e32e2e6c459c15564ca84b4c53a6332c
Log:
[FIXED JENKINS-41012] Actually get when branch/env to work

Stop relying on the step context, since that wasn't actually getting
provided, and instead pass in the needed arguments from the *Script
class. Also make sure we actually have tests for all the conditions
passing, not just failing. Oy, but I feel silly there.

andrew.bayer@gmail.com (JIRA)

unread,
Jan 12, 2017, 10:14:01 AM1/12/17
to jenkinsc...@googlegroups.com
 

Pushing out an emergency 0.8.2 release momentarily with this fix. Again, sorry for letting this slip through!

Change By: Andrew Bayer
Status: In Review Resolved
Resolution: Fixed

smazurov@gmail.com (JIRA)

unread,
Jan 12, 2017, 12:00:02 PM1/12/17
to jenkinsc...@googlegroups.com
Stepan Mazurov commented on Bug JENKINS-41012
 
Re: when {branch} stage conditional is busted (mostly)

No worries, this is beta software after all, thanks for taking care of it!

andrew.bayer@gmail.com (JIRA)

unread,
Jan 12, 2017, 12:55:01 PM1/12/17
to jenkinsc...@googlegroups.com

Stepan Mazurov Nonetheless, I feel sheepish. Shoulda tested better! But the release has been cut and should show up in the update center in a couple hours. Thanks for catching this and supplying such an excellent bug report - the expression comparison was really helpful, since in our test environment, we don't actually get BRANCH_NAME set by the SCM, so if I hadn't had that validation that it does get set in the real world, I'd've gone down some rathole to figure out what could be done. =)

smazurov@gmail.com (JIRA)

unread,
Jan 12, 2017, 1:45:02 PM1/12/17
to jenkinsc...@googlegroups.com

Glad I could help! Thank you for those words, I appreciate it.

bitwiseman@gmail.com (JIRA)

unread,
Oct 22, 2019, 11:24:11 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