Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-26124

Blocking build trigger step could inline output

    Details

    • Similar Issues:

      Description

      When running a blocking build trigger, you may like to see output from the downstream build inlined into the flow's output.

        Attachments

          Issue Links

            Activity

            Hide
            stodorov Steve Todorov added a comment -

            Are there any plans for implementing this? You have this already implemented for parallel stages which are running on multiple nodes - in our case we have parallel jobs running and the only output you get is:

            Scheduling project: project
            Starting building: project
            

            You can navigate to the project and check the logs from there, but when you have 15 jobs and each one has multiple stages which you want to check it makes navigation hard as you need to click "back" button in the browser and that goes through all the pages you've visited. Maybe as a "workaround" we could create a new issue which adds a "triggered by" button which allows you to go back to the job#number which triggered the job you are currently looking (similar to "Triggered Builds" which shows when the current job triggers another job, but backwards) ?

            Show
            stodorov Steve Todorov added a comment - Are there any plans for implementing this? You have this already implemented for parallel stages which are running on multiple nodes - in our case we have parallel jobs running and the only output you get is: Scheduling project: project Starting building: project You can navigate to the project and check the logs from there, but when you have 15 jobs and each one has multiple stages which you want to check it makes navigation hard as you need to click "back" button in the browser and that goes through all the pages you've visited. Maybe as a "workaround" we could create a new issue which adds a "triggered by" button which allows you to go back to the job#number which triggered the job you are currently looking (similar to "Triggered Builds" which shows when the current job triggers another job, but backwards) ?
            Hide
            rustycar54 Rusty Carruth added a comment -

            Lacking this, I did some searching and found a way to 'mostly' work around it (see https://stackoverflow.com/questions/48460437/how-to-get-console-output-of-downstream-job-in-upstream-job ) for details. I'm adding it here so people trying to work around the issue have a pointer to a possible solution.

            Basically (quoting directly from the above post):

            def checkjob = build job: 'job name', parameters: [ any params here]
            checklog = Jenkins.getInstance().getItemByFullName('job name').getBuildByNumber(checkjob.getNumber()).log
            println checklog

            Yes, there are negative issues with that solution, but for my needs I think its probably 'good enough'.

            Show
            rustycar54 Rusty Carruth added a comment - Lacking this, I did some searching and found a way to 'mostly' work around it (see https://stackoverflow.com/questions/48460437/how-to-get-console-output-of-downstream-job-in-upstream-job ) for details. I'm adding it here so people trying to work around the issue have a pointer to a possible solution. Basically (quoting directly from the above post): def checkjob = build job: 'job name', parameters: [ any params here] checklog = Jenkins.getInstance().getItemByFullName('job name').getBuildByNumber(checkjob.getNumber()).log println checklog Yes, there are negative issues with that solution, but for my needs I think its probably 'good enough'.
            Hide
            jglick Jesse Glick added a comment -

            I suppose you meant

            def checklog = checkjob.rawBuild.log
            

            This will not work in the Groovy sandbox, and is likely to have poor performance, among other issues.

            Show
            jglick Jesse Glick added a comment - I suppose you meant def checklog = checkjob.rawBuild.log This will not work in the Groovy sandbox, and is likely to have poor performance, among other issues.
            Hide
            rustycar54 Rusty Carruth added a comment -

            I have no idea what I meant, sorry.  I've been using Jenkins for a while, and have cobbled together something that works, sort of.  Short version is I had to use a sub job so I could run on a different host than the parent job.  (Very long story, I'll leave it for now).

            And, as you say, my example failed, so I switched to yours, and it works great, thank you.

            Given that the jobs we run tend to run for HOURS, if not days, I'm not very concerned about performance unless its something really bad.  This command will get run no more than 2 times per stage, and a day-long run has maybe 10 to 20 stages, maximum. 

            I am, however a little concerned about the 'other issues'.  If someone can point me to where to find issues (indeed, documentation! - I'm still struggling to find things) - I would be grateful and will go off and read.

             

            Thanks!

            Show
            rustycar54 Rusty Carruth added a comment - I have no idea what I meant, sorry.  I've been using Jenkins for a while, and have cobbled together something that works, sort of.  Short version is I had to use a sub job so I could run on a different host than the parent job.  (Very long story, I'll leave it for now). And, as you say, my example failed, so I switched to yours, and it works great, thank you. Given that the jobs we run tend to run for HOURS, if not days, I'm not very concerned about performance unless its something really bad.  This command will get run no more than 2 times per stage, and a day-long run has maybe 10 to 20 stages, maximum.  I am, however a little concerned about the 'other issues'.  If someone can point me to where to find issues (indeed, documentation! - I'm still struggling to find things) - I would be grateful and will go off and read.   Thanks!
            Hide
            jglick Jesse Glick added a comment -

            run on a different host

            Not sure what that means. The build step only supports triggering a job on the same Jenkins service. Of course if you are talking about different agents, that can be done trivially inside a single Pipeline build.

            Besides being insecure and slow, I guess there are no particular issues!

            Show
            jglick Jesse Glick added a comment - run on a different host Not sure what that means. The build step only supports triggering a job on the same Jenkins service. Of course if you are talking about different agents , that can be done trivially inside a single Pipeline build. Besides being insecure and slow, I guess there are no particular issues!

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                jglick Jesse Glick
              • Votes:
                12 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated: