feat(release): 统一 2.x 镜像标签通道 - #512
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
📝 WalkthroughWalkthrough新增严格 SemVer 比较器和镜像版本读取脚本。新增 exact 镜像校验及 beta、major 频道推广脚本。发布工作流改为在发布校验完成后独立推广频道,并据此调整部署与 reconcile 流程。README、Compose 配置和容器契约测试改用 Merge Risk: 🟡 Moderate · up to 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)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation 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.)
✨ Finishing Touches✨ Simplify code
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) 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. Comment |
There was a problem hiding this comment.
💡 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".
| concurrency: | ||
| group: gpt-load-v2-image-channels | ||
| cancel-in-progress: false |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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
📒 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.ymlREADME.mdREADME_CN.mdREADME_JP.mddocker-compose.ymlinternal/webui/container_contract_test.gointernal/webui/workflow_test.go
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.
There was a problem hiding this comment.
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
📒 Files selected for processing (2)
.github/workflows/release.ymlinternal/webui/workflow_test.go
Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review.
关联 Issue / Related Issue
无
变更内容 / Change Content
v2.x.y,容器 exact tag 统一移除v前缀。2.<minor>-betaBeta 通道和唯一的2主通道;GA 前允许 2.0 Beta/RC 推进2,GA 后只有稳定 2.x 可以推进。latest不变校验。2通道对应的 exact 镜像,同时继续用带v的应用版本校验/health。ghcr.io/tbphp/gpt-load:2。下一次 2.x tag 成功发布后,Release workflow 会建立新的无
vexact tag、Beta 通道和2通道;既有v*/v2beta镜像不删除,latest继续留在 1.x。自查清单 / Checklist
make check,或在说明中写明无法运行的原因和未验证范围。 / I ranmake check, or documented why it could not run and what remains unverified.Summary by CodeRabbit
新功能
文档
2,并补充 Beta、RC、稳定版及精确版本标签说明。