feat(acceptance): 建立同构验收与弹性容量体系

实现本地三节点 K3s 同构环境、脱敏生产快照、Gemini 图片和多参考图视频协议模拟、统一验收报告及故障注入。\n\n新增 Worker 容量控制器、资源与连接预算、任务恢复保护,并将生产验收拆分为 validation 执行和人工 CAS 放量。\n\n验证包括 Go 全量测试、PostgreSQL HTTP 集成测试、go vet、OpenAPI、ShellCheck、前端检查、迁移及发布脚本测试。
This commit is contained in:
2026-07-31 18:02:24 +08:00
parent 93d36d0e55
commit e05922b0f4
94 changed files with 12379 additions and 826 deletions
+243
View File
@@ -2575,6 +2575,33 @@
}
}
},
"/api/admin/system/acceptance/capacity-profiles": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"produces": [
"application/json"
],
"tags": [
"acceptance"
],
"summary": "获取经生产同构验收认证的容量配置",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/store.CapacityProfile"
}
}
}
}
}
},
"/api/admin/system/acceptance/runs": {
"post": {
"security": [
@@ -2724,6 +2751,51 @@
}
}
},
"/api/admin/system/acceptance/runs/{runID}/capacity-profiles": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"acceptance"
],
"summary": "为当前 validation Run 暂存 80% 容量门禁",
"parameters": [
{
"type": "string",
"description": "验收 Run ID",
"name": "runID",
"in": "path",
"required": true
},
{
"description": "待验证容量配置",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/store.StageAcceptanceCapacityProfilesInput"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/store.AcceptanceRun"
}
}
}
}
},
"/api/admin/system/acceptance/runs/{runID}/finish": {
"post": {
"security": [
@@ -2871,6 +2943,44 @@
}
}
},
"/api/admin/system/acceptance/traffic-mode/pause": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"acceptance"
],
"summary": "上线后硬门禁异常时通过 CAS 暂停正式新任务",
"parameters": [
{
"description": "当前线上 release 与 revision CAS",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/store.PauseGatewayTrafficInput"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/store.GatewayTrafficMode"
}
}
}
}
},
"/api/admin/system/client-customization/settings": {
"get": {
"security": [
@@ -13694,6 +13804,93 @@
}
}
},
"store.CapacityProfile": {
"type": "object",
"properties": {
"acceptanceRunId": {
"type": "string"
},
"admittedThroughputPerSecond": {
"type": "number"
},
"capacityProfile": {
"type": "string"
},
"configHash": {
"type": "string"
},
"createdAt": {
"type": "string"
},
"enabled": {
"type": "boolean"
},
"kind": {
"type": "string"
},
"maxPredictedWaitSeconds": {
"type": "integer"
},
"maxQueued": {
"type": "integer"
},
"maxRunning": {
"type": "integer"
},
"metadata": {
"type": "object",
"additionalProperties": {}
},
"model": {
"type": "string"
},
"profileKey": {
"type": "string"
},
"releaseSha": {
"type": "string"
},
"stableThroughputPerSecond": {
"type": "number"
},
"updatedAt": {
"type": "string"
}
}
},
"store.CapacityProfileInput": {
"type": "object",
"properties": {
"admittedThroughputPerSecond": {
"type": "number"
},
"kind": {
"type": "string"
},
"maxPredictedWaitSeconds": {
"type": "integer"
},
"maxQueued": {
"type": "integer"
},
"maxRunning": {
"type": "integer"
},
"metadata": {
"type": "object",
"additionalProperties": {}
},
"model": {
"type": "string"
},
"profileKey": {
"type": "string"
},
"stableThroughputPerSecond": {
"type": "number"
}
}
},
"store.CatalogProvider": {
"type": "object",
"properties": {
@@ -14502,6 +14699,9 @@
"apiImageDigest": {
"type": "string"
},
"configHash": {
"type": "string"
},
"mode": {
"type": "string"
},
@@ -14894,6 +15094,26 @@
}
}
},
"store.PauseGatewayTrafficInput": {
"type": "object",
"properties": {
"apiImageDigest": {
"type": "string"
},
"reason": {
"type": "string"
},
"releaseSha": {
"type": "string"
},
"revision": {
"type": "integer"
},
"workerImageDigest": {
"type": "string"
}
}
},
"store.Platform": {
"type": "object",
"properties": {
@@ -15525,6 +15745,15 @@
"apiImageDigest": {
"type": "string"
},
"capacityProfiles": {
"type": "array",
"items": {
"$ref": "#/definitions/store.CapacityProfileInput"
}
},
"configHash": {
"type": "string"
},
"releaseSha": {
"type": "string"
},
@@ -15768,6 +15997,20 @@
}
}
},
"store.StageAcceptanceCapacityProfilesInput": {
"type": "object",
"properties": {
"capacityProfiles": {
"type": "array",
"items": {
"$ref": "#/definitions/store.CapacityProfileInput"
}
},
"configHash": {
"type": "string"
}
}
},
"store.TaskAttempt": {
"type": "object",
"properties": {
+155
View File
@@ -2512,6 +2512,64 @@ definitions:
updatedAt:
type: string
type: object
store.CapacityProfile:
properties:
acceptanceRunId:
type: string
admittedThroughputPerSecond:
type: number
capacityProfile:
type: string
configHash:
type: string
createdAt:
type: string
enabled:
type: boolean
kind:
type: string
maxPredictedWaitSeconds:
type: integer
maxQueued:
type: integer
maxRunning:
type: integer
metadata:
additionalProperties: {}
type: object
model:
type: string
profileKey:
type: string
releaseSha:
type: string
stableThroughputPerSecond:
type: number
updatedAt:
type: string
type: object
store.CapacityProfileInput:
properties:
admittedThroughputPerSecond:
type: number
kind:
type: string
maxPredictedWaitSeconds:
type: integer
maxQueued:
type: integer
maxRunning:
type: integer
metadata:
additionalProperties: {}
type: object
model:
type: string
profileKey:
type: string
stableThroughputPerSecond:
type: number
type: object
store.CatalogProvider:
properties:
capabilitySchema:
@@ -3059,6 +3117,8 @@ definitions:
properties:
apiImageDigest:
type: string
configHash:
type: string
mode:
type: string
releaseSha:
@@ -3320,6 +3380,19 @@ definitions:
waitingSyncTasks:
type: integer
type: object
store.PauseGatewayTrafficInput:
properties:
apiImageDigest:
type: string
reason:
type: string
releaseSha:
type: string
revision:
type: integer
workerImageDigest:
type: string
type: object
store.Platform:
properties:
authType:
@@ -3748,6 +3821,12 @@ definitions:
properties:
apiImageDigest:
type: string
capacityProfiles:
items:
$ref: '#/definitions/store.CapacityProfileInput'
type: array
configHash:
type: string
releaseSha:
type: string
revision:
@@ -3915,6 +3994,15 @@ definitions:
status:
type: string
type: object
store.StageAcceptanceCapacityProfilesInput:
properties:
capacityProfiles:
items:
$ref: '#/definitions/store.CapacityProfileInput'
type: array
configHash:
type: string
type: object
store.TaskAttempt:
properties:
attemptNo:
@@ -5758,6 +5846,22 @@ paths:
summary: 更新 Runner 策略
tags:
- runtime
/api/admin/system/acceptance/capacity-profiles:
get:
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/store.CapacityProfile'
type: array
security:
- BearerAuth: []
summary: 获取经生产同构验收认证的容量配置
tags:
- acceptance
/api/admin/system/acceptance/runs:
post:
consumes:
@@ -5849,6 +5953,34 @@ paths:
summary: 切换到 validation 并激活 Run
tags:
- acceptance
/api/admin/system/acceptance/runs/{runID}/capacity-profiles:
post:
consumes:
- application/json
parameters:
- description: 验收 Run ID
in: path
name: runID
required: true
type: string
- description: 待验证容量配置
in: body
name: body
required: true
schema:
$ref: '#/definitions/store.StageAcceptanceCapacityProfilesInput'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/store.AcceptanceRun'
security:
- BearerAuth: []
summary: 为当前 validation Run 暂存 80% 容量门禁
tags:
- acceptance
/api/admin/system/acceptance/runs/{runID}/finish:
post:
consumes:
@@ -5939,6 +6071,29 @@ paths:
summary: 获取 Gateway 流量模式
tags:
- acceptance
/api/admin/system/acceptance/traffic-mode/pause:
post:
consumes:
- application/json
parameters:
- description: 当前线上 release 与 revision CAS
in: body
name: body
required: true
schema:
$ref: '#/definitions/store.PauseGatewayTrafficInput'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/store.GatewayTrafficMode'
security:
- BearerAuth: []
summary: 上线后硬门禁异常时通过 CAS 暂停正式新任务
tags:
- acceptance
/api/admin/system/client-customization/settings:
get:
description: 返回客户端名称、英文名称、平台名和图标路径;数据库对象尚未创建时返回默认设置。