Skip to content

Commit c6be875

Browse files
authored
[CI] Refactor main2main from full to incremental synchronization (vllm-project#12374)
### What this PR does / why we need it? Refactor main2main from full to incremental synchronization ### Does this PR introduce _any_ user-facing change? ### How was this patch tested? - vLLM version: v0.24.0 - vLLM main: vllm-project/vllm@85c09e9 Signed-off-by: wjunLu <wjunlu217@gmail.com>
1 parent 8ad564e commit c6be875

1 file changed

Lines changed: 21 additions & 6 deletions

File tree

.github/workflows/schedule_main2main.yaml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -271,13 +271,20 @@ jobs:
271271
BRANCH="main2main_auto_$(date +%Y-%m-%d_%H-%M)"
272272
git remote add upstream "https://github.com/${UPSTREAM_REPO}.git" || \
273273
git remote set-url upstream "https://github.com/${UPSTREAM_REPO}.git"
274-
# Prefer main2main_baseline ref on the fork - it carries the
275-
# cumulative successful adaptations from prior runs, enabling
276-
# incremental adaptation. Fall back to upstream/main if absent
277-
# (first run, ref deleted, or fork reset).
278-
if git fetch origin refs/heads/main2main_baseline:refs/remotes/origin/main2main_baseline 2>/dev/null; then
274+
# Attempt incremental: fetch main2main_baseline from the fork,
275+
# then rebase it onto the latest upstream/main. This carries
276+
# forward all prior adaptation commits and merges with any
277+
# external changes (e.g. PRs merged since the last run).
278+
if git fetch "https://github.com/${HEAD_FORK}.git" "refs/heads/main2main_baseline:refs/remotes/origin/main2main_baseline" 2>/dev/null; then
279+
git fetch upstream main
279280
git checkout -B "${BRANCH}" origin/main2main_baseline
280-
echo "::notice::incremental mode: starting from main2main_baseline"
281+
if git rebase upstream/main; then
282+
echo "::notice::incremental mode: rebased main2main_baseline onto upstream/main"
283+
else
284+
git rebase --abort
285+
git checkout -B "${BRANCH}" upstream/main
286+
echo "::warning::rebase conflicts between main2main_baseline and upstream/main, falling back to fresh mode"
287+
fi
281288
else
282289
git fetch upstream main
283290
git checkout -B "${BRANCH}" upstream/main
@@ -458,6 +465,7 @@ jobs:
458465
{
459466
echo "status=${FINAL_STATUS}"
460467
echo "commit_count=${COMMIT_COUNT}"
468+
echo "steps_completed=${STEPS_COMPLETED}"
461469
echo "manual_review_required=${MANUAL_REVIEW_REQUIRED}"
462470
echo "old_commit=${OLD_COMMIT}"
463471
echo "new_commit=${NEW_COMMIT}"
@@ -497,3 +505,10 @@ jobs:
497505
--repo "${UPSTREAM_REPO}" \
498506
--title "[main2main] main2main manual review required (${SHORT_NEW})" \
499507
--body-file /tmp/main2main-manual-review.md
508+
509+
- name: Chain next run
510+
if: steps.final-status.outputs.status == 'completed' && steps.final-status.outputs.steps_completed != '0'
511+
run: |
512+
echo "::notice::Chaining next main2main run..."
513+
gh workflow run Main2Main \
514+
--repo "${UPSTREAM_REPO}"

0 commit comments

Comments
 (0)