ci(engineering): Gitea Actions 门禁 + 前端测试设施 + 版本注入修复
CI / Backend (go vet + test) (push) Canceled after 0s
CI / Frontend (lint + build + test) (push) Canceled after 0s

- .gitea/workflows/ci.yml:后端 gofmt/vet/test + 前端 lint/test/build 双 job 门禁
- vitest + @testing-library + jsdom 落地,14 个命脉用例:useListQuery 乱序丢弃/卸载中止、
  http.ts 401 单飞刷新+队列重放+失败登出+silent 直拒、审计防抖、StepDeploy 部署目标、query-utils
- 版本注入断裂修复:main 补 buildTime/gitCommit 符号,build.sh/Dockerfile 注入 main.version,
  /health 返回真实版本,前端 package.json 版本对齐 2.0.0
- gofmt 清零(8 个存量未格式化文件)
This commit is contained in:
opsx committed 2026-10-29 13:02:19 +08:00
1 parent 2975452c21
commit 4f74fe6c3f
23 files changed
+1399 -77

No files matched your search

+5 -1
View File
@@ -15,6 +15,10 @@ import (
"github.com/gin-gonic/gin"
)
// Version 由 main 启动时注入(构建期 -ldflags -X main.version,再传到这里),
// 保持 /api/v1/health 与关于页版本一致
var Version = "dev"
func SetupRouter() *gin.Engine {
// 用 gin.New() 而不是 gin.Default():Default 自带文本格式的 gin.Logger(),
// 这里换成结构化 JSON 访问日志(middleware.AccessLog),便于 Promtail→Loki
@@ -55,7 +59,7 @@ func SetupRouter() *gin.Engine {
c.JSON(http.StatusOK, gin.H{
"status": "ok",
"timestamp": time.Now().Unix(),
"version": "2.0.0",
"version": Version,
})
})