feat(runs): 展示历史失败的后续成功版本
- 发布列表:展示后续成功记录并支持跳转 - 发布详情:关联成功版本与此前失败记录 - 接口与文档:同步发布记录关联字段
This commit is contained in:
@@ -76,3 +76,5 @@ MIT License。环境文件与真实凭据不得进入 Git。
|
||||
保存使用版本号防止覆盖他人更新;离开页面时提示未保存修改。发送测试会先展示确认框,以当前草稿发送一条带测试标记的消息,不会自动保存;后端有发送限流。此页面不接收或保存通知 webhook。
|
||||
|
||||
后端上线前需要执行 `20261028030000_notification_config` 迁移。数据库、真实企微投递与生产部署需分别验收。
|
||||
|
||||
发布记录页消费服务端 `supersededBy` 与 `recoveredFrom` 展示“后续成功版本”和历史失败互链,保留原始状态。前端不自行推断发布已恢复。
|
||||
|
||||
@@ -115,6 +115,8 @@ interface BackendDeployRun {
|
||||
status?: BackendRunStatus
|
||||
resolvedCommit?: string
|
||||
operationKind?: 'deploy' | 'rollback' | 'retry'
|
||||
supersededBy?: { id: string; ref: string }
|
||||
recoveredFrom?: Array<{ id: string; ref: string }>
|
||||
sourceRunId?: string
|
||||
trigger?: 'manual' | 'gitea_webhook' | 'retry' | 'jenkins_external'
|
||||
operator?: string
|
||||
@@ -1093,6 +1095,8 @@ function toReleaseRun(run: BackendDeployRun, projectList: ProjectConfig[]): Rele
|
||||
resolvedCommit: run.resolvedCommit,
|
||||
operationKind: run.operationKind,
|
||||
sourceRunId: run.sourceRunId,
|
||||
supersededBy: run.supersededBy,
|
||||
recoveredFrom: run.recoveredFrom,
|
||||
commitSummary: ref === '-' ? trigger : `${ref} · ${trigger}`,
|
||||
steps: (Array.isArray(run.steps) ? run.steps : [])
|
||||
.slice()
|
||||
|
||||
@@ -375,6 +375,8 @@ export interface ReleaseRun {
|
||||
commitSummary: string
|
||||
resolvedCommit?: string
|
||||
operationKind?: 'deploy' | 'rollback' | 'retry'
|
||||
supersededBy?: { id: string; ref: string }
|
||||
recoveredFrom?: Array<{ id: string; ref: string }>
|
||||
sourceRunId?: string
|
||||
steps: PipelineStep[]
|
||||
}
|
||||
|
||||
+12
-2
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
/** 展示历史失败与后续成功的服务端关联,原状态不覆盖。 */
|
||||
import { devopsApi } from '../services/devopsApi'
|
||||
import { confirmOperation } from '../services/operationConfirmation'
|
||||
import { computed, ref } from 'vue'
|
||||
@@ -252,8 +253,9 @@ async function adminAction(action: string | number | object) {
|
||||
row.environment === 'production' ? '生产' : '测试'
|
||||
}}</template></ElTableColumn
|
||||
>
|
||||
<ElTableColumn label="状态" width="100"
|
||||
><template #default="{ row }"><StatusPill :state="row.status" /></template
|
||||
<ElTableColumn label="状态" min-width="180"
|
||||
><template #default="{ row }"><StatusPill :state="row.status" />
|
||||
<button v-if="row.supersededBy" class="detail-link" @click.stop="router.push({ path: '/runs', query: { runId: row.supersededBy.id } })">后续版本 {{ row.supersededBy.ref }} 已成功</button></template
|
||||
></ElTableColumn>
|
||||
<ElTableColumn label="时间" width="135"
|
||||
><template #default="{ row }">{{ formatTime(row.startedAt) }}</template></ElTableColumn
|
||||
@@ -296,6 +298,14 @@ async function adminAction(action: string | number | object) {
|
||||
</div></template
|
||||
>
|
||||
<template v-if="selectedRun">
|
||||
<div v-if="selectedRun.supersededBy" class="surface-panel" role="status">
|
||||
这是一条历史失败记录。后续版本已成功:
|
||||
<button class="detail-link" @click="router.push({ path: '/runs', query: { runId: selectedRun.supersededBy.id } })">{{ selectedRun.supersededBy.ref }} · 查看成功发布</button>
|
||||
</div>
|
||||
<div v-if="selectedRun.recoveredFrom?.length" class="surface-panel">
|
||||
本次发布已成功,此前失败记录仍保留:
|
||||
<button v-for="old in selectedRun.recoveredFrom" :key="old.id" class="detail-link" @click="router.push({ path: '/runs', query: { runId: old.id } })">{{ old.ref }} · 查看历史失败</button>
|
||||
</div>
|
||||
<div class="run-context">
|
||||
<StatusPill :state="selectedRun.status" /><span>{{
|
||||
formatTime(selectedRun.startedAt)
|
||||
|
||||
Reference in New Issue
Block a user