From efede4e8bd2843eacdc7aaae88907f3c0038dcb9 Mon Sep 17 00:00:00 2001 From: Salendarsingh Gaud Date: Thu, 25 Dec 2025 18:19:42 +0530 Subject: [PATCH] ci: Update sync strategy for kernel-topic branches Sync steps followed for kernel-topic branches: 1. Sync qcom-next 2. Merge topic branch on top of it 3. Merge PR This fails when topic branches are rebased on latest kernel version e.g. 6.19-rc2 and qcom-next is on older kernel e.g 6.18 Merge of topic branch to qcom-next fails. Update the sync strategy to use automerge as below : 1. Sync kernel repository 2. Run automerge taking baseline branch of kernel-topics as baseline 3. Merge PR under test on top of it This will ensure below 1. All changes are part of the merged branch. 2. Any dependent PR's not yet part of qcom-next will be covered here. Signed-off-by: Salendarsingh Gaud --- .github/actions/sync/action.yml | 48 ++++++++++++++------------------- 1 file changed, 20 insertions(+), 28 deletions(-) diff --git a/.github/actions/sync/action.yml b/.github/actions/sync/action.yml index df2af5b..da5d8b4 100644 --- a/.github/actions/sync/action.yml +++ b/.github/actions/sync/action.yml @@ -36,6 +36,7 @@ runs: git config --global user.name "github-actions" git config --global user.email "github-actions@github.com" + ###Sync steps for kernel repository### - name: Sync with latest changes if: inputs.topic_repo == 'qualcomm-linux/kernel' shell: bash @@ -44,50 +45,41 @@ runs: git fetch origin ${{ inputs.base_branch }} git merge origin/${{ inputs.base_branch }} - - name: Clone repositories - if: inputs.topic_repo == 'qualcomm-linux/kernel-topics' + - name: Fetch PR + if: inputs.topic_repo == 'qualcomm-linux/kernel' shell: bash run: | - git clone https://github.com/qualcomm-linux/kernel.git - git clone https://github.com/qualcomm-linux/automerge.git + git checkout ${{ inputs.base_branch }} + git fetch https://github.com/qualcomm-linux/kernel.git pull/${{inputs.pr_number}}/head:pr-${{inputs.pr_number}} + git merge pr-${{ inputs.pr_number }} --no-commit || echo "Merge already applied or fast-forwarded" + if ! git diff --cached --quiet; then + git commit -m "Merged PR #${{ inputs.pr_number }}" + else + echo "Nothing to commit. PR may already be merged or fast-forwarded." + fi - - name: Create merge configuration + ###Sync steps for kernel-topics repository### + - name: Clone repositories if: inputs.topic_repo == 'qualcomm-linux/kernel-topics' shell: bash run: | - TOPIC_BRANCH=${{ inputs.base_branch }} - TOPIC_REPO=${{ inputs.topic_repo }} - cat < merge.conf - baseline https://github.com/qualcomm-linux/kernel.git qcom-next - topic https://github.com/$TOPIC_REPO.git $TOPIC_BRANCH - EOF - echo "File 'merge.conf' created successfully." + git clone https://github.com/qualcomm-linux/kernel.git + git clone https://github.com/qualcomm-linux/automerge.git + git clone https://github.com/qualcomm-linux/kernel-config.git - - name: Run auto merge + - name: Run automerge if: inputs.topic_repo == 'qualcomm-linux/kernel-topics' shell: bash run: | + sed -i 's/kernel.git/kernel-topics.git/g' kernel-config/qcom-next.conf + sed -i 's/qcom-next-staging/baseline/g' kernel-config/qcom-next.conf cd kernel - ../automerge/ci-merge -f ../merge.conf -t head -n + ../automerge/ci-merge -f ../kernel-config/qcom-next.conf -t head -i qcom-next -c https://github.com/sgaud-quic/cache -n - name: Fetch PR if: inputs.topic_repo == 'qualcomm-linux/kernel-topics' shell: bash run: | - cd kernel git fetch https://github.com/${{inputs.topic_repo}}.git pull/${{inputs.pr_number}}/head:pr-${{inputs.pr_number}} git merge pr-${{inputs.pr_number}} --no-commit git commit -m "Merged PR ${{inputs.pr_number}}" - - - name: Fetch PR - if: inputs.topic_repo == 'qualcomm-linux/kernel' - shell: bash - run: | - git checkout ${{ inputs.base_branch }} - git fetch https://github.com/qualcomm-linux/kernel.git pull/${{inputs.pr_number}}/head:pr-${{inputs.pr_number}} - git merge pr-${{ inputs.pr_number }} --no-commit || echo "Merge already applied or fast-forwarded" - if ! git diff --cached --quiet; then - git commit -m "Merged PR #${{ inputs.pr_number }}" - else - echo "Nothing to commit. PR may already be merged or fast-forwarded." - fi