Skip to content

Commit efede4e

Browse files
committed
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 <sgaud@qti.qualcomm.com>
1 parent 867a0ec commit efede4e

1 file changed

Lines changed: 20 additions & 28 deletions

File tree

.github/actions/sync/action.yml

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ runs:
3636
git config --global user.name "github-actions"
3737
git config --global user.email "github-actions@github.com"
3838
39+
###Sync steps for kernel repository###
3940
- name: Sync with latest changes
4041
if: inputs.topic_repo == 'qualcomm-linux/kernel'
4142
shell: bash
@@ -44,50 +45,41 @@ runs:
4445
git fetch origin ${{ inputs.base_branch }}
4546
git merge origin/${{ inputs.base_branch }}
4647
47-
- name: Clone repositories
48-
if: inputs.topic_repo == 'qualcomm-linux/kernel-topics'
48+
- name: Fetch PR
49+
if: inputs.topic_repo == 'qualcomm-linux/kernel'
4950
shell: bash
5051
run: |
51-
git clone https://github.com/qualcomm-linux/kernel.git
52-
git clone https://github.com/qualcomm-linux/automerge.git
52+
git checkout ${{ inputs.base_branch }}
53+
git fetch https://github.com/qualcomm-linux/kernel.git pull/${{inputs.pr_number}}/head:pr-${{inputs.pr_number}}
54+
git merge pr-${{ inputs.pr_number }} --no-commit || echo "Merge already applied or fast-forwarded"
55+
if ! git diff --cached --quiet; then
56+
git commit -m "Merged PR #${{ inputs.pr_number }}"
57+
else
58+
echo "Nothing to commit. PR may already be merged or fast-forwarded."
59+
fi
5360
54-
- name: Create merge configuration
61+
###Sync steps for kernel-topics repository###
62+
- name: Clone repositories
5563
if: inputs.topic_repo == 'qualcomm-linux/kernel-topics'
5664
shell: bash
5765
run: |
58-
TOPIC_BRANCH=${{ inputs.base_branch }}
59-
TOPIC_REPO=${{ inputs.topic_repo }}
60-
cat <<EOF > merge.conf
61-
baseline https://github.com/qualcomm-linux/kernel.git qcom-next
62-
topic https://github.com/$TOPIC_REPO.git $TOPIC_BRANCH
63-
EOF
64-
echo "File 'merge.conf' created successfully."
66+
git clone https://github.com/qualcomm-linux/kernel.git
67+
git clone https://github.com/qualcomm-linux/automerge.git
68+
git clone https://github.com/qualcomm-linux/kernel-config.git
6569
66-
- name: Run auto merge
70+
- name: Run automerge
6771
if: inputs.topic_repo == 'qualcomm-linux/kernel-topics'
6872
shell: bash
6973
run: |
74+
sed -i 's/kernel.git/kernel-topics.git/g' kernel-config/qcom-next.conf
75+
sed -i 's/qcom-next-staging/baseline/g' kernel-config/qcom-next.conf
7076
cd kernel
71-
../automerge/ci-merge -f ../merge.conf -t head -n
77+
../automerge/ci-merge -f ../kernel-config/qcom-next.conf -t head -i qcom-next -c https://github.com/sgaud-quic/cache -n
7278
7379
- name: Fetch PR
7480
if: inputs.topic_repo == 'qualcomm-linux/kernel-topics'
7581
shell: bash
7682
run: |
77-
cd kernel
7883
git fetch https://github.com/${{inputs.topic_repo}}.git pull/${{inputs.pr_number}}/head:pr-${{inputs.pr_number}}
7984
git merge pr-${{inputs.pr_number}} --no-commit
8085
git commit -m "Merged PR ${{inputs.pr_number}}"
81-
82-
- name: Fetch PR
83-
if: inputs.topic_repo == 'qualcomm-linux/kernel'
84-
shell: bash
85-
run: |
86-
git checkout ${{ inputs.base_branch }}
87-
git fetch https://github.com/qualcomm-linux/kernel.git pull/${{inputs.pr_number}}/head:pr-${{inputs.pr_number}}
88-
git merge pr-${{ inputs.pr_number }} --no-commit || echo "Merge already applied or fast-forwarded"
89-
if ! git diff --cached --quiet; then
90-
git commit -m "Merged PR #${{ inputs.pr_number }}"
91-
else
92-
echo "Nothing to commit. PR may already be merged or fast-forwarded."
93-
fi

0 commit comments

Comments
 (0)