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 merge before running CI on main #12392

Closed
driazati opened this issue Aug 11, 2022 · 0 comments · Fixed by #13372
Closed

[ci] Don't merge before running CI on main #12392

driazati opened this issue Aug 11, 2022 · 0 comments · Fixed by #13372
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 11, 2022

Here Jenkins fetches the latest main and merges code with it to make sure PRs are up to date before running everything:

// Determine merge commit to use for all stages
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 should have a guard so it doesn't happen on main (i.e. when env.BRANCH_NAME is main) and instead upstream_revision is just set to HEAD. Right now the behavior is not correct, since if 2 builds come in in rapid succession, the first one would get merged with the later one and wouldn't be tested independently. This also messes up re-runs of old builds on main since they get merged with the current main.

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 11, 2022
@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 pushed a commit that referenced this issue Nov 14, 2022
This PR does not merge `main` if CI is running already on `main`. It aims to avoid a case where a race happens between two subsequent commits, and one of them merges the other.

Fixes #12392.
xinetzone pushed a commit to daobook/tvm that referenced this issue Nov 25, 2022
This PR does not merge `main` if CI is running already on `main`. It aims to avoid a case where a race happens between two subsequent commits, and one of them merges the other.

Fixes apache#12392.
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.

3 participants