Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
driazati opened this issue Aug 30, 2022 · 4 comments
Closed

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

driazati opened this issue Aug 30, 2022 · 4 comments
Labels
actionable has an immediately do-able work plan and a detailed description dev:ci type:ci Relates to TVM CI infrastructure

Comments

@driazati
Copy link
Member

driazati commented Aug 30, 2022

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

@driazati driazati added type:ci Relates to TVM CI infrastructure actionable has an immediately do-able work plan and a detailed description labels Aug 30, 2022
@areusch
Copy link
Contributor

areusch commented Aug 31, 2022

is this solved by #12604 ? i guess not, since it needs to know where they were moved to is the issue?

@driazati
Copy link
Member Author

right (this was actually caused by #12604), this issue would happen for any file referenced from the Jenkinsfile

@areusch
Copy link
Contributor

areusch commented Aug 31, 2022

one thing is--is this just a one-time transient issue while we reorg the code tho?

@driazati
Copy link
Member Author

driazati commented Aug 31, 2022

Yes, it can be fixed by the user by rebasing and thus changing the git merge-base origin/main to one that matches the file structure on origin/main, so this isn't like a huge deal just a minor disruption that we could avoid

@areusch areusch added the needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it label Oct 19, 2022
@janetsc janetsc added dev:ci and removed needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it labels Oct 19, 2022
driazati added a commit to driazati/tvm that referenced this issue Nov 23, 2022
This adds some CI load by running PRs that would merge-conflict with
main but improves UX by making it so CI is deterministic based on git
history rather than when the PR happened to be submitted.

Fixes apache#12657
driazati added a commit to driazati/tvm that referenced this issue Nov 23, 2022
This adds some CI load by running PRs that would merge-conflict with
main but improves UX by making it so CI is deterministic based on git
history rather than when the PR happened to be submitted.

Fixes apache#12657
@tqchen tqchen closed this as completed Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actionable has an immediately do-able work plan and a detailed description dev:ci type:ci Relates to TVM CI infrastructure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants