Skip to content

feat(release): 统一 2.x 镜像标签通道 - #512

Merged
tbphp merged 3 commits into
v2from
tbphp/image-tag-channels
Aug 31, 2026
Merged

feat(release): 统一 2.x 镜像标签通道#512
tbphp merged 3 commits into
v2from
tbphp/image-tag-channels

Conversation

@tbphp

@tbphp tbphp commented Aug 31, 2026

Copy link
Copy Markdown
Owner

关联 Issue / Related Issue

变更内容 / Change Content

  • Bug 修复 / Bug fix
  • 新功能 / New feature
  • 其他改动 / Other changes
  • Git/GitHub 与应用版本继续使用 v2.x.y,容器 exact tag 统一移除 v 前缀。
  • 新增 2.<minor>-beta Beta 通道和唯一的 2 主通道;GA 前允许 2.0 Beta/RC 推进 2,GA 后只有稳定 2.x 可以推进。
  • 将共享 alias 更新移动到 exact 镜像、发布资产和运行时验证之后,并增加 SemVer 单调保护、双仓部分失败恢复和 latest 不变校验。
  • Render 只部署当前 2 通道对应的 exact 镜像,同时继续用带 v 的应用版本校验 /health
  • Compose、三语 README 与合同测试统一切换到 ghcr.io/tbphp/gpt-load:2

下一次 2.x tag 成功发布后,Release workflow 会建立新的无 v exact tag、Beta 通道和 2 通道;既有 v* / v2beta 镜像不删除,latest 继续留在 1.x。

自查清单 / Checklist

  • 我已运行 make check,或在说明中写明无法运行的原因和未验证范围。 / I ran make check, or documented why it could not run and what remains unverified.
  • 本 PR 范围聚焦,未包含无关改动。 / This PR is focused and contains no unrelated changes.
  • 我已更新必要的公开文档或发布说明。 / I updated any required public documentation or release notes.
  • 我已确认提交、日志和测试数据不包含敏感信息。 / I confirmed that commits, logs, and fixtures contain no sensitive data.
  • 如适用,我已说明兼容性或数据迁移影响。 / Where applicable, I documented compatibility or data-migration impact.

Summary by CodeRabbit

  • 新功能

    • 增强镜像版本与语义化版本校验,支持预发布版本识别及多架构一致性检查。
    • 发布流程新增镜像频道自动推进、跨仓库一致性验证与发布状态确认。
    • 主版本镜像频道在正式发布前后自动跟踪对应版本。
  • 文档

    • Docker 镜像默认标签更新为 2,并补充 Beta、RC、稳定版及精确版本标签说明。
    • Compose 配置同步使用新的主版本镜像标签。

Copilot AI lite review requested due to automatic review settings August 31, 2026 08:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-31T09:13:48.900870Z 7108b58 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

新增严格 SemVer 比较器和镜像版本读取脚本。新增 exact 镜像校验及 beta、major 频道推广脚本。发布工作流改为在发布校验完成后独立推广频道,并据此调整部署与 reconcile 流程。README、Compose 配置和容器契约测试改用 2 镜像标签。

Merge Risk: 🟡 Moderate · up to 7108b

This change can publish an exact image while leaving the release channel unchanged for certain invalid prerelease tags, and a partial registry failure can leave the :2 channel pointing to different releases across registries. The PR should address these release-consistency risks or obtain explicit owner acceptance before merging.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 23 functions across 5 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed 标题准确概括了本次 PR 的主要变更,即统一 2.x 镜像标签通道。标题简洁、明确,并与变更内容一致。
Description check ✅ Passed PR 描述包含关联 Issue、变更内容和完整自查清单。描述覆盖 exact tag、Beta/主通道、发布流程、Render、Compose、文档、兼容性和 latest 标签约束。关联 Issue 标注为“无”,不影响整体完整性。
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 23 functions across 5 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch tbphp/image-tag-channels

Warning

Some tools did not complete. Review the errors below.

🔧 golangci-lint (2.12.2)

