From dd33873d2bf9fa5f0c97970b74548d169b3d94fd Mon Sep 17 00:00:00 2001 From: hukdoesn Date: Mon, 22 Sep 2025 21:49:27 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix:=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E9=98=B6=E6=AE=B5=E6=9E=84=E5=BB=BA=E5=A4=B1=E8=B4=A5=20?= =?UTF-8?q?=E5=90=8E=E7=BB=AD=E9=98=B6=E6=AE=B5=E7=8A=B6=E6=80=81=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/apps/views/build_history.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/backend/apps/views/build_history.py b/backend/apps/views/build_history.py index 33d53c5..08a81de 100644 --- a/backend/apps/views/build_history.py +++ b/backend/apps/views/build_history.py @@ -17,13 +17,19 @@ class BuildHistoryView(View): def _get_stage_status_from_log(self, log: str, stage_name: str, overall_status: str = None) -> str: """从日志中获取指定阶段的状态""" if not log: - return 'pending' + if overall_status == 'failed': + return 'failed' + else: + return 'pending' # 处理特殊阶段:Git Clone if stage_name == 'Git Clone': # Git Clone 阶段使用 [Git Clone] 格式 if '[Git Clone]' not in log: - return 'pending' + if overall_status == 'failed': + return 'failed' + else: + return 'pending' # 检查是否有完成标记 if '[Git Clone] 代码克隆完成' in log: @@ -53,7 +59,10 @@ class BuildHistoryView(View): # 检查阶段是否开始执行 if stage_start_pattern not in log: - return 'pending' + if overall_status == 'failed': + return 'failed' + else: + return 'pending' # 检查阶段是否完成 if stage_complete_pattern in log: