Skip to content

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

Merged
tqchen merged 1 commit into
mainfrom
ruihanglai/ci-merge-target
Jun 10, 2026
Merged

[CI] Merge PR against its target branch instead of main#19712
tqchen merged 1 commit into
mainfrom
ruihanglai/ci-merge-target

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.

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.
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@tqchen tqchen merged commit 02280c1 into main Jun 10, 2026
16 checks passed
tqchen pushed a commit that referenced this pull request Jun 15, 2026
)

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)
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