-
New Feature
-
Resolution: Unresolved
-
Minor
-
None
Currently the git-plugin can checkout the current head, or a specific commit, what I'm missing is an option to checkout the head at the time where the build has started.
Reason: if you have a pipeline build that was triggered at a certain time, and the devlopers checked in something before the checkout takes place these changes are picked up even if the build is already running for a while.
For example I have a pipeline that builds different repositories together one after the other. It now can happen that a build starts, checkout the first repository, then checkout the second but picks up changes commited at a later point at time (and fail because changes from the first repository are not taken into account).
The same happens if you replay a certain pipeline build, it always fetches the ltest changes and not the changes that where current at the time of the build (so replay is more a "rebuild with different script" because the build is not really replayed.
I'm a bit confused if this is a bug or a feature request:
Jenkins docs describe:
https://jenkins.io/doc/book/pipeline/jenkinsfile/
In this scenario:
1) Commit to master commit sha abc
2) Block pipeline on manual step or whatever, `checkout scm` will checkout abc
3) Push new commit, sha xyz
3) resume pipeline
4) later pipeline stage also runs `checkout scm`
Do you expect abc or xyz? Per docs I would expect xyz?
In your scenario, you are:
1) commit to master commit sha abc
2) build triggered, jenkins starts its thing
3) before `checkout scm` run, push another commit xyz
And you're observing 'xyz' is checked out and not 'abc'? Is that accurate?