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

Upstream/Downstream information not shown in pipeline jobs

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Duplicate
    • Component/s: pipeline
    • Environment:
      Jenkins version 2.19.2 running on a linux x64 machine kernel 3.12.28-4-default, apache and Java 1.7.0_65
      Pipeline plugin 2.14
      (more information can be provided if needed)
    • Similar Issues:

      Description

      Two pipeline jobs were created, 

      Job 1, named TEST_PIPELINE, pipeline script content:

      stage ('testing') {
      {{ build job: 'TEST_PIPELINE_2', wait: true, propagate: false }}
      }

      Job 2, named TEST_PIPELINE_2, pipeline script content

      stage ('testing') {
      {{ println ('Hello world!') }}
      }

      Test execution:

      1. Start manually the job TEST_PIPELINE

      Expected result:

      1. TEST_PIPELINE Job is executed correctly, triggering the TEST_PIPELINE_2 Job -> OK
      2. TEST_PIPELINE_2 is executed correctly -> OK
      3. Information about the triggering is shown in the TEST_PIPELINE console information -> OK
      4. Job information in TEST_PIPELINE shows the Downstream job information -> Not OK: no information about downstream job is shown
        1. Build result shows the downstream job information -> Not OK: only way to check that a job was triggered is through the console
      5. Job Information in TEST_PIPELINE_2 shows the Upstream job information -> Not OK: not information about upstream job is shown
        1. Build result shows the upstream job information -> Not OK, but that information is shown in the "triggering" information section

      That feature is working if you are not using pipelines, I do not know why it is not working in my setting: maybe I am missing a parameter, or a plugin, but googling for it delivered no results

      I expected the list of upstream/downstream jobs to be correctly filled, what in my case, is not happening

        Attachments

          Issue Links

            Activity

            Hide
            jglick Jesse Glick added a comment -

            Pipeline has no support for the upstream/downstream job system, in part due to technical limitations, in part due to the fact that there is no static job configuration that would make this possible except by inspecting recent build metadata.

            Show
            jglick Jesse Glick added a comment - Pipeline has no support for the upstream/downstream job system, in part due to technical limitations, in part due to the fact that there is no static job configuration that would make this possible except by inspecting recent build metadata.
            Hide
            jose_camacho Jose Camacho added a comment - - edited

            I know this issue is closed, but just in case anyone comes here with the same question and as long as the solution is still ongoing, I include here our workaround. It is based in the rtp (Rich Text Publisher) plugin, that you should have installed to make it work:

            At the end of our Jenkinsfile and after triggering the job, we wait it to finish. In that case, build () returns the object used to run the downstream job.We get the info from it.

            Warning: getAbsoluteUrl () function is a critical one. Use it at your own risk!

            def startedBld = build(
                job: YOUR_DOWNSTREAM_JOB,
                wait: true, // VERY IMPORTANT, otherwise build () does not return expected object
                propagate: true
            )

            // Publish the started build information in the Build result
            def text = '<h2>Downstream jobs</h2>Started job <a href="' + startedBld.rawBuild.getAbsoluteUrl () + '">' + startedBld.rawBuild.toString () + '</a>'
            rtp (nullAction: '1',parserName: 'HTML', stableText: text)

            Show
            jose_camacho Jose Camacho added a comment - - edited I know this issue is closed, but just in case anyone comes here with the same question and as long as the solution is still ongoing, I include here our workaround. It is based in the rtp (Rich Text Publisher) plugin, that you should have installed to make it work: At the end of our Jenkinsfile and after triggering the job, we wait it to finish. In that case, build () returns the object used to run the downstream job.We get the info from it. Warning: getAbsoluteUrl () function is a critical one. Use it at your own risk! def startedBld = build(     job: YOUR_DOWNSTREAM_JOB,     wait: true, // VERY IMPORTANT, otherwise build () does not return expected object     propagate: true ) // Publish the started build information in the Build result def text = '<h2>Downstream jobs</h2>Started job <a href="' + startedBld.rawBuild.getAbsoluteUrl () + '">' + startedBld.rawBuild.toString () + '</a>' rtp (nullAction: '1',parserName: 'HTML', stableText: text)

              People

              • Assignee:
                Unassigned
                Reporter:
                jose_camacho Jose Camacho
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: