You are viewing a plain text version of this content. The canonical link for it is here.
Posted to discuss-archive@tvm.apache.org by "MasterJH5574 (via GitHub)" <gi...@apache.org> on 2026/06/15 03:48:30 UTC
[PR] [CI] Merge PR against its target branch instead of main (#19712) [tvm]
MasterJH5574 opened a new pull request, #19775:
URL: https://github.com/apache/tvm/pull/19775
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 02280c16545320f054ab67671177e474772d498d)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org
Re: [PR] [CI] Merge PR against its target branch instead of main (#19712) [tvm]
Posted by "MasterJH5574 (via GitHub)" <gi...@apache.org>.
MasterJH5574 commented on PR #19775:
URL: https://github.com/apache/tvm/pull/19775#issuecomment-4704332269
CI on branch v0.25.0 is fixed after merging this PR. The CI of this PR will still fail.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org
Re: [PR] [CI] Merge PR against its target branch instead of main (#19712) [tvm]
Posted by "gemini-code-assist[bot] (via GitHub)" <gi...@apache.org>.
gemini-code-assist[bot] commented on code in PR #19775:
URL: https://github.com/apache/tvm/pull/19775#discussion_r3410913760
##########
ci/jenkins/templates/utils/Prepare.groovy.j2:
##########
@@ -44,15 +47,16 @@ def update_upstream_revision(git_ref) {
}
}
-def merge_with_main() {
+def merge_with_target() {
+ def target = env.CHANGE_TARGET
sh (
- script: 'git fetch origin main',
- label: 'Fetch upstream',
+ script: "git fetch origin ${target}",
+ label: "Fetch target branch ${target}",
)
Review Comment:

To prevent potential shell expansion or word splitting issues if the target branch name contains special characters (such as spaces or other shell metacharacters), it is safer to wrap the target branch variable in single quotes within the shell script. Note that after applying this change to the template, the Jenkinsfiles should be regenerated.
```
def merge_with_target() {
def target = env.CHANGE_TARGET
sh (
script: "git fetch origin '${target}'",
label: "Fetch target branch ${target}",
)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org
Re: [PR] [CI] Merge PR against its target branch instead of main (#19712) [tvm]
Posted by "tqchen (via GitHub)" <gi...@apache.org>.
tqchen merged PR #19775:
URL: https://github.com/apache/tvm/pull/19775
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org