Here we find the latest commit and merge with it before running a PR through CI to prevent merge conflicted PRs from taking up CI time.
|
sh ( |
|
script: 'git fetch origin main', |
|
label: 'Fetch upstream', |
|
) |
|
if (upstream_revision == null) { |
|
upstream_revision = sh( |
|
script: 'git log -1 FETCH_HEAD --format=\'%H\'', |
|
label: 'Determine upstream revision', |
|
returnStdout: true, |
|
).trim() |
This is fine except when we change the Jenkinsfile that always comes from the PR's git merge-base origin/main <pr_commit>, so if that references files that have been moved in the latest commit on main there will be random CI failures like https://ci.tlcpack.ai/blue/organizations/jenkins/tvm/detail/PR-12648/3/pipeline/. To fix this we should either:
- don't merge at all and run the PR as is
- find the last 'safe' commit (i.e. the last commit between
origin/main and the git merge-base origin/main <pr_commit> that has no Jenkinsfile modifications) and merge to that
cc @Mousius @areusch @gigiblender
Here we find the latest commit and merge with it before running a PR through CI to prevent merge conflicted PRs from taking up CI time.
tvm/ci/jenkins/Prepare.groovy.j2
Lines 17 to 26 in caf326f
This is fine except when we change the
Jenkinsfilethat always comes from the PR'sgit merge-base origin/main <pr_commit>, so if that references files that have been moved in the latest commit onmainthere will be random CI failures like https://ci.tlcpack.ai/blue/organizations/jenkins/tvm/detail/PR-12648/3/pipeline/. To fix this we should either:origin/mainand thegit merge-base origin/main <pr_commit>that has noJenkinsfilemodifications) and merge to thatcc @Mousius @areusch @gigiblender