Skip to content

[ci] Don't use latest main for PRs #12657

Closed
@driazati

Description

@driazati

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:

  1. don't merge at all and run the PR as is
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    actionablehas an immediately do-able work plan and a detailed descriptiondev:citype:ciRelates to TVM CI infrastructure

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions