Skip to content
Snippets Groups Projects
Commit 139ddf9b authored by Lorenzo Pagliai's avatar Lorenzo Pagliai
Browse files

[FIX][INTEGRATION] Bug fix in merging integration MR

* The integration branch name when a new MR is created actually contains
  the repository name, while the script that is performing the merging
of the branch was using the recipe name. Aligning the behaviour of the
two scripts.
* Handle GitLab exception when no MR pipeline is created.
* Insert Mediatek handling in pipeline retriggering function.
parent 5682aa05
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,8 @@ def retrigger_bsp_pipelines( ...@@ -27,6 +27,8 @@ def retrigger_bsp_pipelines(
bsp_group = group_name + "/nxp" bsp_group = group_name + "/nxp"
elif "rockchip" in ci_project: elif "rockchip" in ci_project:
bsp_group = group_name + "/rockchip" bsp_group = group_name + "/rockchip"
elif "mediatek" in ci_project:
bsp_group = group_name + "/mediatek"
else: else:
print("No valid BSP vendor found, retriggering all BSP projects") print("No valid BSP vendor found, retriggering all BSP projects")
bsp_group = group_name bsp_group = group_name
...@@ -49,12 +51,15 @@ def retrigger_bsp_pipelines( ...@@ -49,12 +51,15 @@ def retrigger_bsp_pipelines(
# Retrigger pipeline execution for all open MRs # Retrigger pipeline execution for all open MRs
for mr in open_mrs: for mr in open_mrs:
print(f"Running pipeline for MR: {mr.title}") print(f"Running pipeline for MR: {mr.title}")
pipeline = mr.pipelines.create() try:
if pipeline: pipeline = mr.pipelines.create()
print(f"Pipeline created with ID: {pipeline.id}") print(f"Pipeline created with ID: {pipeline.id}")
else: except GitlabGetError as e:
print("Pipeline creation failed.") sys.exit(
sys.exit(1) "ERROR: could not trigger merge request pipeline for MR '%s': %s"
% (mr.title, e)
)
def get_source_integration_requests( def get_source_integration_requests(
project, state=None, target_branch=None, commit=None project, state=None, target_branch=None, commit=None
...@@ -268,8 +273,8 @@ def main(): ...@@ -268,8 +273,8 @@ def main():
except GitlabGetError as e: except GitlabGetError as e:
sys.exit("Could not get integration branch name for latest project MR: %s" % e) sys.exit("Could not get integration branch name for latest project MR: %s" % e)
integration_branch_name = args.recipe_name + "/" + integration_branch_name integration_branch_name = args.project.rsplit('/', 1)[-1] + "/" + integration_branch_name
try: try:
merge_request = get_merge_requests( merge_request = get_merge_requests(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment