From 575d9aecc29f9ea198e55d42bb18c98c9b0265c9 Mon Sep 17 00:00:00 2001 From: Simon Chung Date: Wed, 29 Apr 2026 09:54:54 +0100 Subject: [PATCH 1/9] CMF-14020 Add cleanup in auto_pr_generation_manifest script auto_pr_generation_manifest script does not clean up feature branch if there is no manifest update, this could lead to leaving branches in repos that have no purpose. Add a cleanup action to delete these unused branches. --- .../auto_pr_generation_manifest.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/build_health_check_workflow_scripts/auto_pr_generation_manifest.py b/build_health_check_workflow_scripts/auto_pr_generation_manifest.py index c384eba..573084d 100644 --- a/build_health_check_workflow_scripts/auto_pr_generation_manifest.py +++ b/build_health_check_workflow_scripts/auto_pr_generation_manifest.py @@ -249,6 +249,17 @@ def create_or_checkout_branch(repo, branch_name, base_branch): print("Error checking out branch: {}".format(str(e))) sys.exit(1) +# Delete the unused branch in the remote manifest repository +def delete_branch(repo, branch_name): + print("Delete unsed branch: {}".format(branch_name)) + print(':{}'.format(branch_name)) + try: + remote = repo.remote(name='origin') +# remote.push(refspec=(':delete_me')) + except GitCommandError as e: + print("Error delete branch: {}".format(str(e))) + sys.exit(1) + def main(): github_token = os.getenv('GITHUB_TOKEN') manifest_repo_path = os.getenv('MANIFEST_REPO_PATH') @@ -290,8 +301,12 @@ def main(): changes_made = update_xml_files(manifest_repo_path, updates) if changes_made: - commit_and_push(manifest_repo_path, "Update manifest for {}".format(','.join(updates.keys()))) - create_pull_request(github_token, manifest_repo_name, feature_branch, base_branch, manifest_pr_title, manifest_pr_description) + commit_and_push(manifest_repo_path, "Update manifest for {}".format(','.join(updates.keys()))) + create_pull_request(github_token, manifest_repo_name, feature_branch, base_branch, manifest_pr_title, manifest_pr_description) + else: + # delete the unused feature branch + delete_branch(repo, feature_branch) + if __name__ == '__main__': main() From 48a8dadc060f35e2e13c8567e31ab74b09b2a4f7 Mon Sep 17 00:00:00 2001 From: Simon Chung Date: Wed, 29 Apr 2026 09:58:04 +0100 Subject: [PATCH 2/9] Temporary disable label creation in PR --- .../auto_pr_generation_manifest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_health_check_workflow_scripts/auto_pr_generation_manifest.py b/build_health_check_workflow_scripts/auto_pr_generation_manifest.py index 573084d..c4647d0 100644 --- a/build_health_check_workflow_scripts/auto_pr_generation_manifest.py +++ b/build_health_check_workflow_scripts/auto_pr_generation_manifest.py @@ -204,7 +204,7 @@ def create_pull_request(github_token, repo_name, head_branch, base_branch, title try: pr = repo.create_pull(title=title, body=description, base=base_branch, head=head_branch) - pr.add_to_labels('bhc-auto-merge') +# pr.add_to_labels('bhc-auto-merge') print("PR Created and labeled:", pr.html_url) return pr except github.GithubException as e: From b3956e61483fa0dbf053c109e53be46abca889e3 Mon Sep 17 00:00:00 2001 From: Simon Chung Date: Wed, 29 Apr 2026 10:17:29 +0100 Subject: [PATCH 3/9] Temporary switch build_tools_workflows to feature/CMF-14020 branch --- .github/workflows/auto_pr_creation_rpi_manifests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto_pr_creation_rpi_manifests.yml b/.github/workflows/auto_pr_creation_rpi_manifests.yml index 4580ef3..bfc9d06 100644 --- a/.github/workflows/auto_pr_creation_rpi_manifests.yml +++ b/.github/workflows/auto_pr_creation_rpi_manifests.yml @@ -16,7 +16,7 @@ jobs: with: repository: rdkcentral/build_tools_workflows path: 'tools' - ref: develop + ref: feature/CMF-14020 token: ${{ secrets.RDKCM_RDKE }} - name: Checkout vendor layer Manifest Repository From 792c128004ae8806295698229efa5e324e3e5571 Mon Sep 17 00:00:00 2001 From: Simon Chung Date: Wed, 29 Apr 2026 11:44:55 +0100 Subject: [PATCH 4/9] Temporary set manifests BASE_BRANCH to develop --- .github/workflows/auto_pr_creation_rpi_manifests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/auto_pr_creation_rpi_manifests.yml b/.github/workflows/auto_pr_creation_rpi_manifests.yml index bfc9d06..b49bc2f 100644 --- a/.github/workflows/auto_pr_creation_rpi_manifests.yml +++ b/.github/workflows/auto_pr_creation_rpi_manifests.yml @@ -84,7 +84,7 @@ jobs: MANIFEST_REPO_PATH: ${{ github.workspace }}/vendor_manifest_repo MANIFEST_REPO_NAME: 'rdkcentral/vendor-manifest-raspberrypi' PR_NUMBER: ${{ github.event.pull_request.number }} - BASE_BRANCH: ${{ github.event.pull_request.base.ref }} + BASE_BRANCH: develop run: | cd vendor_manifest_repo python3 ../tools/build_health_check_workflow_scripts/auto_pr_generation_manifest.py @@ -97,7 +97,7 @@ jobs: MANIFEST_REPO_PATH: ${{ github.workspace }}/middleware_manifest_repo MANIFEST_REPO_NAME: 'rdkcentral/middleware-manifest-rdke' PR_NUMBER: ${{ github.event.pull_request.number }} - BASE_BRANCH: ${{ github.event.pull_request.base.ref }} + BASE_BRANCH: develop run: | cd middleware_manifest_repo python3 ../tools/build_health_check_workflow_scripts/auto_pr_generation_manifest.py @@ -110,7 +110,7 @@ jobs: MANIFEST_REPO_PATH: ${{ github.workspace }}/image_assembler_manifest_repo MANIFEST_REPO_NAME: 'rdkcentral/image-assembler-manifest-rdke' PR_NUMBER: ${{ github.event.pull_request.number }} - BASE_BRANCH: ${{ github.event.pull_request.base.ref }} + BASE_BRANCH: develop run: | cd image_assembler_manifest_repo python3 ../tools/build_health_check_workflow_scripts/auto_pr_generation_manifest.py From 05c1a731254923341688698a7951d8a59362f2e9 Mon Sep 17 00:00:00 2001 From: Simon Chung Date: Wed, 29 Apr 2026 11:56:58 +0100 Subject: [PATCH 5/9] Enable remote branch delete --- .../auto_pr_generation_manifest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build_health_check_workflow_scripts/auto_pr_generation_manifest.py b/build_health_check_workflow_scripts/auto_pr_generation_manifest.py index c4647d0..0153930 100644 --- a/build_health_check_workflow_scripts/auto_pr_generation_manifest.py +++ b/build_health_check_workflow_scripts/auto_pr_generation_manifest.py @@ -251,11 +251,11 @@ def create_or_checkout_branch(repo, branch_name, base_branch): # Delete the unused branch in the remote manifest repository def delete_branch(repo, branch_name): - print("Delete unsed branch: {}".format(branch_name)) + print("Delete unused branch: {}".format(branch_name)) print(':{}'.format(branch_name)) try: remote = repo.remote(name='origin') -# remote.push(refspec=(':delete_me')) + remote.push(refspec=(':delete_me')) except GitCommandError as e: print("Error delete branch: {}".format(str(e))) sys.exit(1) From a99ae48d2148b437f027ebaef4eb5ec677907d67 Mon Sep 17 00:00:00 2001 From: Simon Chung Date: Wed, 29 Apr 2026 12:17:21 +0100 Subject: [PATCH 6/9] Enable remote branch delete --- .../auto_pr_generation_manifest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_health_check_workflow_scripts/auto_pr_generation_manifest.py b/build_health_check_workflow_scripts/auto_pr_generation_manifest.py index 0153930..fb551b4 100644 --- a/build_health_check_workflow_scripts/auto_pr_generation_manifest.py +++ b/build_health_check_workflow_scripts/auto_pr_generation_manifest.py @@ -255,7 +255,7 @@ def delete_branch(repo, branch_name): print(':{}'.format(branch_name)) try: remote = repo.remote(name='origin') - remote.push(refspec=(':delete_me')) + remote.push(refspec=(':{}'.format(branch_name))) except GitCommandError as e: print("Error delete branch: {}".format(str(e))) sys.exit(1) From c9ec5da71be7054f4a27f36e9930fbb97d594d69 Mon Sep 17 00:00:00 2001 From: Simon Chung Date: Wed, 29 Apr 2026 13:27:55 +0100 Subject: [PATCH 7/9] Revert "Temporary set manifests BASE_BRANCH to develop" This reverts commit 792c128004ae8806295698229efa5e324e3e5571. --- .github/workflows/auto_pr_creation_rpi_manifests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/auto_pr_creation_rpi_manifests.yml b/.github/workflows/auto_pr_creation_rpi_manifests.yml index b49bc2f..bfc9d06 100644 --- a/.github/workflows/auto_pr_creation_rpi_manifests.yml +++ b/.github/workflows/auto_pr_creation_rpi_manifests.yml @@ -84,7 +84,7 @@ jobs: MANIFEST_REPO_PATH: ${{ github.workspace }}/vendor_manifest_repo MANIFEST_REPO_NAME: 'rdkcentral/vendor-manifest-raspberrypi' PR_NUMBER: ${{ github.event.pull_request.number }} - BASE_BRANCH: develop + BASE_BRANCH: ${{ github.event.pull_request.base.ref }} run: | cd vendor_manifest_repo python3 ../tools/build_health_check_workflow_scripts/auto_pr_generation_manifest.py @@ -97,7 +97,7 @@ jobs: MANIFEST_REPO_PATH: ${{ github.workspace }}/middleware_manifest_repo MANIFEST_REPO_NAME: 'rdkcentral/middleware-manifest-rdke' PR_NUMBER: ${{ github.event.pull_request.number }} - BASE_BRANCH: develop + BASE_BRANCH: ${{ github.event.pull_request.base.ref }} run: | cd middleware_manifest_repo python3 ../tools/build_health_check_workflow_scripts/auto_pr_generation_manifest.py @@ -110,7 +110,7 @@ jobs: MANIFEST_REPO_PATH: ${{ github.workspace }}/image_assembler_manifest_repo MANIFEST_REPO_NAME: 'rdkcentral/image-assembler-manifest-rdke' PR_NUMBER: ${{ github.event.pull_request.number }} - BASE_BRANCH: develop + BASE_BRANCH: ${{ github.event.pull_request.base.ref }} run: | cd image_assembler_manifest_repo python3 ../tools/build_health_check_workflow_scripts/auto_pr_generation_manifest.py From 6312273037a40a60c93a2ff814fb0877c5fc3b56 Mon Sep 17 00:00:00 2001 From: Simon Chung Date: Wed, 29 Apr 2026 13:28:13 +0100 Subject: [PATCH 8/9] Revert "Temporary switch build_tools_workflows to feature/CMF-14020 branch" This reverts commit b3956e61483fa0dbf053c109e53be46abca889e3. --- .github/workflows/auto_pr_creation_rpi_manifests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto_pr_creation_rpi_manifests.yml b/.github/workflows/auto_pr_creation_rpi_manifests.yml index bfc9d06..4580ef3 100644 --- a/.github/workflows/auto_pr_creation_rpi_manifests.yml +++ b/.github/workflows/auto_pr_creation_rpi_manifests.yml @@ -16,7 +16,7 @@ jobs: with: repository: rdkcentral/build_tools_workflows path: 'tools' - ref: feature/CMF-14020 + ref: develop token: ${{ secrets.RDKCM_RDKE }} - name: Checkout vendor layer Manifest Repository From 7d8f15c76fa9ec42aa8fbfed0465b446d99b5259 Mon Sep 17 00:00:00 2001 From: Simon Chung Date: Wed, 29 Apr 2026 13:28:39 +0100 Subject: [PATCH 9/9] Revert "Temporary disable label creation in PR" This reverts commit 48a8dadc060f35e2e13c8567e31ab74b09b2a4f7. --- .../auto_pr_generation_manifest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_health_check_workflow_scripts/auto_pr_generation_manifest.py b/build_health_check_workflow_scripts/auto_pr_generation_manifest.py index fb551b4..b8d34d5 100644 --- a/build_health_check_workflow_scripts/auto_pr_generation_manifest.py +++ b/build_health_check_workflow_scripts/auto_pr_generation_manifest.py @@ -204,7 +204,7 @@ def create_pull_request(github_token, repo_name, head_branch, base_branch, title try: pr = repo.create_pull(title=title, body=description, base=base_branch, head=head_branch) -# pr.add_to_labels('bhc-auto-merge') + pr.add_to_labels('bhc-auto-merge') print("PR Created and labeled:", pr.html_url) return pr except github.GithubException as e: