Hi Mark,
Sorry, for incomplete picture. Here are the details you are asking.:
- It is a scripted pipeline
- Explicit checkout from a scripted Pipeline
- Pipeline snippet:
- checkout([$class: 'GitSCM',
branches: [[name: "*/${GIT_BRANCH}"]],
browser: [$class: 'GithubWeb', repoUrl: "https://${GIT_HOST}/${GIT_OWNER}/${GIT_REPOSITORY}"],
doGenerateSubmoduleConfigurations: false,
extensions: [
[$class: 'RelativeTargetDirectory', relativeTargetDir: "${GIT_REPOSITORY}"],
[$class: 'LocalBranch', localBranch: "${GIT_BRANCH}"],
[$class: 'GitLFSPull']
],
submoduleCfg: [],
userRemoteConfigs: [
[
credentialsId: '***********************',
url: "git@${GIT_HOST}:${GIT_OWNER}/${GIT_REPOSITORY}.git"
]
]
])
- Enterprise GitHub webhook provider
- No authentication token as part of its payload
- Pipeline definition stored in the git repository
- Single Pipeline job
- I am expecting that Dev-1 change will be built separately, even if the Jenkins query for the tip of the branch finds the more recent Dev-2 change.
The actual use case is that our developers provide bug id(s) in commit messages. Once the build is done, we update corresponding bug(s) with the corresponding build information, including:
- source files changes
- generated output
- link to Jenkins build
- Git SHA of the corresponding commit
- etc.
We have a requirement to be able to trigger builds on each commit to insure that only relevant information is inserted into each bug.
What happens now when commits from 2 developers happen too close to each other, is that once Jenkins queries the specified tip of the branch, it picks up additional changes from Dev-2, which may not be related to changes from Dev-1.
Ideally, I should be able to find out the SHA of the Jenkinsfile, that triggered the build and use that to do the checkout of the source code.
Please let me know if I can provide any additional info.
Please provide detailed steps that will allow someone else to duplicate the problem. Based on your description, I can't tell the answers to the following questions (and likely others related to them):
Please provide more details describing your Pipeline definition and how you see the problem.