plugin-workflow-ci 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client-v2.js +1 -0
- package/client.js +1 -0
- package/dist/client/index.js +10 -0
- package/dist/client-v2/index.js +10 -0
- package/dist/externalVersion.js +21 -0
- package/dist/index.js +48 -0
- package/dist/locale/en-US.json +105 -0
- package/dist/locale/vi-VN.json +105 -0
- package/dist/locale/zh-CN.json +105 -0
- package/dist/server/actions/ci-manager.js +307 -0
- package/dist/server/collections/ci-gate-runs.js +85 -0
- package/dist/server/collections/ci-git-feedback-outbox.js +51 -0
- package/dist/server/collections/ci-pipelines.js +88 -0
- package/dist/server/index.js +62 -0
- package/dist/server/instructions/CiInstructions.js +180 -0
- package/dist/server/migrations/20261206000001-harden-workflow-ci-v020.js +91 -0
- package/dist/server/plugin.js +255 -0
- package/dist/server/services/AiTriageService.js +215 -0
- package/dist/server/services/CiGateWorkflowService.js +1776 -0
- package/dist/server/services/EphemeralContainerService.js +891 -0
- package/dist/server/services/GitFeedbackService.js +995 -0
- package/dist/server/services/constants-internal.js +65 -0
- package/dist/shared/collection-schemas.js +125 -0
- package/dist/shared/constants.js +120 -0
- package/dist/shared/runtime-context.js +67 -0
- package/dist/shared/types.js +24 -0
- package/dist/shared/ui/CiPipelinesSettingsView.js +700 -0
- package/package.json +58 -4
- package/server.js +1 -0
- package/src/client/index.tsx +10 -0
- package/src/client/locale.ts +31 -0
- package/src/client/plugin.tsx +62 -0
- package/src/client/workflow.tsx +119 -0
- package/src/client-v2/index.tsx +10 -0
- package/src/client-v2/locale.ts +32 -0
- package/src/client-v2/plugin.tsx +77 -0
- package/src/client-v2/workflow.tsx +124 -0
- package/src/index.ts +11 -0
- package/src/locale/en-US.json +105 -0
- package/src/locale/vi-VN.json +105 -0
- package/src/locale/zh-CN.json +105 -0
- package/src/server/actions/ci-manager.ts +377 -0
- package/src/server/collections/ci-gate-runs.ts +65 -0
- package/src/server/collections/ci-git-feedback-outbox.ts +31 -0
- package/src/server/collections/ci-pipelines.ts +68 -0
- package/src/server/index.ts +17 -0
- package/src/server/instructions/CiInstructions.ts +180 -0
- package/src/server/migrations/20261206000001-harden-workflow-ci-v020.ts +78 -0
- package/src/server/plugin.ts +274 -0
- package/src/server/services/AiTriageService.ts +254 -0
- package/src/server/services/CiGateWorkflowService.ts +2310 -0
- package/src/server/services/EphemeralContainerService.ts +1170 -0
- package/src/server/services/GitFeedbackService.ts +1224 -0
- package/src/server/services/constants-internal.ts +27 -0
- package/src/shared/collection-schemas.ts +98 -0
- package/src/shared/constants.ts +50 -0
- package/src/shared/runtime-context.tsx +55 -0
- package/src/shared/types.ts +203 -0
- package/src/shared/ui/CiPipelinesSettingsView.tsx +1035 -0
- package/README.md +0 -3
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
{
|
|
2
|
+
"CI Testing & Quality Gate": "Luồng CI Kiểm thử & Quality Gate",
|
|
3
|
+
"CI Testing & Quality Gate Workflows": "Luồng CI Kiểm thử & Quality Gate",
|
|
4
|
+
"CI Pipelines & Webhooks": "Cấu hình CI Pipeline & Webhook",
|
|
5
|
+
"CI Gate Runs & Approvals": "Lịch sử CI Gate & Duyệt Promote",
|
|
6
|
+
"Create CI Pipeline": "Tạo CI Pipeline",
|
|
7
|
+
"Edit CI Pipeline": "Chỉnh sửa CI Pipeline",
|
|
8
|
+
"Pipeline": "Luồng CI",
|
|
9
|
+
"Pipeline Key": "Mã định danh Pipeline",
|
|
10
|
+
"Pipeline Name": "Tên luồng CI",
|
|
11
|
+
"Enabled": "Kích hoạt",
|
|
12
|
+
"Target Test Tenant": "Tenant Kiểm thử đích",
|
|
13
|
+
"Git Repository": "Kho mã nguồn Git",
|
|
14
|
+
"Branch Pattern": "Mẫu nhánh Git (Branch Pattern)",
|
|
15
|
+
"Trigger on Push": "Tự chạy khi Push",
|
|
16
|
+
"Trigger on PR / MR": "Tự chạy trên PR / MR",
|
|
17
|
+
"Poll MRs (NAT Fallback)": "Quét MR định kỳ (dự phòng NAT)",
|
|
18
|
+
"Git Webhook HMAC / Token Secret": "Khóa bí mật Git Webhook (HMAC / Token)",
|
|
19
|
+
"Runner Backend": "Môi trường chạy CI Runner",
|
|
20
|
+
"External CI (GitHub Actions / GitLab CI Ingest)": "CI ngoài đẩy báo cáo về (GitHub Actions / GitLab CI)",
|
|
21
|
+
"Portainer One-shot Ephemeral Container": "Container chạy 1 lần trên Portainer",
|
|
22
|
+
"Cluster Manager Ephemeral Container / K8s": "Container / K8s Job tạm qua Cluster Manager",
|
|
23
|
+
"Test Manager Default Connectors": "Kế thừa kết nối mặc định của Test Manager",
|
|
24
|
+
"Portainer Instance": "Portainer Instance",
|
|
25
|
+
"Endpoint ID": "Endpoint ID",
|
|
26
|
+
"QA Endpoint ID": "QA Endpoint ID",
|
|
27
|
+
"QA Stack ID (Lease)": "QA Stack ID (Khóa độc quyền)",
|
|
28
|
+
"QA App Services (comma-separated)": "Tên Service ứng dụng QA (cách nhau dấu phẩy)",
|
|
29
|
+
"Prod Endpoint ID": "Prod Endpoint ID",
|
|
30
|
+
"Ephemeral Runner Docker Image": "Docker Image cho CI Runner tạm",
|
|
31
|
+
"Docker Network": "Mạng Docker (Network)",
|
|
32
|
+
"Timeout (ms)": "Thời gian chờ tối đa (ms)",
|
|
33
|
+
"Ephemeral Container Command (optional)": "Lệnh chạy trong Container tạm (tùy chọn)",
|
|
34
|
+
"Extra Runner Env JSON": "Biến môi trường bổ sung (JSON)",
|
|
35
|
+
"Pre-Deploy Quality Gate Mode": "Chế độ Cổng chặn trước khi Deploy (Pre-Deploy Gate)",
|
|
36
|
+
"No Runtime Promotion (CI Feedback Only)": "Chỉ chấm CI & phản hồi Git (không tự Deploy)",
|
|
37
|
+
"Auto-Promote Runtime Stack when Passed": "Tự động Promote lên Runtime Stack khi Test Pass",
|
|
38
|
+
"Require Baseline Approval on Diff Mismatch": "Chờ duyệt Baseline nếu lệch Diff trước khi Deploy",
|
|
39
|
+
"Linked Portainer Build Pipeline": "Luồng Portainer Build liên kết",
|
|
40
|
+
"Runtime Stack ID": "Runtime Stack ID đích",
|
|
41
|
+
"Authorized QA Gate Approvers": "Danh sách QA được quyền duyệt Gate",
|
|
42
|
+
"Select dedicated QA approvers (no bypass)": "Chọn QA phụ trách duyệt (không cho vượt quyền)",
|
|
43
|
+
"Protected Release Branches": "Nhánh phát hành bảo vệ (Protected Branches)",
|
|
44
|
+
"Auto-Rollback Safe (DB Compat)": "Cho phép Tự động Rollback (DB tương thích ngược)",
|
|
45
|
+
"Publish Commit Status": "Đẩy trạng thái Commit Status",
|
|
46
|
+
"Sticky PR Comment": "Gắn bình luận tổng hợp trên PR/MR",
|
|
47
|
+
"Enrich AI Git Review": "Bơm kết quả CI vào AI Git Review",
|
|
48
|
+
"Enable AI Triage": "Bật AI chẩn đoán lỗi (Triage)",
|
|
49
|
+
"Cluster Hot-Reload Smoke": "Chạy Smoke Test khi Cluster Hot-Reload",
|
|
50
|
+
"Commit Status Context": "Tên định danh Commit Status",
|
|
51
|
+
"Agent Orchestrator Loop Pattern": "Mẫu vòng lặp Agent Orchestrator",
|
|
52
|
+
"Deploy Gate": "Cổng Deploy",
|
|
53
|
+
"Approvers": "Người duyệt",
|
|
54
|
+
"AI & Git Features": "Tính năng AI & Git",
|
|
55
|
+
"Actions": "Thao tác",
|
|
56
|
+
"Run CI": "Chạy CI",
|
|
57
|
+
"Edit": "Sửa",
|
|
58
|
+
"Delete": "Xóa",
|
|
59
|
+
"Delete this CI pipeline?": "Xóa luồng CI này?",
|
|
60
|
+
"Poll Open MRs": "Quét MR đang mở",
|
|
61
|
+
"Refresh": "Làm mới",
|
|
62
|
+
"Event & Branch": "Sự kiện & Nhánh",
|
|
63
|
+
"Test Run": "Lượt chạy Test",
|
|
64
|
+
"Test Verdict": "Kết quả Kiểm thử",
|
|
65
|
+
"Approval Decision": "Quyết định Phê duyệt",
|
|
66
|
+
"Deploy Outcome": "Kết quả Triển khai",
|
|
67
|
+
"Gate State": "Trạng thái Gate",
|
|
68
|
+
"Approve & Promote": "Duyệt Baseline & Deploy",
|
|
69
|
+
"Logs & Triage": "Nhật ký & AI Triage",
|
|
70
|
+
"CI Gate Run": "Lượt chạy CI Gate",
|
|
71
|
+
"Commit SHA": "Commit SHA",
|
|
72
|
+
"Build Provenance": "Nguồn gốc Bản Build",
|
|
73
|
+
"Git Feedback Sync": "Đồng bộ Git",
|
|
74
|
+
"Approved by": "Đã duyệt bởi",
|
|
75
|
+
"Automatic Production Rollback Verified": "Đã tự động Rollback về bản ổn định trước đó và xác minh Healthy",
|
|
76
|
+
"Production Rollback Skipped / Failed — Ops Intervention Required": "Không thể tự động Rollback — Yêu cầu vận hành can thiệp",
|
|
77
|
+
"PROMOTION HALTED": "ĐÃ KHÓA PROMOTE",
|
|
78
|
+
"Promotion Halted": "Đã khóa tự động Promote Production",
|
|
79
|
+
"Ops intervention required before resuming production deployments.": "Yêu cầu vận hành kiểm tra và xử lý sự cố trước khi mở lại cổng Promote.",
|
|
80
|
+
"Clear Halt": "Mở khóa Promote",
|
|
81
|
+
"Cleared promotion halt on pipeline": "Đã mở khóa Promote cho luồng CI",
|
|
82
|
+
"Pending QA Approvals": "Đang chờ QA duyệt",
|
|
83
|
+
"Git Feedback Retrying": "Đang thử lại gửi Git",
|
|
84
|
+
"Pending Container Cleanups": "Container tạm chờ dọn",
|
|
85
|
+
"AI Failure Triage": "Chẩn đoán nguyên nhân lỗi AI",
|
|
86
|
+
"Execution Logs": "Nhật ký thực thi",
|
|
87
|
+
"No logs recorded.": "Chưa có nhật ký.",
|
|
88
|
+
"No CI pipelines configured yet.": "Chưa có cấu hình CI Pipeline nào.",
|
|
89
|
+
"No CI Gate runs executed yet.": "Chưa có lượt chạy CI Gate nào.",
|
|
90
|
+
"CI Pipeline saved successfully": "Đã lưu cấu hình CI Pipeline",
|
|
91
|
+
"CI Gate run queued via workflow": "Đã đưa lượt chạy CI Gate vào hàng đợi Workflow",
|
|
92
|
+
"Polled open Merge Requests for CI changes": "Đã quét thay đổi trên các Merge Request đang mở",
|
|
93
|
+
"Approved dataset baselines and promoted deployment": "Đã duyệt cập nhật Baseline và thực hiện Promote Deploy",
|
|
94
|
+
"CI Gate Run ID (optional override)": "Mã lượt chạy CI Gate (tùy chọn)",
|
|
95
|
+
"Dispatch CI Test Run & Ephemeral Container": "Kích hoạt CI Test Run & Container tạm",
|
|
96
|
+
"AI Failure Triage & Agent Loop": "AI Chẩn đoán lỗi & Kích hoạt Agent Loop",
|
|
97
|
+
"Publish Git Commit Status & Sticky PR Comment": "Đẩy Git Commit Status & Bình luận tổng hợp PR/MR",
|
|
98
|
+
"Await Authorized QA Baseline Approval": "Chờ QA được ủy quyền duyệt Baseline",
|
|
99
|
+
"Enforce CI Quality Gate & Promote Runtime Stack": "Thực thi Pre-Deploy Quality Gate & Promote Runtime Stack",
|
|
100
|
+
"Publishes pending Git commit status, enqueues an isolated Test Manager run, and optionally launches a one-shot ephemeral container.": "Đẩy trạng thái pending lên Git, tạo lượt chạy cô lập trong Test Manager và tùy chọn khởi chạy container CI dùng 1 lần.",
|
|
101
|
+
"Classifies failed or mismatched CI runs (code regression vs baseline change vs infra flake) and optionally triggers Agent Orchestrator.": "Phân loại nguyên nhân lỗi (lỗi hồi quy code / thay đổi dữ liệu chuẩn / lỗi môi trường chập chờn) và tùy chọn kích hoạt Agent Orchestrator.",
|
|
102
|
+
"Updates GitHub/GitLab commit status, upserts a sticky Markdown summary comment on the PR/MR, and enriches pending AI Git Reviews.": "Cập nhật Commit Status trên GitHub/GitLab, tạo/sửa bình luận bảng tổng hợp trên PR/MR và bổ sung kết quả test vào AI Git Review.",
|
|
103
|
+
"Pauses execution on pure baseline diff mismatches until an authorized user in gateApproverIds approves the baseline.": "Tạm dừng luồng khi chỉ có sai lệch Baseline thuần túy cho tới khi thành viên trong gateApproverIds phê duyệt.",
|
|
104
|
+
"Promotes the verified build tag to the runtime Portainer stack when tests pass, or blocks/awaits baseline approval on failure.": "Tự động đưa bản build đã vượt qua kiểm thử lên Runtime Stack trên Portainer, hoặc chặn/chờ duyệt Baseline khi có sai lệch."
|
|
105
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
{
|
|
2
|
+
"CI Testing & Quality Gate": "CI 持续测试与质量门禁",
|
|
3
|
+
"CI Testing & Quality Gate Workflows": "CI 持续测试与质量门禁工作流",
|
|
4
|
+
"CI Pipelines & Webhooks": "CI 流水线与 Webhook",
|
|
5
|
+
"CI Gate Runs & Approvals": "质量门禁执行记录与审批",
|
|
6
|
+
"Create CI Pipeline": "新建 CI 流水线",
|
|
7
|
+
"Edit CI Pipeline": "编辑 CI 流水线",
|
|
8
|
+
"Pipeline": "流水线",
|
|
9
|
+
"Pipeline Key": "流水线标识",
|
|
10
|
+
"Pipeline Name": "流水线名称",
|
|
11
|
+
"Enabled": "已启用",
|
|
12
|
+
"Target Test Tenant": "关联测试租户",
|
|
13
|
+
"Git Repository": "Git 仓库",
|
|
14
|
+
"Branch Pattern": "分支匹配规则",
|
|
15
|
+
"Trigger on Push": "Push 自动触发",
|
|
16
|
+
"Trigger on PR / MR": "PR / MR 自动触发",
|
|
17
|
+
"Poll MRs (NAT Fallback)": "轮询打开的 MR(内网兜底)",
|
|
18
|
+
"Git Webhook HMAC / Token Secret": "Git Webhook 签名密钥",
|
|
19
|
+
"Runner Backend": "执行器后端",
|
|
20
|
+
"External CI (GitHub Actions / GitLab CI Ingest)": "外部 CI 推送报告(GitHub Actions / GitLab CI)",
|
|
21
|
+
"Portainer One-shot Ephemeral Container": "Portainer 一次性临时容器",
|
|
22
|
+
"Cluster Manager Ephemeral Container / K8s": "Cluster Manager 临时容器 / K8s 任务",
|
|
23
|
+
"Test Manager Default Connectors": "复用测试中心默认连接器",
|
|
24
|
+
"Portainer Instance": "Portainer 实例",
|
|
25
|
+
"Endpoint ID": "环境 Endpoint ID",
|
|
26
|
+
"QA Endpoint ID": "QA 环境 Endpoint ID",
|
|
27
|
+
"QA Stack ID (Lease)": "独占 QA Stack ID",
|
|
28
|
+
"QA App Services (comma-separated)": "QA 应用服务名(逗号分隔)",
|
|
29
|
+
"Prod Endpoint ID": "生产环境 Endpoint ID",
|
|
30
|
+
"Ephemeral Runner Docker Image": "临时执行容器镜像",
|
|
31
|
+
"Docker Network": "Docker 网络",
|
|
32
|
+
"Timeout (ms)": "超时时间(毫秒)",
|
|
33
|
+
"Ephemeral Container Command (optional)": "容器测试执行命令(可选)",
|
|
34
|
+
"Extra Runner Env JSON": "附加环境变量 JSON",
|
|
35
|
+
"Pre-Deploy Quality Gate Mode": "部署前质量门禁模式",
|
|
36
|
+
"No Runtime Promotion (CI Feedback Only)": "仅反馈 CI 结果(不触发运行时部署)",
|
|
37
|
+
"Auto-Promote Runtime Stack when Passed": "全部通过后自动晋级部署运行时栈",
|
|
38
|
+
"Require Baseline Approval on Diff Mismatch": "数据比对差异时等待人工确认基准后再部署",
|
|
39
|
+
"Linked Portainer Build Pipeline": "关联 Portainer 构建流水线",
|
|
40
|
+
"Runtime Stack ID": "目标运行时 Stack ID",
|
|
41
|
+
"Authorized QA Gate Approvers": "授权 QA 基准审批人",
|
|
42
|
+
"Select dedicated QA approvers (no bypass)": "指定专职 QA 审批人(不可越权)",
|
|
43
|
+
"Protected Release Branches": "受保护发布分支",
|
|
44
|
+
"Auto-Rollback Safe (DB Compat)": "允许自动回滚(数据库向后兼容)",
|
|
45
|
+
"Publish Commit Status": "同步提交状态(Commit Status)",
|
|
46
|
+
"Sticky PR Comment": "维护 PR 汇总置顶评论",
|
|
47
|
+
"Enrich AI Git Review": "注入 CI 结果至 AI 代码审查",
|
|
48
|
+
"Enable AI Triage": "启用 AI 故障根因诊断",
|
|
49
|
+
"Cluster Hot-Reload Smoke": "集群插件热重载后自动冒烟",
|
|
50
|
+
"Commit Status Context": "提交状态标识(Context)",
|
|
51
|
+
"Agent Orchestrator Loop Pattern": "Agent 编排器循环模板",
|
|
52
|
+
"Deploy Gate": "部署门禁",
|
|
53
|
+
"Approvers": "审批人",
|
|
54
|
+
"AI & Git Features": "AI 与 Git 联动能力",
|
|
55
|
+
"Actions": "操作",
|
|
56
|
+
"Run CI": "触发 CI",
|
|
57
|
+
"Edit": "编辑",
|
|
58
|
+
"Delete": "删除",
|
|
59
|
+
"Delete this CI pipeline?": "确认删除此 CI 流水线?",
|
|
60
|
+
"Poll Open MRs": "立即轮询 MR",
|
|
61
|
+
"Refresh": "刷新",
|
|
62
|
+
"Event & Branch": "触发事件与分支",
|
|
63
|
+
"Test Run": "关联测试记录",
|
|
64
|
+
"Test Verdict": "测试结论",
|
|
65
|
+
"Approval Decision": "人工审批状态",
|
|
66
|
+
"Deploy Outcome": "生产部署结果",
|
|
67
|
+
"Gate State": "门禁状态",
|
|
68
|
+
"Approve & Promote": "确认基准并部署",
|
|
69
|
+
"Logs & Triage": "日志与 AI 诊断",
|
|
70
|
+
"CI Gate Run": "CI 门禁记录",
|
|
71
|
+
"Commit SHA": "提交 SHA",
|
|
72
|
+
"Build Provenance": "构建溯源",
|
|
73
|
+
"Git Feedback Sync": "Git 状态同步",
|
|
74
|
+
"Approved by": "审批人",
|
|
75
|
+
"Automatic Production Rollback Verified": "已自动回滚至上一稳定版本并通过健康检查",
|
|
76
|
+
"Production Rollback Skipped / Failed — Ops Intervention Required": "自动回滚跳过或失败 — 需运维人工介入",
|
|
77
|
+
"PROMOTION HALTED": "已暂停部署晋级",
|
|
78
|
+
"Promotion Halted": "生产部署已熔断锁定",
|
|
79
|
+
"Ops intervention required before resuming production deployments.": "请先完成运维故障处置,再解除生产部署锁定。",
|
|
80
|
+
"Clear Halt": "解除锁定",
|
|
81
|
+
"Cleared promotion halt on pipeline": "已解除流水线生产部署锁定",
|
|
82
|
+
"Pending QA Approvals": "待 QA 审批",
|
|
83
|
+
"Git Feedback Retrying": "Git 回写重试中",
|
|
84
|
+
"Pending Container Cleanups": "待清理临时容器",
|
|
85
|
+
"AI Failure Triage": "AI 故障根因诊断",
|
|
86
|
+
"Execution Logs": "执行日志",
|
|
87
|
+
"No logs recorded.": "暂无日志。",
|
|
88
|
+
"No CI pipelines configured yet.": "尚未配置 CI 流水线。",
|
|
89
|
+
"No CI Gate runs executed yet.": "暂无质量门禁执行记录。",
|
|
90
|
+
"CI Pipeline saved successfully": "CI 流水线保存成功",
|
|
91
|
+
"CI Gate run queued via workflow": "CI 质量门禁已加入工作流队列",
|
|
92
|
+
"Polled open Merge Requests for CI changes": "已完成打开状态 MR 的变更扫描",
|
|
93
|
+
"Approved dataset baselines and promoted deployment": "已更新基准数据并完成运行时部署晋级",
|
|
94
|
+
"CI Gate Run ID (optional override)": "CI 门禁记录 ID(可选覆盖)",
|
|
95
|
+
"Dispatch CI Test Run & Ephemeral Container": "分发 CI 测试与一次性临时容器",
|
|
96
|
+
"AI Failure Triage & Agent Loop": "AI 失败诊断与 Agent 循环触发",
|
|
97
|
+
"Publish Git Commit Status & Sticky PR Comment": "回写 Git 提交状态与 PR 汇总评论",
|
|
98
|
+
"Await Authorized QA Baseline Approval": "等待授权 QA 审批基准差异",
|
|
99
|
+
"Enforce CI Quality Gate & Promote Runtime Stack": "执行部署前质量门禁并晋级运行时栈",
|
|
100
|
+
"Publishes pending Git commit status, enqueues an isolated Test Manager run, and optionally launches a one-shot ephemeral container.": "标记 Git 提交状态为运行中,创建隔离测试任务,并按需拉起一次性临时测试容器。",
|
|
101
|
+
"Classifies failed or mismatched CI runs (code regression vs baseline change vs infra flake) and optionally triggers Agent Orchestrator.": "对失败或差异用例进行根因分类(代码回归 / 预期基准变更 / 环境抖动),并按需触发 Agent 编排器深入分析。",
|
|
102
|
+
"Updates GitHub/GitLab commit status, upserts a sticky Markdown summary comment on the PR/MR, and enriches pending AI Git Reviews.": "更新 GitHub/GitLab 提交检查状态、维护 PR/MR 上的汇总评论,并将测试结论注入待执行的 AI 代码审查。",
|
|
103
|
+
"Pauses execution on pure baseline diff mismatches until an authorized user in gateApproverIds approves the baseline.": "当仅存在基准数据差异时挂起等待,仅允许 gateApproverIds 名单内的授权 QA 审批通过。",
|
|
104
|
+
"Promotes the verified build tag to the runtime Portainer stack when tests pass, or blocks/awaits baseline approval on failure.": "测试通过时自动将已验证镜像晋级部署至运行时 Portainer 栈;存在差异或失败时拦截部署或等待人工确认基准。"
|
|
105
|
+
}
|
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type { Context, Next } from '@nocobase/actions';
|
|
11
|
+
import type { Model } from '@nocobase/database';
|
|
12
|
+
import type Application from '@nocobase/server';
|
|
13
|
+
import {
|
|
14
|
+
AGENT_LOOP_PATTERNS_COLLECTION,
|
|
15
|
+
CI_GATE_RUNS_COLLECTION,
|
|
16
|
+
CI_MANAGER_ACL_SNIPPET,
|
|
17
|
+
CI_PIPELINES_COLLECTION,
|
|
18
|
+
GIT_REPOSITORIES_COLLECTION,
|
|
19
|
+
PORTAINER_INSTANCES_COLLECTION,
|
|
20
|
+
PORTAINER_PIPELINES_COLLECTION,
|
|
21
|
+
SECRET_MASK,
|
|
22
|
+
TEST_TENANTS_COLLECTION,
|
|
23
|
+
} from '../../shared/constants';
|
|
24
|
+
import type { CiEventType, CiGateRunRecord, CiPipelineRecord } from '../../shared/types';
|
|
25
|
+
import type { CiGateWorkflowService } from '../services/CiGateWorkflowService';
|
|
26
|
+
import {
|
|
27
|
+
matchesBranchPattern,
|
|
28
|
+
parseGitWebhookPayload,
|
|
29
|
+
verifyConstantTimeSecret,
|
|
30
|
+
verifyGitHubHmacSignature,
|
|
31
|
+
} from '../services/GitFeedbackService';
|
|
32
|
+
|
|
33
|
+
export function isCiAdminContext(app: Application, ctx: Context): boolean {
|
|
34
|
+
const roles = Array.isArray(ctx.state?.currentRoles) ? (ctx.state.currentRoles as string[]) : [];
|
|
35
|
+
if (roles.includes('root') || roles.includes('admin')) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
const acl = app.acl as unknown as {
|
|
39
|
+
can?: (opts: { role: string; resource: string; action: string }) => unknown;
|
|
40
|
+
};
|
|
41
|
+
if (typeof acl?.can === 'function') {
|
|
42
|
+
for (const role of roles) {
|
|
43
|
+
if (acl.can({ role, resource: CI_PIPELINES_COLLECTION, action: 'update' })) {
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function hasCollectionSafe(app: Application, name: string): boolean {
|
|
52
|
+
try {
|
|
53
|
+
return Boolean(app.db.getCollection(name));
|
|
54
|
+
} catch {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function maskPipelineSecrets(pipeline: CiPipelineRecord): CiPipelineRecord {
|
|
60
|
+
return {
|
|
61
|
+
...pipeline,
|
|
62
|
+
webhookSecret: pipeline.webhookSecret ? SECRET_MASK : null,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function createCiManagerResourceActions(app: Application, getService: () => CiGateWorkflowService) {
|
|
67
|
+
return {
|
|
68
|
+
async listMeta(ctx: Context, next: Next) {
|
|
69
|
+
if (!ctx.state?.currentUser?.id) {
|
|
70
|
+
ctx.throw(401, 'Authentication required');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const tenants = hasCollectionSafe(app, TEST_TENANTS_COLLECTION)
|
|
74
|
+
? ((await app.db.getRepository(TEST_TENANTS_COLLECTION).find({ limit: 100, sort: ['id'] })) as Model[]).map(
|
|
75
|
+
(m) => ({
|
|
76
|
+
id: Number(m.get('id')),
|
|
77
|
+
key: String(m.get('key') || ''),
|
|
78
|
+
name: String(m.get('name') || m.get('key') || `#${String(m.get('id'))}`),
|
|
79
|
+
}),
|
|
80
|
+
)
|
|
81
|
+
: [];
|
|
82
|
+
|
|
83
|
+
const gitRepos = hasCollectionSafe(app, GIT_REPOSITORIES_COLLECTION)
|
|
84
|
+
? ((await app.db.getRepository(GIT_REPOSITORIES_COLLECTION).find({ limit: 100, sort: ['id'] })) as Model[]).map(
|
|
85
|
+
(m) => ({
|
|
86
|
+
id: Number(m.get('id')),
|
|
87
|
+
name: String(m.get('name') || m.get('repoUrl') || `#${String(m.get('id'))}`),
|
|
88
|
+
}),
|
|
89
|
+
)
|
|
90
|
+
: [];
|
|
91
|
+
|
|
92
|
+
const portainerInstances = hasCollectionSafe(app, PORTAINER_INSTANCES_COLLECTION)
|
|
93
|
+
? (
|
|
94
|
+
(await app.db.getRepository(PORTAINER_INSTANCES_COLLECTION).find({ limit: 50, sort: ['id'] })) as Model[]
|
|
95
|
+
).map((m) => ({
|
|
96
|
+
id: Number(m.get('id')),
|
|
97
|
+
name: String(m.get('name') || `#${String(m.get('id'))}`),
|
|
98
|
+
}))
|
|
99
|
+
: [];
|
|
100
|
+
|
|
101
|
+
const portainerPipelines = hasCollectionSafe(app, PORTAINER_PIPELINES_COLLECTION)
|
|
102
|
+
? (
|
|
103
|
+
(await app.db.getRepository(PORTAINER_PIPELINES_COLLECTION).find({ limit: 100, sort: ['id'] })) as Model[]
|
|
104
|
+
).map((m) => ({
|
|
105
|
+
id: Number(m.get('id')),
|
|
106
|
+
name: String(m.get('name') || `#${String(m.get('id'))}`),
|
|
107
|
+
deployEnabled: Boolean(m.get('deployEnabled')),
|
|
108
|
+
}))
|
|
109
|
+
: [];
|
|
110
|
+
|
|
111
|
+
const agentLoopPatterns = hasCollectionSafe(app, AGENT_LOOP_PATTERNS_COLLECTION)
|
|
112
|
+
? (
|
|
113
|
+
(await app.db.getRepository(AGENT_LOOP_PATTERNS_COLLECTION).find({ limit: 100, sort: ['id'] })) as Model[]
|
|
114
|
+
).map((m) => ({
|
|
115
|
+
id: Number(m.get('id')),
|
|
116
|
+
key: String(m.get('key') || ''),
|
|
117
|
+
name: String(m.get('name') || m.get('title') || m.get('key') || `#${String(m.get('id'))}`),
|
|
118
|
+
}))
|
|
119
|
+
: [];
|
|
120
|
+
|
|
121
|
+
const users = hasCollectionSafe(app, 'users')
|
|
122
|
+
? ((await app.db.getRepository('users').find({ limit: 200, sort: ['id'] })) as Model[]).map((m) => ({
|
|
123
|
+
id: Number(m.get('id')),
|
|
124
|
+
username: String(m.get('username') || ''),
|
|
125
|
+
nickname: String(m.get('nickname') || m.get('username') || `#${String(m.get('id'))}`),
|
|
126
|
+
}))
|
|
127
|
+
: [];
|
|
128
|
+
|
|
129
|
+
ctx.body = {
|
|
130
|
+
tenants,
|
|
131
|
+
gitRepos,
|
|
132
|
+
portainerInstances,
|
|
133
|
+
portainerPipelines,
|
|
134
|
+
agentLoopPatterns,
|
|
135
|
+
users,
|
|
136
|
+
};
|
|
137
|
+
await next();
|
|
138
|
+
},
|
|
139
|
+
|
|
140
|
+
async listGateRuns(ctx: Context, next: Next) {
|
|
141
|
+
if (!ctx.state?.currentUser?.id) {
|
|
142
|
+
ctx.throw(401, 'Authentication required');
|
|
143
|
+
}
|
|
144
|
+
const params = (ctx.action.params || {}) as { pipelineId?: number | string; limit?: number | string };
|
|
145
|
+
const filter: Record<string, unknown> = {};
|
|
146
|
+
if (params.pipelineId) {
|
|
147
|
+
filter.pipelineId = Number(params.pipelineId);
|
|
148
|
+
}
|
|
149
|
+
const limit = Math.min(100, Math.max(1, Number(params.limit || 25)));
|
|
150
|
+
const rows = (await app.db.getRepository(CI_GATE_RUNS_COLLECTION).find({
|
|
151
|
+
filter,
|
|
152
|
+
sort: ['-id'],
|
|
153
|
+
limit,
|
|
154
|
+
})) as Model[];
|
|
155
|
+
ctx.body = rows.map((r) => r.toJSON() as CiGateRunRecord);
|
|
156
|
+
await next();
|
|
157
|
+
},
|
|
158
|
+
|
|
159
|
+
async triggerGate(ctx: Context, next: Next) {
|
|
160
|
+
if (!ctx.state?.currentUser?.id) {
|
|
161
|
+
ctx.throw(401, 'Authentication required');
|
|
162
|
+
}
|
|
163
|
+
const values = (ctx.action.params?.values || ctx.action.params || {}) as {
|
|
164
|
+
pipelineId?: number;
|
|
165
|
+
pipelineKey?: string;
|
|
166
|
+
eventType?: CiEventType;
|
|
167
|
+
branch?: string;
|
|
168
|
+
targetBranch?: string;
|
|
169
|
+
commitSha?: string;
|
|
170
|
+
baseSha?: string;
|
|
171
|
+
commitMessage?: string;
|
|
172
|
+
mrIid?: number;
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
const pipeRepo = app.db.getRepository(CI_PIPELINES_COLLECTION);
|
|
176
|
+
const pModel = values.pipelineId
|
|
177
|
+
? ((await pipeRepo.findOne({ filterByTk: Number(values.pipelineId) })) as Model | null)
|
|
178
|
+
: values.pipelineKey
|
|
179
|
+
? ((await pipeRepo.findOne({ filter: { key: String(values.pipelineKey).trim() } })) as Model | null)
|
|
180
|
+
: null;
|
|
181
|
+
|
|
182
|
+
if (!pModel) {
|
|
183
|
+
ctx.throw(404, 'CI Pipeline not found');
|
|
184
|
+
}
|
|
185
|
+
const pipeline = pModel.toJSON() as CiPipelineRecord;
|
|
186
|
+
|
|
187
|
+
// Manual triggers through HTTP endpoint are strictly bound to non-promotion manual eventType unless pre_deploy_gate is internally emitted by build hook
|
|
188
|
+
const safeEventType: CiEventType =
|
|
189
|
+
values.eventType && values.eventType !== 'pre_deploy_gate' ? values.eventType : 'manual';
|
|
190
|
+
|
|
191
|
+
const created = await getService().enqueueGateRun({
|
|
192
|
+
pipelineId: pipeline.id,
|
|
193
|
+
eventType: safeEventType,
|
|
194
|
+
branch: values.branch?.trim() || 'main',
|
|
195
|
+
targetBranch: values.targetBranch ?? null,
|
|
196
|
+
commitSha: values.commitSha?.trim() || `manual-${Date.now()}`,
|
|
197
|
+
baseSha: values.baseSha ?? null,
|
|
198
|
+
commitMessage: values.commitMessage ?? null,
|
|
199
|
+
mrIid: values.mrIid ? Number(values.mrIid) : null,
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
ctx.body = created;
|
|
203
|
+
await next();
|
|
204
|
+
},
|
|
205
|
+
|
|
206
|
+
async approveDiffAndPromote(ctx: Context, next: Next) {
|
|
207
|
+
const currentUserId = Number(ctx.state?.currentUser?.id || 0);
|
|
208
|
+
if (!currentUserId) {
|
|
209
|
+
ctx.throw(401, 'Authentication required');
|
|
210
|
+
}
|
|
211
|
+
const values = (ctx.action.params?.values || ctx.action.params || {}) as { gateRunId?: number };
|
|
212
|
+
const gateRunId = Number(values.gateRunId);
|
|
213
|
+
if (!Number.isFinite(gateRunId) || gateRunId <= 0) {
|
|
214
|
+
ctx.throw(400, 'Valid gateRunId is required');
|
|
215
|
+
}
|
|
216
|
+
const approver = String(ctx.state?.currentUser?.nickname || ctx.state?.currentUser?.username || currentUserId);
|
|
217
|
+
try {
|
|
218
|
+
ctx.body = await getService().approveDiffAndPromote(gateRunId, {
|
|
219
|
+
userId: currentUserId,
|
|
220
|
+
username: approver,
|
|
221
|
+
isCiAdmin: isCiAdminContext(app, ctx),
|
|
222
|
+
});
|
|
223
|
+
} catch (error) {
|
|
224
|
+
const status = (error as { status?: number })?.status;
|
|
225
|
+
if (status && status >= 400 && status < 600) {
|
|
226
|
+
ctx.throw(status, error instanceof Error ? error.message : String(error));
|
|
227
|
+
}
|
|
228
|
+
throw error;
|
|
229
|
+
}
|
|
230
|
+
await next();
|
|
231
|
+
},
|
|
232
|
+
|
|
233
|
+
async clearPromotionHalt(ctx: Context, next: Next) {
|
|
234
|
+
if (!isCiAdminContext(app, ctx)) {
|
|
235
|
+
ctx.throw(403, `Requires ${CI_MANAGER_ACL_SNIPPET} permission to clear promotion halt`);
|
|
236
|
+
}
|
|
237
|
+
const values = (ctx.action.params?.values || ctx.action.params || {}) as { pipelineId?: number };
|
|
238
|
+
const pipelineId = Number(values.pipelineId);
|
|
239
|
+
if (!Number.isFinite(pipelineId) || pipelineId <= 0) {
|
|
240
|
+
ctx.throw(400, 'Valid pipelineId is required');
|
|
241
|
+
}
|
|
242
|
+
const actorName = String(
|
|
243
|
+
ctx.state?.currentUser?.nickname || ctx.state?.currentUser?.username || ctx.state?.currentUser?.id || 'admin',
|
|
244
|
+
);
|
|
245
|
+
ctx.body = maskPipelineSecrets(await getService().clearPromotionHalt(pipelineId, actorName));
|
|
246
|
+
await next();
|
|
247
|
+
},
|
|
248
|
+
|
|
249
|
+
async triggerHotReloadSmoke(ctx: Context, next: Next) {
|
|
250
|
+
if (!isCiAdminContext(app, ctx)) {
|
|
251
|
+
ctx.throw(403, `Requires ${CI_MANAGER_ACL_SNIPPET} permission`);
|
|
252
|
+
}
|
|
253
|
+
const values = (ctx.action.params?.values || ctx.action.params || {}) as {
|
|
254
|
+
pluginName?: string;
|
|
255
|
+
commitSha?: string;
|
|
256
|
+
operationId?: string;
|
|
257
|
+
};
|
|
258
|
+
ctx.body = await getService().triggerClusterHotReloadSmoke(values);
|
|
259
|
+
await next();
|
|
260
|
+
},
|
|
261
|
+
|
|
262
|
+
async pollNow(ctx: Context, next: Next) {
|
|
263
|
+
if (!isCiAdminContext(app, ctx)) {
|
|
264
|
+
ctx.throw(403, `Requires ${CI_MANAGER_ACL_SNIPPET} permission`);
|
|
265
|
+
}
|
|
266
|
+
const triggered = await getService().pollDueMergeRequests();
|
|
267
|
+
ctx.body = { triggered };
|
|
268
|
+
await next();
|
|
269
|
+
},
|
|
270
|
+
|
|
271
|
+
async webhook(ctx: Context, next: Next) {
|
|
272
|
+
const params = (ctx.action.params || {}) as {
|
|
273
|
+
pipelineId?: number | string;
|
|
274
|
+
pipelineKey?: string;
|
|
275
|
+
};
|
|
276
|
+
const rawPayload = ctx.request?.body ?? ctx.action.params?.values ?? {};
|
|
277
|
+
|
|
278
|
+
const pipeRepo = app.db.getRepository(CI_PIPELINES_COLLECTION);
|
|
279
|
+
const pModel = params.pipelineId
|
|
280
|
+
? ((await pipeRepo.findOne({ filter: { id: Number(params.pipelineId), enabled: true } })) as Model | null)
|
|
281
|
+
: params.pipelineKey
|
|
282
|
+
? ((await pipeRepo.findOne({
|
|
283
|
+
filter: { key: String(params.pipelineKey).trim(), enabled: true },
|
|
284
|
+
})) as Model | null)
|
|
285
|
+
: null;
|
|
286
|
+
|
|
287
|
+
if (!pModel) {
|
|
288
|
+
ctx.throw(404, 'Active CI Pipeline not found for webhook');
|
|
289
|
+
}
|
|
290
|
+
const pipeline = pModel.toJSON() as CiPipelineRecord;
|
|
291
|
+
|
|
292
|
+
const service = getService();
|
|
293
|
+
const expectedSecret = await service.gitFeedbackService.decryptSecret(pipeline.webhookSecret);
|
|
294
|
+
if (!expectedSecret) {
|
|
295
|
+
ctx.throw(401, 'Webhook secret is not configured on this CI pipeline');
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
const getHeader = (name: string): string | undefined =>
|
|
299
|
+
typeof ctx.get === 'function' ? ctx.get(name) || undefined : undefined;
|
|
300
|
+
|
|
301
|
+
const ghSignature = getHeader('x-hub-signature-256');
|
|
302
|
+
const glToken = getHeader('x-gitlab-token') || getHeader('x-ci-webhook-token');
|
|
303
|
+
|
|
304
|
+
let signatureValid = false;
|
|
305
|
+
if (ghSignature) {
|
|
306
|
+
const rawBodyText =
|
|
307
|
+
typeof (ctx.request as { rawBody?: unknown } | undefined)?.rawBody === 'string'
|
|
308
|
+
? String((ctx.request as { rawBody?: string }).rawBody)
|
|
309
|
+
: JSON.stringify(rawPayload);
|
|
310
|
+
signatureValid = verifyGitHubHmacSignature(expectedSecret, rawBodyText, ghSignature);
|
|
311
|
+
} else if (glToken) {
|
|
312
|
+
signatureValid = verifyConstantTimeSecret(expectedSecret, glToken);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
if (!signatureValid) {
|
|
316
|
+
ctx.throw(401, 'Invalid webhook signature or secret token');
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
const parsed = parseGitWebhookPayload(
|
|
320
|
+
{
|
|
321
|
+
'x-github-event': getHeader('x-github-event'),
|
|
322
|
+
'x-gitlab-event': getHeader('x-gitlab-event'),
|
|
323
|
+
},
|
|
324
|
+
rawPayload,
|
|
325
|
+
);
|
|
326
|
+
|
|
327
|
+
if (parsed.eventType === 'ignored') {
|
|
328
|
+
ctx.body = { accepted: false, ignored: true, reason: parsed.reason || 'Event ignored' };
|
|
329
|
+
await next();
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
if (parsed.eventType === 'push' && !pipeline.triggerOnPush) {
|
|
334
|
+
ctx.body = { accepted: false, ignored: true, reason: 'triggerOnPush is disabled' };
|
|
335
|
+
await next();
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
if (parsed.eventType === 'merge_request' && !pipeline.triggerOnMergeRequest) {
|
|
340
|
+
ctx.body = { accepted: false, ignored: true, reason: 'triggerOnMergeRequest is disabled' };
|
|
341
|
+
await next();
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
if (!matchesBranchPattern(parsed.branch, pipeline.branchPattern)) {
|
|
346
|
+
ctx.body = {
|
|
347
|
+
accepted: false,
|
|
348
|
+
ignored: true,
|
|
349
|
+
reason: `Branch "${parsed.branch}" does not match pattern "${pipeline.branchPattern || '*'}"`,
|
|
350
|
+
};
|
|
351
|
+
await next();
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
const gateRun = await service.enqueueGateRun({
|
|
356
|
+
pipelineId: pipeline.id,
|
|
357
|
+
eventType: parsed.eventType,
|
|
358
|
+
branch: parsed.branch,
|
|
359
|
+
targetBranch: parsed.targetBranch ?? null,
|
|
360
|
+
commitSha: parsed.commitSha,
|
|
361
|
+
baseSha: parsed.baseSha ?? null,
|
|
362
|
+
commitMessage: parsed.commitMessage ?? null,
|
|
363
|
+
mrIid: parsed.mrIid ?? null,
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
ctx.body = {
|
|
367
|
+
accepted: true,
|
|
368
|
+
gateRunId: gateRun.id,
|
|
369
|
+
eventType: parsed.eventType,
|
|
370
|
+
branch: parsed.branch,
|
|
371
|
+
commitSha: parsed.commitSha,
|
|
372
|
+
mrIid: parsed.mrIid ?? null,
|
|
373
|
+
};
|
|
374
|
+
await next();
|
|
375
|
+
},
|
|
376
|
+
};
|
|
377
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type { CollectionOptions } from '@nocobase/database';
|
|
11
|
+
import { CI_GATE_RUNS_COLLECTION } from '../../shared/constants';
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
name: CI_GATE_RUNS_COLLECTION,
|
|
15
|
+
title: 'CI Gate Runs',
|
|
16
|
+
indexes: [
|
|
17
|
+
{ fields: ['pipelineId'] },
|
|
18
|
+
{ fields: ['testRunId'] },
|
|
19
|
+
{ fields: ['buildRunId'] },
|
|
20
|
+
{ fields: ['operationId'] },
|
|
21
|
+
{ fields: ['state'] },
|
|
22
|
+
{ fields: ['commitSha'] },
|
|
23
|
+
{ fields: ['pipelineId', 'eventType', 'commitSha'] },
|
|
24
|
+
],
|
|
25
|
+
fields: [
|
|
26
|
+
{ name: 'id', type: 'bigInt', autoIncrement: true, primaryKey: true },
|
|
27
|
+
{ name: 'pipelineId', type: 'bigInt', allowNull: false },
|
|
28
|
+
{ name: 'tenantId', type: 'bigInt', allowNull: false },
|
|
29
|
+
{ name: 'testRunId', type: 'bigInt' },
|
|
30
|
+
{ name: 'buildRunId', type: 'bigInt' },
|
|
31
|
+
{ name: 'operationId', type: 'string', length: 128 },
|
|
32
|
+
{ name: 'gitRepositoryId', type: 'bigInt' },
|
|
33
|
+
{ name: 'eventType', type: 'string', length: 32, defaultValue: 'manual' },
|
|
34
|
+
{ name: 'branch', type: 'string', length: 255, allowNull: false },
|
|
35
|
+
{ name: 'targetBranch', type: 'string', length: 255 },
|
|
36
|
+
{ name: 'commitSha', type: 'string', length: 64, allowNull: false },
|
|
37
|
+
{ name: 'baseSha', type: 'string', length: 64 },
|
|
38
|
+
{ name: 'commitMessage', type: 'text' },
|
|
39
|
+
{ name: 'mrIid', type: 'bigInt' },
|
|
40
|
+
{ name: 'workflowKey', type: 'string', length: 128 },
|
|
41
|
+
{ name: 'workflowId', type: 'bigInt' },
|
|
42
|
+
{ name: 'executionId', type: 'bigInt' },
|
|
43
|
+
{ name: 'pendingJobId', type: 'bigInt' },
|
|
44
|
+
{ name: 'state', type: 'string', length: 32, defaultValue: 'queued' },
|
|
45
|
+
{ name: 'testVerdict', type: 'string', length: 32 },
|
|
46
|
+
{ name: 'verdictReasonCode', type: 'string', length: 64 },
|
|
47
|
+
{ name: 'approvalState', type: 'string', length: 32, defaultValue: 'not_required' },
|
|
48
|
+
{ name: 'approvalRecord', type: 'json' },
|
|
49
|
+
{ name: 'deployOutcome', type: 'string', length: 32, defaultValue: 'not_applicable' },
|
|
50
|
+
{ name: 'rollbackRecord', type: 'json' },
|
|
51
|
+
{ name: 'commitStatusState', type: 'string', length: 32 },
|
|
52
|
+
{ name: 'gitFeedbackSyncState', type: 'string', length: 32 },
|
|
53
|
+
{ name: 'prCommentId', type: 'string', length: 64 },
|
|
54
|
+
{ name: 'ephemeralContainerId', type: 'string', length: 128 },
|
|
55
|
+
{ name: 'deployTargetSummary', type: 'json' },
|
|
56
|
+
{ name: 'triageResult', type: 'json' },
|
|
57
|
+
{ name: 'logs', type: 'text' },
|
|
58
|
+
{ name: 'errorMessage', type: 'text' },
|
|
59
|
+
{ name: 'startedAt', type: 'date' },
|
|
60
|
+
{ name: 'finishedAt', type: 'date' },
|
|
61
|
+
{ name: 'durationMs', type: 'integer' },
|
|
62
|
+
{ name: 'createdAt', type: 'date' },
|
|
63
|
+
{ name: 'updatedAt', type: 'date' },
|
|
64
|
+
],
|
|
65
|
+
} as CollectionOptions;
|