dotnet-ci
dotnet-ci copied to clipboard
Push/PRs triggers that launch sub-jobs should pass checked out commit hash to sub-jobs
Right now it's possible that the checked out hash is different for different sub-jobs of a flow job. There are a few reasons:
- GitHub push events contain no info on what hash was pushed, so Jenkins can combine builds
- PR merger builds do a merge from the upstream branch into the PR branch and check out the latest hash there. That means an intervening push to upstream could cause sub-jobs to check out different hashes
The right way to do this is to pass the checked out hash (seen in the environment as GIT_COMMIT) from the root job to the sub jobs. In practice, I saw some issues with this where the checked out hash was incorrectly determined (GIT_COMMIT was actually the previous job's GIT_COMMIT). This could be a result of incorrect EnvInject caching or something else entirely.