fix(version): 补全开发快照记录与同步交付闭环
build / build (push) Successful in 1m3s

收录 main、注释开发快照和完整运行 SHA;开发说明绑定原提交,补记 0.1.1–0.1.25。
进行中同步按仓库合并,完成后重新执行;启动入队,部署脚本读回版本证据。
开发快照独立于正式标签与 Release,既有冲突标签不移动。

已运行:整仓 make verify,Go 673 通过、前端 274 通过,92 个已声明可选跳过,必需跳过 0。
隔离 PostgreSQL 重复同步队列用例及 -race 通过;未更新现有 8088、未修改生产问答。
This commit is contained in:
姚章浩
2026-10-18 18:11:49 +08:00
parent 90901a4458
commit 013ce4a24e
19 changed files with 860 additions and 32 deletions
+10 -1
View File
@@ -188,6 +188,12 @@ var errGiteaNotFound = newGiteaError(KindNotFound, http.StatusNotFound, "版本
// ListCommits 读一页提交;同时返回 X-Total-Count(用于完整性对账,不做假 total)。
func (c *GiteaClient) ListCommits(ctx context.Context, page, limit int) ([]RawCommit, int, error) {
return c.ListCommitsAtRef(ctx, "main", page, limit)
}
func (c *GiteaClient) ListCommitsAtRef(ctx context.Context, ref string, page, limit int) ([]RawCommit, int, error) {
if ref != "main" && !fullSHA.MatchString(ref) {
return nil, 0, newGiteaError(KindParse, 0, "版本记录:只接受 main 或完整提交 SHA", nil)
}
if limit <= 0 || limit > giteaDefaultPageSize {
limit = giteaDefaultPageSize
}
@@ -196,6 +202,7 @@ func (c *GiteaClient) ListCommits(ctx context.Context, page, limit int) ([]RawCo
query.Set("page", fmt.Sprintf("%d", page))
query.Set("stat", "false")
query.Set("verification", "false")
query.Set("sha", ref)
body, header, err := c.get(ctx, c.apiURL("/commits", query))
if err != nil {
return nil, 0, err
@@ -322,7 +329,8 @@ func (c *GiteaClient) ListTags(ctx context.Context) ([]RawTag, error) {
return nil, err
}
var annotated struct {
Object struct {
Message string `json:"message"`
Object struct {
SHA string `json:"sha"`
} `json:"object"`
}
@@ -333,6 +341,7 @@ func (c *GiteaClient) ListTags(ctx context.Context) ([]RawTag, error) {
continue
}
tag.TargetSHA = annotated.Object.SHA
tag.Message = annotated.Message
}
tags = append(tags, tag)
}