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": {