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

build-user-vars-plugin fails to find correct userId with build pipeline plugin

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      With a build pipeline where a downstream plugin is triggered manually from the pipeline view, the BUILD_ environment variables are set from the originating build at the start of the pipeline instead of from the user who manually triggered the build.

      I suspect the build user vars plugin is recursing the getCauses or upstreamCauses until it finds a UserIdCause, however this only deals with the first causeAction of each build.

      It should rather get all causes using: build.getActions(hudson.model.CauseAction.class) 

      and recurse the cause chain similarly by referring to:  cause.upstreamRun.getActions(hudson.model.CauseAction.class) instead of cause.upStreamCauses

      The triggering userId can be found as one of the causes of the build itself, rather than chasing up the upstreamCause

      More detail here: https://stackoverflow.com/a/52816573/2332068

        Attachments

          Activity

          Hide
          samliddicott Sam Liddicott added a comment -

          This bug is triggered on a rebuild of a downstream job from the pipeline view.
          On the initial build, the Cause$USerIdCause is the first cause, on a rebuild it is the second cause and the upstream is the first cause.

          Show
          samliddicott Sam Liddicott added a comment - This bug is triggered on a rebuild of a downstream job from the pipeline view. On the initial build, the Cause$USerIdCause is the first cause, on a rebuild it is the second cause and the upstream is the first cause.

            People

            • Assignee:
              Unassigned
              Reporter:
              samliddicott Sam Liddicott
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: