From d944c1dcc3e28db62d3a8ff34d6276bbb3b3536e Mon Sep 17 00:00:00 2001 From: Tim Jaacks <tim.jaacks@garz-fricke.com> Date: Tue, 22 Dec 2020 15:14:48 +0100 Subject: [PATCH] merge_into_manifest: remove canceling of pipelines The canceling was required when a reintegration was necessary before merging. The instant merge afterwards deleted the integration branch, so the pipeline on the branch would fail, because repo cannot checkout the code anymore. With minimal-manifest!126 we started checking out code using refs/pipelines/<id> instead of explicit branch/tag names. This ref still exists when the branch is already deleted (see https://docs.gitlab.com/ce/ci/pipelines/#ref-specs-for-runners), so the pipeline canceling is not necessary anymore. --- merge_into_manifest.py | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/merge_into_manifest.py b/merge_into_manifest.py index 1d608e1c..a57124ab 100755 --- a/merge_into_manifest.py +++ b/merge_into_manifest.py @@ -100,30 +100,6 @@ def merge_into_manifest(manifest_project, master_branch, project, commit): print("Successfully merged") - # Check if there is a running pipeline on the integration branch and cancel it. - # This happens when a reintegration was necessary before merging. The instant - # merge afterwards deletes the integration branch, so the pipeline on the branch - # will fail, because repo cannot checkout the code anymore. In order not to - # confuse people, we better cancel it. Since there is a pipeline running on the - # master after merging, we don't need the branch results anyway. - try: - pipelines = manifest_project.pipelines.list( - sha=manifest_revision, - ref=integration_branch, - retry_transient_errors=True, - ) - except GitlabGetError: - print("WARNING: could not list pipelines for project '%s'" % project.name) - if pipelines: - pipeline = pipelines[0] - if pipeline.status in common.pending_states: - pipeline.cancel() - print( - "Cancelling running pipeline for integration branch '%s':" - % integration_branch - ) - print(pipeline.web_url) - return manifest_revision -- GitLab