From 3dbeefbdf9c50c2ad55e8e39ebfe3b7eb983e93f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20H=C3=B6ppner?= <jonas.hoeppner@garz-fricke.com>
Date: Tue, 29 Mar 2022 18:15:23 +0200
Subject: [PATCH] CI: merge_gitlab_ci: Remove deletion extra deletion of
 integration branch.

---
 common.py              |  2 +-
 merge_gitlab_ci.py     | 14 --------------
 merge_into_manifest.py |  1 +
 3 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/common.py b/common.py
index 06325119..f7e2b764 100755
--- a/common.py
+++ b/common.py
@@ -23,7 +23,7 @@ def integration_branch_name(project_name, branch_name):
 
 
 def is_gitlab_ci_integration_branch(branch_name):
-    gitlab_ci_integration_branch = "integrate/.gitlab_ci"
+    gitlab_ci_integration_branch = "integrate/gitlab_ci"
     return branch_name.startswith(gitlab_ci_integration_branch)
 
 
diff --git a/merge_gitlab_ci.py b/merge_gitlab_ci.py
index dfabc841..217419db 100755
--- a/merge_gitlab_ci.py
+++ b/merge_gitlab_ci.py
@@ -156,11 +156,6 @@ def main():
             # deploy_gitlab_ci again to create a new integration
             # commit or make sure the change is already integrated.
 
-        # Store for later usage:
-        if p == args.project:
-            manifest_project = project
-            manifest_integration_mr = mr
-
         print("Merge {}!{}: {}".format(project.name, mr.iid, mr.title))
         # Wait until GitLab has checked merge status
         common.wait_until_merge_status_is_set(project, mr)
@@ -194,15 +189,6 @@ def main():
                 print("     {}".format(p2))
             sys.exit()
 
-    # Delete args.project (manifests) integration branch
-    # (skipped the deletion during the merge request merge before)
-    integration_branch = manifest_project.branches.get(
-        manifest_integration_mr.source_branch
-    )
-    manifest_project.branches.delete(
-        integration_branch.get_id(), retry_transient_errors=True
-    )
-
     print("Successfully merged")
 
     exit()
diff --git a/merge_into_manifest.py b/merge_into_manifest.py
index e3c6c4fc..93e7714d 100755
--- a/merge_into_manifest.py
+++ b/merge_into_manifest.py
@@ -42,6 +42,7 @@ def merge_into_manifest(
 
     # Get original branch for commit
     original_branch = source_mr.source_branch
+    logging.debug("Original branch %s", original_branch)
 
     if common.is_gitlab_ci_integration_branch(original_branch):
         print(
-- 
GitLab