Error: can't load config: the Go language version (go1.26) used to build golangci-lint is lower than the targeted Go version (1.27.0)
The command is terminated due to an error: can't load config: the Go language version (go1.26) used to build golangci-lint is lower than the targeted Go version (1.27.0)


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@tbphp tbphp self-assigned this Aug 31, 2026
@tbphp tbphp added the enhancement New feature or request label Aug 31, 2026
@tbphp tbphp added this to the v2.0.0 milestone Aug 31, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 97c3889236

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1315 to +1317
concurrency:
group: gpt-load-v2-image-channels
cancel-in-progress: false

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid lossy concurrency for channel promotions

When three or more release runs reach this job concurrently, this shared concurrency group does not queue every promotion: GitHub allows only one running and one pending job, and a newly queued job replaces the existing pending one (GitHub concurrency documentation). Because job arrival order is not guaranteed, a lower-version run can replace a pending higher-version run; after it compares against the current channel and skips or promotes, the higher verified exact release is never applied to 2/the beta channel unless manually rerun. Use a serialization mechanism that preserves all candidates, or trigger reconciliation of the highest published exact version after cancellation.

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/scripts/release-image-version.sh (1)

36-40: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

保留 jq 的错误输出,避免掩盖真实故障原因。

第 36 行抑制了 jq 的全部 stderr。因此以下三种情况会输出同一条消息并以 1 退出:标签确实不合规、jq 未安装、inspection 不是合法 JSON。在发布流水线中,这会增加定位问题的成本。

建议把 jq 的 stderr 捕获到变量,并在失败时一并打印。

♻️ 建议的修改
 semver_regex='^v?(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$'
+jq_error_file="$(mktemp)"
+trap 'rm -f "${jq_error_file}"' EXIT
 if ! version="$(
   jq -er \
     --arg semver_regex "${semver_regex}" \
@@
       end' \
-    <<<"${inspection}" 2>/dev/null
+    <<<"${inspection}" 2>"${jq_error_file}"
 )"; then
   printf 'image version labels are missing, invalid, or inconsistent for %s\n' \
     "${image}" >&2
+  printf '%s' "$(cat "${jq_error_file}")" >&2
   exit 1
 fi

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: QUIET

Plan: Pro Plus

Run ID: d9a50e4c-3ba9-4591-96a6-f37f42adf0cf

📥 Commits

Reviewing files that changed from the base of the PR and between 6b6e534 and 97c3889.

📒 Files selected for processing (10)
  • .github/scripts/release-compare-semver.py
  • .github/scripts/release-image-version.sh
  • .github/scripts/release-promote-image-channels.sh
  • .github/workflows/release.yml
  • README.md
  • README_CN.md
  • README_JP.md
  • docker-compose.yml
  • internal/webui/container_contract_test.go
  • internal/webui/workflow_test.go

Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.

Comment thread .github/workflows/release.yml Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
internal/webui/workflow_test.go (1)

1107-1112: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

拒绝带前导零的数字预发布标识。

此测试没有覆盖 v2.0.0-rc.01.github/scripts/release-image-version.sh 当前会接受该标签,但 .github/scripts/release-compare-semver.py 会拒绝它。已有频道包含此版本时,.github/scripts/release-promote-image-channels.sh 会在比较阶段失败。此时 exact 镜像可能已经发布,但频道不会推进。

请补充回归用例,并让镜像版本校验复用与比较器一致的严格 SemVer 规则。

建议增加测试用例
 		{name: "invalid semver", inspection: inspection("v2.01.0", "v2.01.0"), wantErr: true},
+		{name: "leading-zero prerelease", inspection: inspection("v2.0.0-rc.01", "v2.0.0-rc.01"), wantErr: true},
 		{name: "shell payload", inspection: inspection("$(touch pwned)", "$(touch pwned)"), wantErr: true},

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: QUIET

Plan: Pro Plus

Run ID: 71f8b945-4fc8-44ac-a2e6-0977eaa5a241

📥 Commits

Reviewing files that changed from the base of the PR and between 24cc9e4 and 7108b58.

📒 Files selected for processing (2)
  • .github/workflows/release.yml
  • internal/webui/workflow_test.go

Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review.

@tbphp
tbphp merged commit 3d14c18 into v2 Aug 31, 2026
11 checks passed
@tbphp
tbphp deleted the tbphp/image-tag-channels branch August 31, 2026 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants