From 8979437ac92ba564d64c854c5b2bebf99818484d Mon Sep 17 00:00:00 2001 From: bunnam988 Date: Thu, 2 Jul 2026 00:47:04 +0530 Subject: [PATCH 1/8] [RDK-TEST-999] Add gatekeeper caller workflow for verification --- .github/workflows/gatekeeper.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/workflows/gatekeeper.yml diff --git a/.github/workflows/gatekeeper.yml b/.github/workflows/gatekeeper.yml new file mode 100644 index 0000000..516bc76 --- /dev/null +++ b/.github/workflows/gatekeeper.yml @@ -0,0 +1,14 @@ +name: Topic Gatekeeper + +on: + pull_request: + types: [opened, synchronize, reopened] + branches: + - develop + pull_request_review: + types: [submitted] + +jobs: + run-shared-gatekeeper: + # Temporarily pointing to test branch for verification + uses: rdkcentral/build_tools_workflows/.github/workflows/gatekeeper.yml@feature/gatekeeper-test From 4d40646ca871d238f35f4356b2ffa56ecbcb4ada Mon Sep 17 00:00:00 2001 From: bunnam988 Date: Thu, 2 Jul 2026 01:47:10 +0530 Subject: [PATCH 2/8] Add automated cherry-pick engine workflow --- .github/workflows/auto-backport.yml | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/auto-backport.yml diff --git a/.github/workflows/auto-backport.yml b/.github/workflows/auto-backport.yml new file mode 100644 index 0000000..3eb9804 --- /dev/null +++ b/.github/workflows/auto-backport.yml @@ -0,0 +1,31 @@ +name: Automated Cherry-Pick Engine + +on: + pull_request: + types: [labeled, closed] # Triggers when a PR is closed/merged or labeled + +jobs: + backport: + # Only runs if the PR was successfully merged AND contains a target cherry-pick label + if: github.event.pull_request.merged == true && contains(toJSON(github.event.pull_request.labels.*.name), 'cherry-pick to ') + runs-on: ubuntu-latest + steps: + - name: Extract Target Branch Name + id: parse_label + run: | + # Finds the label starting with "cherry-pick to " and extracts the branch destination + RAW_LABEL=$(jq -r '.pull_request.labels[].name' "$GITHUB_EVENT_PATH" | grep "cherry-pick to " | head -n 1) + TARGET_BRANCH=${RAW_LABEL#"cherry-pick to "} + echo "target_branch=$TARGET_BRANCH" >> $GITHUB_OUTPUT + + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetches full history so git can find the merge commits + + - name: Execute Automated Cherry-Pick + uses: korthout/backport-action@v3 + with: + target_branches: ${{ steps.parse_label.outputs.target_branch }} + pr_title: '[${target_branch}] ${pull_request.title}' + auth_token: ${{ secrets.GITHUB_TOKEN }} From 05d2c97956e349c31a9d1df1b74195477c0e0fde Mon Sep 17 00:00:00 2001 From: bunnam988 Date: Thu, 2 Jul 2026 02:01:03 +0530 Subject: [PATCH 3/8] Add workflow_dispatch for manual testing of cherry-pick engine --- .github/workflows/auto-backport.yml | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/.github/workflows/auto-backport.yml b/.github/workflows/auto-backport.yml index 3eb9804..b57bc89 100644 --- a/.github/workflows/auto-backport.yml +++ b/.github/workflows/auto-backport.yml @@ -3,20 +3,35 @@ name: Automated Cherry-Pick Engine on: pull_request: types: [labeled, closed] # Triggers when a PR is closed/merged or labeled + workflow_dispatch: + inputs: + pr_number: + description: 'PR number to cherry-pick' + required: true + target_branch: + description: 'Target branch (e.g. release/26Q3)' + required: true jobs: backport: - # Only runs if the PR was successfully merged AND contains a target cherry-pick label - if: github.event.pull_request.merged == true && contains(toJSON(github.event.pull_request.labels.*.name), 'cherry-pick to ') + # Runs on label event (merged + cherry-pick label) OR manual dispatch + if: > + github.event_name == 'workflow_dispatch' || + (github.event.pull_request.merged == true && contains(toJSON(github.event.pull_request.labels.*.name), 'cherry-pick to ')) runs-on: ubuntu-latest steps: - name: Extract Target Branch Name id: parse_label run: | - # Finds the label starting with "cherry-pick to " and extracts the branch destination - RAW_LABEL=$(jq -r '.pull_request.labels[].name' "$GITHUB_EVENT_PATH" | grep "cherry-pick to " | head -n 1) - TARGET_BRANCH=${RAW_LABEL#"cherry-pick to "} - echo "target_branch=$TARGET_BRANCH" >> $GITHUB_OUTPUT + if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then + echo "target_branch=${{ github.event.inputs.target_branch }}" >> $GITHUB_OUTPUT + echo "pr_number=${{ github.event.inputs.pr_number }}" >> $GITHUB_OUTPUT + else + RAW_LABEL=$(jq -r '.pull_request.labels[].name' "$GITHUB_EVENT_PATH" | grep "cherry-pick to " | head -n 1) + TARGET_BRANCH=${RAW_LABEL#"cherry-pick to "} + echo "target_branch=$TARGET_BRANCH" >> $GITHUB_OUTPUT + echo "pr_number=${{ github.event.pull_request.number }}" >> $GITHUB_OUTPUT + fi - name: Checkout Code uses: actions/checkout@v4 @@ -27,5 +42,6 @@ jobs: uses: korthout/backport-action@v3 with: target_branches: ${{ steps.parse_label.outputs.target_branch }} + pull_request_number: ${{ steps.parse_label.outputs.pr_number }} pr_title: '[${target_branch}] ${pull_request.title}' auth_token: ${{ secrets.GITHUB_TOKEN }} From 13f2a31aa78d4efe2d5b5ffcb3ab2bd336af1604 Mon Sep 17 00:00:00 2001 From: bunnam988 <107185904+bunnam988@users.noreply.github.com> Date: Thu, 2 Jul 2026 02:06:00 +0530 Subject: [PATCH 4/8] [RDKB-TEST-001] Test commit for cherry-pick verification (#55) --- cherry_pick_test.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 cherry_pick_test.txt diff --git a/cherry_pick_test.txt b/cherry_pick_test.txt new file mode 100644 index 0000000..ad11028 --- /dev/null +++ b/cherry_pick_test.txt @@ -0,0 +1 @@ +# Cherry-pick test From 96cb9fca9719a5b4619ab1fad3c076ca77d31f9e Mon Sep 17 00:00:00 2001 From: bunnam988 <107185904+bunnam988@users.noreply.github.com> Date: Thu, 2 Jul 2026 12:42:24 +0530 Subject: [PATCH 5/8] [RDKB-TEST-002] Second test for cherry-pick engine (#57) --- cherry_pick_test_2.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 cherry_pick_test_2.txt diff --git a/cherry_pick_test_2.txt b/cherry_pick_test_2.txt new file mode 100644 index 0000000..b1891de --- /dev/null +++ b/cherry_pick_test_2.txt @@ -0,0 +1 @@ +# Cherry-pick test 2 From 90b4889dc07f19372edfe710165456a6c9083980 Mon Sep 17 00:00:00 2001 From: bunnam988 Date: Fri, 3 Jul 2026 13:47:30 +0530 Subject: [PATCH 6/8] Refactor: use shared cherry-pick engine from build_tools_workflows --- .github/workflows/auto-backport.yml | 46 ++++------------------------- 1 file changed, 6 insertions(+), 40 deletions(-) diff --git a/.github/workflows/auto-backport.yml b/.github/workflows/auto-backport.yml index b57bc89..c925faf 100644 --- a/.github/workflows/auto-backport.yml +++ b/.github/workflows/auto-backport.yml @@ -3,45 +3,11 @@ name: Automated Cherry-Pick Engine on: pull_request: types: [labeled, closed] # Triggers when a PR is closed/merged or labeled - workflow_dispatch: - inputs: - pr_number: - description: 'PR number to cherry-pick' - required: true - target_branch: - description: 'Target branch (e.g. release/26Q3)' - required: true jobs: - backport: - # Runs on label event (merged + cherry-pick label) OR manual dispatch - if: > - github.event_name == 'workflow_dispatch' || - (github.event.pull_request.merged == true && contains(toJSON(github.event.pull_request.labels.*.name), 'cherry-pick to ')) - runs-on: ubuntu-latest - steps: - - name: Extract Target Branch Name - id: parse_label - run: | - if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then - echo "target_branch=${{ github.event.inputs.target_branch }}" >> $GITHUB_OUTPUT - echo "pr_number=${{ github.event.inputs.pr_number }}" >> $GITHUB_OUTPUT - else - RAW_LABEL=$(jq -r '.pull_request.labels[].name' "$GITHUB_EVENT_PATH" | grep "cherry-pick to " | head -n 1) - TARGET_BRANCH=${RAW_LABEL#"cherry-pick to "} - echo "target_branch=$TARGET_BRANCH" >> $GITHUB_OUTPUT - echo "pr_number=${{ github.event.pull_request.number }}" >> $GITHUB_OUTPUT - fi - - - name: Checkout Code - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Fetches full history so git can find the merge commits - - - name: Execute Automated Cherry-Pick - uses: korthout/backport-action@v3 - with: - target_branches: ${{ steps.parse_label.outputs.target_branch }} - pull_request_number: ${{ steps.parse_label.outputs.pr_number }} - pr_title: '[${target_branch}] ${pull_request.title}' - auth_token: ${{ secrets.GITHUB_TOKEN }} + cherry-pick: + if: github.event.pull_request.merged == true && contains(toJSON(github.event.pull_request.labels.*.name), 'cherry-pick to ') + uses: rdkcentral/build_tools_workflows/.github/workflows/cherry-pick.yml@feature/gatekeeper-test + with: + raw_labels: ${{ toJSON(github.event.pull_request.labels) }} + secrets: inherit From 4fad88af3cf0ab57728f7df4c9fd2e321a789b7a Mon Sep 17 00:00:00 2001 From: bunnam988 Date: Fri, 3 Jul 2026 13:52:54 +0530 Subject: [PATCH 7/8] Pass CROSS_REPO_TOKEN for chain-reaction cherry-pick propagation --- .github/workflows/auto-backport.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/auto-backport.yml b/.github/workflows/auto-backport.yml index c925faf..cfcae6b 100644 --- a/.github/workflows/auto-backport.yml +++ b/.github/workflows/auto-backport.yml @@ -10,4 +10,5 @@ jobs: uses: rdkcentral/build_tools_workflows/.github/workflows/cherry-pick.yml@feature/gatekeeper-test with: raw_labels: ${{ toJSON(github.event.pull_request.labels) }} - secrets: inherit + secrets: + CROSS_REPO_TOKEN: ${{ secrets.CROSS_REPO_TOKEN }} From 22cd8b4fe7a8af72e59bf90dc9ae7858616943c8 Mon Sep 17 00:00:00 2001 From: bunnam988 Date: Fri, 3 Jul 2026 14:01:21 +0530 Subject: [PATCH 8/8] Add release and support branches to gatekeeper trigger --- .github/workflows/gatekeeper.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/gatekeeper.yml b/.github/workflows/gatekeeper.yml index 516bc76..2b9ac1a 100644 --- a/.github/workflows/gatekeeper.yml +++ b/.github/workflows/gatekeeper.yml @@ -5,6 +5,8 @@ on: types: [opened, synchronize, reopened] branches: - develop + - 'release/**' + - 'support/**' pull_request_review: types: [submitted]