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

[Git][Parameterized Trigger] 'Pass-through Git commit' does not include repo URI and breaks pipeline build

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • git-plugin
    • None
    • Jenkins 2.277.3
      git-plugin 4.7.1
      parameterized-trigger 2.40

      Consider the following situation:

      • job1 (classical freestyle)
        • build
        • post
          • Trigger parameterized build on other projects
            • job2 
            • [x] Pass-through Git Commit that was built
      • job2 (pipeline):

      This constellation will fail to build, because the commit-ID passed-through from build of job1 is being used to fetch the pipeline of job2 and also (if it would get so far) would be used for the step2 of the pipeline, but it should only apply to step1.

      The technical issue is that in

      hudson.plugins.git.GitRevisionBuildParameters

      no repoURL is passed to the constructor of

      hudson.plugins.git.RevisionParameterAction.

      That one then, in canOriginateFrom() always returns true and uses the revision ID for all git repos involved in the pipeline.

          [JENKINS-65448] [Git][Parameterized Trigger] 'Pass-through Git commit' does not include repo URI and breaks pipeline build

          Sebastian Ratz created issue -
          Sebastian Ratz made changes -
          Description Original: Consider the following situation:
           * job1 (classical freestyle)
           ** build
           *** git: [https://build/repo.git]
           ** post
           *** Trigger parameterized build on other projects
           **** [x] Pass-through Git Commit that was built
           * job2 (pipeline):
           ** pipeline src
           *** from SCM: [https://pipeline.repo/pipeline.git]
           ** inside pipeline
           *** step1: git 'https://build/repo.git'
           *** step2: git 'https://another/repo.git'

          This constellation will fail to build, because the commit-ID passed-through from *build* of job1 is being used to fetch the *pipeline* of job2 and also (if it would get so far) would be used for the *step2* of the pipeline, but it should only apply to *step1*.

          The technical issue is that in

          {{hudson.plugins.git.GitRevisionBuildParameters}}

          no {{repoURL}} is not passed to the constructor of

          {{hudson.plugins.git.RevisionParameterAction}}.

          That one then, in {{canOriginateFrom()}} always returns true and uses the revision ID for all git repos involved in the pipeline.
          New: Consider the following situation:
           * job1 (classical freestyle)
           ** build
           *** git: [https://build/repo.git]
           ** post
           *** Trigger parameterized build on other projects
           **** job2 
           **** [x] Pass-through Git Commit that was built
           * job2 (pipeline):
           ** pipeline src
           *** from SCM: [https://pipeline.repo/pipeline.git]
           ** inside pipeline
           *** step1: git 'https://build/repo.git'
           *** step2: git 'https://another/repo.git'

          This constellation will fail to build, because the commit-ID passed-through from *build* of job1 is being used to fetch the *pipeline* of job2 and also (if it would get so far) would be used for the *step2* of the pipeline, but it should only apply to *step1*.

          The technical issue is that in

          {{hudson.plugins.git.GitRevisionBuildParameters}}

          no {{repoURL}} is not passed to the constructor of

          {{hudson.plugins.git.RevisionParameterAction}}.

          That one then, in {{canOriginateFrom()}} always returns true and uses the revision ID for all git repos involved in the pipeline.
          Sebastian Ratz made changes -
          Description Original: Consider the following situation:
           * job1 (classical freestyle)
           ** build
           *** git: [https://build/repo.git]
           ** post
           *** Trigger parameterized build on other projects
           **** job2 
           **** [x] Pass-through Git Commit that was built
           * job2 (pipeline):
           ** pipeline src
           *** from SCM: [https://pipeline.repo/pipeline.git]
           ** inside pipeline
           *** step1: git 'https://build/repo.git'
           *** step2: git 'https://another/repo.git'

          This constellation will fail to build, because the commit-ID passed-through from *build* of job1 is being used to fetch the *pipeline* of job2 and also (if it would get so far) would be used for the *step2* of the pipeline, but it should only apply to *step1*.

          The technical issue is that in

          {{hudson.plugins.git.GitRevisionBuildParameters}}

          no {{repoURL}} is not passed to the constructor of

          {{hudson.plugins.git.RevisionParameterAction}}.

          That one then, in {{canOriginateFrom()}} always returns true and uses the revision ID for all git repos involved in the pipeline.
          New: Consider the following situation:
           * job1 (classical freestyle)
           ** build
           *** git: [https://build/repo.git]
           ** post
           *** Trigger parameterized build on other projects
           **** job2 
           **** [x] Pass-through Git Commit that was built
           * job2 (pipeline):
           ** pipeline src
           *** from SCM: [https://pipeline.repo/pipeline.git]
           ** inside pipeline
           *** step1: git 'https://build/repo.git'
           *** step2: git 'https://another/repo.git'

          This constellation will fail to build, because the commit-ID passed-through from *build* of job1 is being used to fetch the *pipeline* of job2 and also (if it would get so far) would be used for the *step2* of the pipeline, but it should only apply to *step1*.

          The technical issue is that in

          {{hudson.plugins.git.GitRevisionBuildParameters}}

          no {{repoURL}} is passed to the constructor of

          {{hudson.plugins.git.RevisionParameterAction}}.

          That one then, in {{canOriginateFrom()}} always returns true and uses the revision ID for all git repos involved in the pipeline.
          Mark Waite made changes -
          Assignee Original: Mark Waite [ markewaite ]
          Sebastian Ratz made changes -
          Attachment New: image-2021-04-23-14-35-32-951.png [ 54658 ]

            Unassigned Unassigned
            sratz Sebastian Ratz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: