[JIRA] (JENKINS-48475) Build step returns null if propagate set to true

6 views
Skip to first unread message

vsluzky23@gmail.com (JIRA)

unread,
Feb 11, 2018, 4:04:02 PM2/11/18
to jenkinsc...@googlegroups.com
vadim sluzky commented on Bug JENKINS-48475
 
Re: Build step returns null if propagate set to true

I can not agree that this is a correct behavior. It's a blocker for the following use case I'm trying to implement:

  • Run a set of tests represented by Jenkins Jobs
  • For jobs that fail post name of the test and a link to a corresponding build

For failing tests build step returns null and I can't get BUILD_URL

May you suggest an alternative way to unblock me?

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

andrew.bayer@gmail.com (JIRA)

unread,
Feb 11, 2018, 4:47:02 PM2/11/18
to jenkinsc...@googlegroups.com

vsluzky23@gmail.com (JIRA)

unread,
Feb 11, 2018, 5:01:02 PM2/11/18
to jenkinsc...@googlegroups.com

Got it. I set propagate to false and then analyzed result field. Thank you for quick help, Andrew!

vsluzky23@gmail.com (JIRA)

unread,
Feb 11, 2018, 8:01:02 PM2/11/18
to jenkinsc...@googlegroups.com

There is still a problem with that implementation.

If propagate is set to false, all the corresponding tests are displayed in GREEN

Is it possible to let the upstream  job know about failures?

 

 

vsluzky23@gmail.com (JIRA)

unread,
Feb 11, 2018, 8:04:04 PM2/11/18
to jenkinsc...@googlegroups.com
vadim sluzky edited a comment on Bug JENKINS-48475
There is still a problem with that implementation.

If propagate is set to false, all the corresponding tests are displayed in GREEN

Is it possible to let the upstream  job know about failures?

Are there any problems with returning real non-null result if wait is true?

 

 

vsluzky23@gmail.com (JIRA)

unread,
Feb 11, 2018, 9:03:03 PM2/11/18
to jenkinsc...@googlegroups.com
vadim sluzky edited a comment on Bug JENKINS-48475
There is still a problem with that implementation.

If propagate is set to false, all the corresponding tests are displayed in GREEN

Is it possible to let the upstream  job know about failures?

Are there any problems with returning real non-null result if wait is true?

  What is the logic behind using 'propagate' field to whether returning result?

I strongly believe it should be returned or not based on 'wait' parameter and this is a valid non-minor defects that does not have a workaround

 

vsluzky23@gmail.com (JIRA)

unread,
Feb 11, 2018, 9:04:02 PM2/11/18
to jenkinsc...@googlegroups.com
vadim sluzky edited a comment on Bug JENKINS-48475
There is still a problem with that implementation.

If propagate is set to false, all the corresponding tests are displayed in GREEN

Is it possible to let the upstream  job know about failures?

Are there any problems with returning real non-null result if wait is true?

 What is the logic behind using 'propagate' field to whether returning result?

I strongly believe it should be returned or not based on 'wait' parameter and this is a valid non-minor defects defect that does not have a workaround and needs to be fixed

 

vsluzky23@gmail.com (JIRA)

unread,
Feb 12, 2018, 10:52:03 AM2/12/18
to jenkinsc...@googlegroups.com
vadim sluzky reopened an issue
 

I can not agree with resolution "Resolved" because it is "not a defect".

If a build is not SUCCESSFUL, there is a need to have it results like a link to BUILD_URL.

Consider the following use case:

    Run Tests as Jenkins jobs called from pipeline

    Provide links to jobs that failed

The suggested solution is to set propagate to false that results in displaying all builds/tests as SUCCESSFUL - it's not acceptable.

IMO, whether or not to return results of execution should depend on wait parameter. If wait is true, results should be available and should be returned. If wait is false - build is only launched without waiting to its completion - then result is not available.

That should not be related to 'propagate' 

Jenkins / Bug JENKINS-48475
Change By: vadim sluzky
Resolution: Not A Defect
Status: Resolved Reopened

andrew.bayer@gmail.com (JIRA)

unread,
Feb 12, 2018, 11:57:02 AM2/12/18
to jenkinsc...@googlegroups.com
Andrew Bayer commented on Bug JENKINS-48475
 
Re: Build step returns null if propagate set to true

So this is definitely a confusing setting, no question. The problem here is that propagate really just means "if the downstream build fails, this step fails too". That directly results in returning null - a failed Pipeline step can't return anything. I'll leave this open in case an alternative approach comes to mind, but I don't think there's a way to achieve what you want.

vsluzky23@gmail.com (JIRA)

unread,
Feb 12, 2018, 12:04:02 PM2/12/18
to jenkinsc...@googlegroups.com

An alternative might be parsing upstream's job output, but this looks like too weird workaround. I surmise that result's data is available if wait is true and can be returned - please correct me if I'm wrong 

andrew.bayer@gmail.com (JIRA)

unread,
Feb 12, 2018, 12:06:03 PM2/12/18
to jenkinsc...@googlegroups.com

You can definitely act on the downstream run's result - def foo = build ...; if (foo.result != "SUCCESS") ..., e.g. But the build step itself will still be marked as successful.

vsluzky23@gmail.com (JIRA)

unread,
Feb 12, 2018, 12:09:03 PM2/12/18
to jenkinsc...@googlegroups.com

Yes, I tried that way and it's not acceptable in my case because build steps are marked as passed

andrew.bayer@gmail.com (JIRA)

unread,
Feb 12, 2018, 12:28:02 PM2/12/18
to jenkinsc...@googlegroups.com

Sorry to hear that - then you are stuck, since as I said, at least in current Pipeline design, a step can't both fail and return something.

jglick@cloudbees.com (JIRA)

unread,
Jun 3, 2019, 11:39:02 AM6/3/19
to jenkinsc...@googlegroups.com
Jesse Glick updated an issue
 
Jenkins / Improvement JENKINS-48475
Change By: Jesse Glick
Issue Type: Bug Improvement
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

wessely.werner@gmail.com (JIRA)

unread,
Dec 12, 2019, 3:11:03 AM12/12/19
to jenkinsc...@googlegroups.com
Werner Wessely commented on Improvement JENKINS-48475
 
Re: Build step returns null if propagate set to true

I am sure vadim figured it out already but heres what we do just for anybody else. We also need some info on failing downstreams, you can get it from the object thrown by the build step, for example the build number:

 

Its not the best thing ever but we just use it as a workaround for a different blue ocean problem that will hopefully be fixed soon:

try {
 build(...)
}
catch (Exception e) {
 e.toString().split(" ").each {
      if(it.contains("#")) {
        def buildNumber = it.substring(1)
...
      }
    }
}

 

This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages