wonder
0027704169
fix(server): 修复 TestSubscribeTask_ConcurrentSafety 数据竞争问题
...
- 修复多个 goroutine 并发 append 同一 slice 导致的 DATA RACE
- 使用预分配 slice + 索引赋值替代并发 append
- 通过 go test -race 验证
2026-07-29 14:47:31 +08:00
wonder
11a92c429f
test(server): 添加 task log 模块单元测试
...
- 添加 handler 层 16 个纯函数单元测试(状态映射、ID 解析、排序、格式化等)
- 添加 service 层 11 个 pub/sub 与缓存单元测试(订阅、取消、并发安全、TTL 过期等)
- 共 27 个测试用例,覆盖 task log 核心逻辑
背景:task log 模块经历了大量修改但缺乏测试覆盖,需要确保日志模块可用
关联 commit:61eeb0c, dbb930d
2026-07-29 14:13:53 +08:00
wonder
61eeb0c8ac
fix(server): 修复 task log 接口多个问题
...
- 修复 Wayne 任务状态映射,将数字状态统一为字符串状态
- 添加分页支持,支持 page/page_size 参数
- 添加 AWXJobStdout 内存缓存,减少重复 API 调用
- 修复 SubscribeTask 内存泄漏,自动清理 closed channel
- 统一 Stream 端点,AWX 使用 pub/sub,Wayne 使用轮询
背景:task log 接口存在多个潜在问题,包括状态判断错误导致无限轮询、
缺少分页、重复 API 调用性能问题、内存泄漏风险等
关联 commit:fix/logs 分支
2026-07-29 14:00:40 +08:00
mac
f7be87c7d9
feat: wire delivery result and infra data backends
2026-07-28 17:56:00 +08:00
mac
897670b721
Merge remote-tracking branch 'upstream/main' into feat/base-service-delivery
...
# Conflicts:
# ansible/mysql-deploy.yml
# frontend/src/api/delivery.ts
# frontend/src/views/service/Catalog.vue
# server/.env.example
# server/internal/config/config.go
# server/internal/handler/task_log.go
# server/internal/service/delivery.go
2026-07-28 15:08:37 +08:00
mac
8e09c30d21
feat: wire mysql delivery to awx callbacks
2026-07-28 14:45:17 +08:00
Hungerdream
f0c1b38c5b
feat(delivery): add automatic rollback state machine for failed deployments
...
Introduce a compensating workflow that launches the dedicated AWX
rollback template when a deployment cannot be started or fails midway.
- add task states: rollback_pending, rolling_back, rolled_back,
rollback_failed, rollback_acknowledged
- add RollbackJob model to track the compensating AWX run separately
from the deploy run, preserving both job IDs for audit
- hold resource reservations in 'rollback' status until cleanup
succeeds so a failed cleanup cannot be masked by a later delivery
- poll rollback jobs with a 2-minute launch timeout; an unknown launch
result surfaces as a recoverable failure instead of re-launching
- protect finished/register_failed/rolled-back tasks from rollback;
register_failed keeps the healthy instance and its resource usage
- add DELIVERY_ROLLBACK_TEMPLATE_ID config; without it, failures are
marked rollback_failed and require manual cleanup
- use unique pending-<task_id> placeholder for executor job IDs
2026-07-28 14:29:09 +08:00
mac
5a260c443f
feat(delivery): stream task updates with SSE
2026-07-28 09:55:04 +08:00
mac
7b4b9d2ee7
Merge remote-tracking branch 'upstream/main' into feat/base-service-delivery
...
# Conflicts:
# server/.env.example
# server/internal/config/config.go
# server/internal/service/delivery.go
# server/internal/service/delivery_test.go
2026-07-28 09:34:37 +08:00
mac
8378427d3d
fix(delivery): use unique pending AWX job placeholders
2026-07-27 18:33:33 +08:00
Hungerdream
41b2f45420
feat(delivery): support multi-instance scheduling on a single host
...
- Per-host instance limit (DELIVERY_HOST_INSTANCE_LIMIT, default 4)
- Optional target_host to pin a host from the candidate pool
- Regenerate swagger docs
2026-07-27 15:19:44 +08:00
mac
e0ee36cadb
feat(delivery): switch AWX delivery to callbacks
2026-07-27 15:19:18 +08:00
Hungerdream
bfb4f0df4d
feat(delivery): complete MySQL version-to-package mapping
...
- 8.0 from Ubuntu archive, 8.4 from MySQL official APT repo
- 5.6/5.7 not supported for now; enforce one MySQL series per host
- Sync Go version whitelist with the playbook package map
2026-07-27 15:18:54 +08:00
Hungerdream
3c3645f8d5
feat(delivery): extend MySQL delivery parameters and tighten resource bounds
...
- Add topology/port/data_disk, DB options and 8 advanced parameters
with whitelist validation, rendered via extra_vars into the playbook
- Hybrid port allocation over pool 13306-13999
- Tighten bounds: memory 2048-65536 MiB, storage 20-2000 GiB
2026-07-27 15:16:57 +08:00
mac
a934380c9c
feat: switch base delivery to awx task logs
2026-07-23 18:36:24 +08:00
mac
f91df3be3d
fix(delivery): address review feedback on idempotency, crash recovery, and security
...
- Idempotency: verify RequestedBy matches caller to prevent cross-user key reuse
- Crash recovery: persist ExecutionJob (launching) before AWX Launch, update to running after
- Terminal state: finish ExecutionJob on success/cancel/failure; failTask accepts canceling
- Reservation TTL: filter expired reservations in quota aggregation
- Ansible heredoc: use <<'EOF' to prevent shell expansion of secrets; escape single quotes
- Validation: align Go resource ranges with playbook (mem 1024-4096, storage 10-100)
- Version whitelist: only allow 8.0, pass mysql_version to AWX extra_vars; playbook selects package via map
Relates-to: #97
2026-07-23 14:39:09 +08:00
ztkkOip
96aa493034
Merge branch 'main' into feat/mysql-service-delivery
2026-07-23 14:21:06 +08:00
mac
e11bc6f3d6
feat(delivery): implement delivery scheduler and state machine
...
Core delivery service with: task creation (idempotent, validated),
background scheduler (claimAndReserve with SELECT FOR UPDATE SKIP
LOCKED), 4-level concurrency control, resource quota enforcement,
host allocation from candidate pool, AWX job dispatch, polling,
TCP health check, instance registration, CloudDM integration
(optional), and cancel support. 11-state machine with optimistic
locking and full event audit trail.
Relates-to: #97
2026-07-23 12:04:37 +08:00
mac
81a94322f7
feat(delivery): add AWX API client
...
Implement AWXClient with Launch, GetJob, and Cancel methods for
orchestrating Ansible job templates via AWX REST API. Uses Bearer
token auth with 30s timeout. Includes unit tests with mock transport.
Relates-to: #97
2026-07-23 12:04:15 +08:00
mac
64f6bf6cea
fix(container): avoid duplicate Wayne workload rows
2026-07-22 15:20:33 +08:00
mac
d150d0f0dd
feat(business-line): auto bind Wayne namespace on create
2026-07-22 15:05:41 +08:00
mac
7f6f6fa41e
feat(container): show business line workloads from Wayne
2026-07-22 15:05:41 +08:00
mac
2db8264c8e
feat(service): add deployment task integration
2026-07-21 18:26:50 +08:00
mac
c324e2ec59
feat(auth): use Wayne native role APIs
2026-07-21 17:05:48 +08:00
mac
8d49230247
feat(server): add Wayne subsystem authorization APIs
2026-07-17 19:26:40 +08:00
mac
a10d4a5921
fix: require Wayne user ID for role binding
2026-07-17 15:47:32 +08:00
mac
d264924d1e
feat: add business line permissions and Wayne namespace mapping
2026-07-17 15:02:18 +08:00
mac
487de70250
fix(auth): populate email for local login users
2026-07-16 17:08:23 +08:00
mac
cafa8bc840
feat(auth): support local username login mode
2026-07-16 16:19:25 +08:00
mac
eb2621d914
feat(auth): complete sso subsystem integration
2026-07-16 15:52:56 +08:00
mac
6af511ed0b
refactor(server): merge authserver implementation
2026-07-15 14:05:22 +08:00
wonder
1bd5921fd4
chore: 初始化项目骨架结构
...
- 创建前端 Vue3 项目目录结构(components、views、router、stores 等)
- 创建后端 Go 项目目录结构(cmd、internal、pkg 等分层架构)
- 创建部署配置目录(docker、k8s)
- 创建文档目录
- 添加 .gitignore 忽略规则
- 添加 Makefile 构建脚本
- 更新 README.md 项目说明文档
- 每个目录添加 .gitkeep 文件说明目录用途
2026-07-14 14:34:10 +08:00