-
Bug
-
Resolution: Unresolved
-
Minor
-
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
- Trigger parameterized build on other projects
- 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'
- pipeline src
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
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. |
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. |
Assignee | Original: Mark Waite [ markewaite ] |
Attachment | New: image-2021-04-23-14-35-32-951.png [ 54658 ] |
sratz I don't intend to change that behavior. The git step is an intentionally simplified and limited form. Use the checkout step if you need to perform a checkout of a specific SHA-1 or branch that is not the value expected by the git step.