226 Commits

Author SHA1 Message Date
Emdream 8b15541a15 Merge pull request #140 from Hungerdream/feat/mysql-primary-replica-delivery
CI / Prepare CI context (push) Has been cancelled
CI / Prepare Go module cache (push) Has been cancelled
CI / Backend unit tests (push) Has been cancelled
CI / Frontend typecheck and build (push) Has been cancelled
CI / Backend integration smoke test (push) Has been cancelled
feat: MySQL 交付支持一主多从(primary_replica)拓扑 (#108)
2026-07-31 21:48:47 +08:00
Hungerdream 95c3e98611 fix(server): 显式 target_hosts 时主机指向用户指定的主节点
- 显式列表校验通过后令 host = nodes[0],task.TargetHost/IP、台账、
  CloudDM 注册与凭据地址不再指向此前默认挑选的空闲主机
- 显式列表解析抽为纯函数 resolvePinnedPrimaryReplicaNodes,
  行为与原内联逻辑一致(校验失败终态/单机上限 defer 重试)
- 新增测试覆盖主节点非池首空闲节点及数量/池外/重复/占满场景
2026-07-31 18:49:34 +08:00
Hungerdream 454df86021 fix(ansible): 一主多从从库强制只读
- mysql-instance.cnf.j2 按 mysql_node_role=replica 注入 read-only/super-read-only,
  阻止业务直接写入从库导致主从数据分叉(复制线程与复制管理语句不受影响)
- 账号配置任务在从库上临时放开只读、配置完成后回锁,
  避免 cnf 只读拒绝 ALTER/CREATE USER;主库与 standalone 不受影响
2026-07-31 18:49:21 +08:00
Hungerdream 716e816a66 feat(frontend): 服务目录支持一主多从交付模式
- MySQL 新增'一主多从'模式:有序多选主机、replica_count(1-7)输入、动态拓扑预览
- precheck 校验库存主机数与选择数量,支持留空自动调度
- 交付负载携带 topology/replica_count/target_hosts,已交付主机解析 target_host_ips 列表
- 主机选择占位符退化为常量,移除冗余三元表达式
2026-07-31 18:12:25 +08:00
Hungerdream 69a12d778e feat(ansible): MySQL 交付剧本接入 GTID 异步主从复制
- mysql_expected_hosts 按 replica_count 推导预期节点数
- 主节点判定改为 mysql_primary_host 显式指定,IP 经 hostvars 回退解析
- 副本节点等待主节点端口就绪后执行 CHANGE REPLICATION SOURCE
  (defaults-extra-file 临时凭据文件 + SOURCE_AUTO_POSITION + GET_SOURCE_PUBLIC_KEY)
- 复制线程验证含 IO/SQL Running 与错误字段空值检查
  (锚点带 ^[[:space:]]* 适配 SHOW REPLICA STATUS\G 的字段名前导空格)
2026-07-31 18:12:15 +08:00
Hungerdream 0ca3af39dc feat(server): 支持 MySQL 一主多从拓扑调度与复制健康检查
- DeliveryTask/DeploymentResult 新增 target_hosts/target_host_ips 完整节点列表(主节点在前)
- 交付输入支持 replica_count(1-7)与有序 target_hosts,按节点数放大配额/预留/资源用量
- 端口占用与已占主机解析改为逗号列表,兼容存量单主机字段
- 指定主机校验池成员/重复/单机实例数,自动补齐剩余节点或延后调度
- AWX Limit 与回滚覆盖全部节点,extra_vars 下发主从主机与 IP 列表
- completeTask 全节点 TCP 探活,副本经 mysqlReplicationReady 校验复制线程状态
- awxTaskSummary 按服务类型生成摘要;go-sql-driver/mysql 提为直接依赖
2026-07-31 18:12:05 +08:00
Emdream 242326ccc5 Merge pull request #139 from qudder/codex/postgresql-delivery-sync-20260731
feat(delivery): add PostgreSQL native delivery
2026-07-31 15:59:36 +08:00
l x 363ad5f9be fix(delivery): add PostgreSQL rollback and CloudDM isolation 2026-07-31 11:16:19 +08:00
l x 66fde73792 feat(delivery): integrate PostgreSQL delivery 2026-07-31 10:30:03 +08:00
Gmarker689 048ac6507e Merge pull request #135 from Gmaker689/feat-cloud-dm-delete-instance-sync
Feat cloud dm delete instance sync
2026-07-30 18:30:23 +08:00
ztkkOip 488e5ac244 Merge pull request #134 from Hungerdream/feat/frontend-session-and-live-data
feat(frontend): 统一 401 会话处理并接入门户真实数据 (#133)
2026-07-30 18:24:55 +08:00
Hungerdream dae1bfae90 feat(frontend): polish cluster usage bars, task times and sidebar default
- cluster list: rebuild CPU usage bars with progressbar semantics, NaN/out-of-range clamping and three-tier tone colors for cluster and node tables
- task center: show task creation time next to runner with full timestamp on hover and invalid-date fallbacks
- sidebar: collapse portal group by default
2026-07-30 18:14:32 +08:00
Hungerdream b39f8c313d feat(frontend): replace mock panels with live data sources
- dashboard: load container summary, machine overview, mysql service ledger, active delivery tasks and recent task logs in parallel via Promise.allSettled so one failed source does not block the page
- tenants: back panels with real container summary and mapped Wayne namespaces per business line
- subsystem detail: render real subsystem data instead of mock profile
- components.d.ts: auto-generated ElTag registration
2026-07-30 18:14:19 +08:00
Hungerdream 90434ee39b feat(frontend): unify authenticated requests with 401 session handling
- add utils/session.ts: on 401 clear auth state and redirect to SSO or /login with return path; singleton promise prevents duplicate redirects; typed AuthenticationRequiredError for callers
- add api/authRequest.ts: shared generic authRequest with token injection, response parsing and 401 hook
- migrate businessLine/containerService/delivery/machine/subsystemAuth/taskLog api modules to the shared helper, removing six duplicated implementations; keep getToken only for EventSource query-param auth
- Catalog: silence session-expiry error in instance-name precheck; prefer mysql delivery target by exact template name (matches backend DELIVERY_MYSQL_TEMPLATE_NAME default)
2026-07-30 18:14:09 +08:00
Gmarker689 e153997bdf test(delivery): cover CloudDM datasource deletion request 2026-07-30 18:06:48 +08:00
Gmarker689 80d4f9ce60 feat(delivery): delete CloudDM datasource when instance is removed 2026-07-30 18:05:51 +08:00
ztkkOip e3055ed2f4 Merge pull request #132 from Gmaker689/fix-cloud-dm-register-cluster-version
Fix cloud dm register cluster version
2026-07-30 17:58:22 +08:00
Gmarker689 a72567a84a test(xinfra): cover clouddm register metadata 2026-07-30 17:07:06 +08:00
Gmarker689 57ba098fe3 feat(xinfra): include cluster and mysql version in register payload 2026-07-30 17:06:43 +08:00
Gmarker689 9ebdb99255 Merge pull request #131 from Gmaker689/ci/github-actions
Ci/GitHub actions
2026-07-30 16:54:34 +08:00
Gmarker689 b07e895f04 fix(server): restore Go module dependencies 2026-07-30 16:45:45 +08:00
Gmarker689 21a939175b fix(ci): avoid rewriting Go module files 2026-07-30 16:37:22 +08:00
Gmarker689 21c18f7be3 Merge branch 'main' into ci/github-actions 2026-07-30 16:29:22 +08:00
Gmarker689 40971167a6 ci: migrate to Qiniu sandbox runner 2026-07-30 16:20:03 +08:00
Emdream 67a10aa52d Merge pull request #130 from ztkkOip/feat/base-service-delivery
fix(delivery): 修改mysql部署上下游相关代码
2026-07-30 16:14:24 +08:00
mac 1aa984c7e5 feat(delivery): sync mysql service ledger and credentials 2026-07-30 16:09:13 +08:00
Gmarker689 80e91e7b43 fix(ci): scope workflow to current repository 2026-07-30 16:04:55 +08:00
ztkkOip f41abfd609 Merge pull request #129 from Hungerdream/feat/mysql-single-root-account
feat: 调整 MySQL 交付账号 (#108, #97)
2026-07-30 15:45:50 +08:00
Hungerdream 8b1ed20145 feat(frontend): drive delivery steps by backend stage events
- Map precheck/install/configure/healthcheck/register stage events to
  workbench step states instead of guess-based progression, and prefer
  callback-enabled AWX templates so stage events actually flow
- Replay task events silently on workbench restore to rebuild step
  states without duplicating logs; only reset seen events for new tasks
- Unify instance name generation with a random 6-char suffix (replacing
  the hardcoded -billing-02) and cap the business-line segment so the
  63-char DNS label limit never truncates the suffix
2026-07-30 15:02:52 +08:00
Hungerdream 07a661f7d1 fix(delivery): accept root@% credential for CloudDM registration
PR #128 looks up the root credential with account_host = 'localhost',
which never matches under the single root@% account model. Widen the
lookup to account_host IN ('%', 'localhost'), consistent with the
compatibility strategy in deploymentCredentialVars.
2026-07-29 18:40:23 +08:00
Hungerdream b3eb10a81d fix(ansible): reload systemd daemon before restarting delivery instance
Ensure updated mysql-delivery@.service unit definitions are picked up
by running daemon-reload before the instance restart in both delivery
playbooks.
2026-07-29 18:39:37 +08:00
Hungerdream 2de6a1f498 feat(frontend): adapt delivery form to single root account and credential_available
- Remove mysql_admin_password from CreateMySQLDeliveryPayload;
  the delivery form submits a single root password only
- Wire the task's credential_available boolean into the Catalog
  workbench: sync on create/poll/restore, and hide the one-time
  credential entry once it has been claimed
- Preview mock credential account_host changed from localhost to %
2026-07-29 18:39:37 +08:00
Hungerdream ef6508938c feat(delivery): switch to a single root@% admin account model
- CreateTask now accepts only mysql_root_password; drop
  mysql_admin_password and the paired root/admin validation,
  keeping the >=16-char length and alphanumeric-only checks
- deploymentCredentialVars extracts mysql_root_password only,
  remaining compatible with legacy root@localhost records
- Both delivery playbooks drop xinfra_admin provisioning and
  the mysql_admin_password assertion, creating 'root'@'%'
  as the remote admin account instead
2026-07-29 18:39:37 +08:00
Gmarker689 ad1ec79563 Merge pull request #128 from Gmaker689/feat/clouddm-auto-register
Feat/clouddm auto register
2026-07-29 18:28:35 +08:00
Gmarker689 0aac99c359 feat: register MySQL instances in CloudDM 2026-07-29 18:24:36 +08:00
Gmarker689 33449b60b2 Merge branch '1024XEngineer:main' into main 2026-07-29 18:02:01 +08:00
Emdream 221d6a6707 Merge pull request #127 from ztkkOip/feat/base-service-delivery
fix(delivery): 完善一些部署和机器管理
2026-07-29 16:54:47 +08:00
mac 35875218c9 feat(delivery): refine base service integrations 2026-07-29 16:47:41 +08:00
Gmarker689 c8ca387e04 ci: skip checks in forked repositories 2026-07-29 15:19:27 +08:00
Wonder 2ca08f9360 Merge pull request #126 from 2311719626/fix/logs
fix(server): 修复 task log 模块多个问题及数据竞争
2026-07-29 14:48:35 +08:00
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 179d80604c Merge pull request #125 from 2311719626/fix/logs
fix(server): 修复 task log 模块多个问题并添加单元测试
2026-07-29 14:38:55 +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
Gmarker689 f4a0a75ca1 Merge pull request #124 from Gmaker689/ci/github-actions
Ci/GitHub actions
2026-07-29 14:08:08 +08:00
wonder dbb930d0cb fix(frontend): 优化 task log 前端交互体验
- 简化虚拟滚动实现,移除 @tanstack/vue-virtual 依赖
- 添加分页组件,支持翻页查看历史任务
- 添加 SSE 指数退避重试机制(最多 3 次)
- 更新 API 接口支持分页参数
- 添加重试状态指示器

背景:前端存在虚拟滚动与 SSE 不兼容、缺少分页、连接断开无重试等问题

关联 commit:fix/logs 分支
2026-07-29 14:01:12 +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
Gmarker689 1f71efd8e0 Merge branch '1024XEngineer:main' into main 2026-07-29 13:56:58 +08:00
ztkkOip 699d4b6526 Merge pull request #123 from Hungerdream/feat/mysql-delivery-hardening
feat: MySQL 交付实例名唯一性与凭证领取加固 (#108, #97)
2026-07-29 13:55:09 +08:00
Gmarker689 82b0ad90ed Merge pull request #2 from Gmaker689/ci/github-actions
Ci/GitHub actions
2026-07-29 13:51:17 +08:00
Hungerdream 5715379a26 refactor(ui): embed delivery records into the service ledger
Replace the separate delivery records tab with a per-service dropdown column in the ledger table that opens the existing detail dialog with one-time credential claim. Sync now refreshes ledger, container services and delivery records together; errors surface via message toast. components.d.ts regenerated (dropdown components in, tabs out).
2026-07-29 13:50:29 +08:00