From 72f720f1357231f50603e12ec48939cdf6d4b67f Mon Sep 17 00:00:00 2001 From: Damien Degois Date: Tue, 26 Nov 2024 13:55:23 +0100 Subject: [PATCH] fix pipeline link --- cards/merge_request.json.j2 | 2 +- cards/render.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cards/merge_request.json.j2 b/cards/merge_request.json.j2 index 6bfab68..3546ed3 100644 --- a/cards/merge_request.json.j2 +++ b/cards/merge_request.json.j2 @@ -217,7 +217,7 @@ "items": [ { "type": "TextBlock", - "text": "[{{ mri.head_pipeline_id }}]({{ precalc.url }}/-/pipelines/{{ mri.head_pipeline_id }})", + "text": "[{{ mri.head_pipeline_id }}]({{ precalc.project_url }}/-/pipelines/{{ mri.head_pipeline_id }})", "wrap": true } ], diff --git a/cards/render.py b/cards/render.py index 4548ba9..9b54ae2 100644 --- a/cards/render.py +++ b/cards/render.py @@ -44,6 +44,7 @@ def render(mri: MergeRequestInfos) -> dict[str, Any]: "latest_action": mri.merge_request_payload.object_attributes.action, "source_branch": mri.merge_request_payload.object_attributes.source_branch, "target_branch": mri.merge_request_payload.object_attributes.target_branch, + "project_url": mri.merge_request_payload.project.web_url, "url": mri.merge_request_payload.object_attributes.url, "latest_pipeline": latest_pipeline_infos, "approvers": approvers,