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