Skip to content

[CI] Merge PR against its target branch instead of main (#19712)#19775

Merged
tqchen merged 1 commit into
apache:v0.25.0from
MasterJH5574:tvm-dev/2026-06-14-v0250-ci
Jun 15, 2026
Merged

[CI] Merge PR against its target branch instead of main (#19712)#19775
tqchen merged 1 commit into
apache:v0.25.0from
MasterJH5574:tvm-dev/2026-06-14-v0250-ci

Conversation

@MasterJH5574

Copy link
Copy Markdown
Contributor

Jenkins' init_git() pre-build step unconditionally merged origin/main into every non-main branch build. For PRs targeting a release branch (e.g. v0.25.0), this merged main's diverged state into the PR and failed with conflicts in web/package.json and web/package-lock.json (main is on 0.25.0-dev1 while v0.25.0 is on 0.25.0), erroring out every CI stage before any build or test ran.

Use env.CHANGE_TARGET to merge against the PR's actual target branch, and gate the merge on a PR build (CHANGE_TARGET != null) so direct release branch builds skip merging just like main does.

(cherry picked from commit 02280c1)

Jenkins' init_git() pre-build step unconditionally merged origin/main
into every non-main branch build. For PRs targeting a release branch
(e.g. v0.25.0), this merged main's diverged state into the PR and failed
with conflicts in web/package.json and web/package-lock.json (main is on
0.25.0-dev1 while v0.25.0 is on 0.25.0), erroring out every CI stage
before any build or test ran.

Use env.CHANGE_TARGET to merge against the PR's actual target branch,
and gate the merge on a PR build (CHANGE_TARGET != null) so direct
release branch builds skip merging just like main does.

(cherry picked from commit 02280c1)
@MasterJH5574

Copy link
Copy Markdown
Contributor Author

CI on branch v0.25.0 is fixed after merging this PR. The CI of this PR will still fail.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Jenkins pipeline configuration to support PR builds targeting branches other than main (such as release branches) by using the target branch of the PR (env.CHANGE_TARGET). The reviewer suggested wrapping the target branch variable in single quotes within the shell script in the template (Prepare.groovy.j2) to prevent potential shell expansion or word splitting issues, and then regenerating the Jenkinsfiles.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread ci/jenkins/templates/utils/Prepare.groovy.j2
@tqchen tqchen merged commit daf90cb into apache:v0.25.0 Jun 15, 2026
3 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants