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

Incorrect upstream project returned in build-pipeline-plugin

    Details

    • Similar Issues:

      Description

      When the plugin needs to return the upstream project it only checks the name of the job, returning the wrong job in special cases.

       

      Consider this scenario:

      /down_job
      /folderA/up_job
      /folderB/up_job

      Both up_job declare "../down_job" as the downstream project to execute manually.

      We execute both "up_job" and check a Build Pipeline View.

      When we request http://localhost:8080/job/folderA/view/foo/ the data to create the "/down_job" will be like:

      var buildData = {"id"...,"upstream":{"projectName":"../folderB/up_job","buildNumber":3}};

      We can see that things have been mixed up between two different jobs.

      The culprit is the getUpstreamPipelineBuild function (https://github.com/jenkinsci/build-pipeline-plugin/blob/master/src/main/java/au/com/centrumsystems/hudson/plugin/buildpipeline/PipelineBuild.java#L306).

      It compares all the upstream jobs of "/down_job" with the "upstreamBuild" of this pipeline build but it only compares the name. If "/folderB/up_job" if first on the list, that job will be always the upstream job for "/down_job".

      If we execute "/down_job" clicking the view of "/folderA", we will end with an execution without parent information and the card in the view will not show the results.

        Attachments

          Activity

          Show
          adrianlzt adrian lopez added a comment - PR: https://github.com/jenkinsci/build-pipeline-plugin/pull/115

            People

            • Assignee:
              Unassigned
              Reporter:
              adrianlzt adrian lopez
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: