release-check
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRelease Check
发布检查
Pre-release validation for the jackin project. Runs a series of checks and produces a readiness report.
jackin项目的预发布验证流程。执行一系列检查并生成就绪报告。
When to Use
适用场景
- Before running
/release - When you want to verify the project is ready to release
- After fixing issues found in a previous release check
- 在运行命令之前
/release - 当你需要验证项目是否已准备好发布时
- 在修复上一次发布检查中发现的问题之后
Process
流程
Run each check in order. Collect results into a readiness report.
按顺序执行每一项检查,将结果汇总成就绪报告。
Check 1: CI Status
检查1:CI状态
Verify the latest CI run on is green:
mainbash
gh run list --workflow=ci.yml --branch=main --limit=1 --json status,conclusion --jq '.[0]'If is not , report FAIL and stop.
conclusionsuccessAlso check path-specific workflows if their paths changed since the last tag:
bash
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")验证分支上最新的CI运行结果为绿色(成功):
mainbash
gh run list --workflow=ci.yml --branch=main --limit=1 --json status,conclusion --jq '.[0]'如果的值不是,则报告失败并停止检查。
conclusionsuccess同时检查路径特定的工作流(如果自上次标签以来这些路径有变更):
bash
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")Check if docker/construct/** changed since last tag
检查自上次标签以来docker/construct/**是否有变更
if [ -n "$LAST_TAG" ] && [ -n "$(git diff --name-only "$LAST_TAG"..HEAD -- docker/construct/)" ]; then
gh run list --workflow=construct.yml --branch=main --limit=1 --json status,conclusion --jq '.[0]'
fi
if [ -n "$LAST_TAG" ] && [ -n "$(git diff --name-only "$LAST_TAG"..HEAD -- docker/construct/)" ]; then
gh run list --workflow=construct.yml --branch=main --limit=1 --json status,conclusion --jq '.[0]'
fi
Check if docs/** changed since last tag
检查自上次标签以来docs/**是否有变更
if [ -n "$LAST_TAG" ] && [ -n "$(git diff --name-only "$LAST_TAG"..HEAD -- docs/)" ]; then
gh run list --workflow=docs.yml --branch=main --limit=1 --json status,conclusion --jq '.[0]'
fi
Report result as **PASS**, **FAIL**, or **SKIP** (if no changes in those paths).if [ -n "$LAST_TAG" ] && [ -n "$(git diff --name-only "$LAST_TAG"..HEAD -- docs/)" ]; then
gh run list --workflow=docs.yml --branch=main --limit=1 --json status,conclusion --jq '.[0]'
fi
结果报告为**通过**、**失败**或**跳过**(如果这些路径没有变更)。Check 2: Local Tests
检查2:本地测试
bash
cargo test --lockedIf any test fails, report FAIL and stop.
bash
cargo test --locked如果任何测试失败,报告失败并停止检查。
Check 3: Clippy
检查3:Clippy检查
bash
cargo clippy -- -D warningsIf clippy reports any warnings-as-errors, report FAIL and stop.
bash
cargo clippy -- -D warnings如果Clippy报告任何被视为错误的警告,报告失败并停止检查。
Check 4: Format Check
检查4:格式检查
bash
cargo fmt --checkIf formatting violations found, report FAIL and stop.
bash
cargo fmt --check如果发现格式违规,报告失败并停止检查。
Check 5: Direct Commit Warning
检查5:直接提交警告
Find commits since the last tag that are not merge commits from PRs:
bash
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
if [ -n "$LAST_TAG" ]; then
git log "$LAST_TAG"..HEAD --oneline --no-merges
fiFor each commit, check if it was part of a PR:
bash
gh pr list --state merged --search "<commit-sha>" --json number --jq '.[0].number'If there are commits not associated with any PR, report WARN with the list. Do not block.
查找自上次标签以来不是来自PR合并的提交:
bash
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
if [ -n "$LAST_TAG" ]; then
git log "$LAST_TAG"..HEAD --oneline --no-merges
fi对每个提交,检查它是否属于某个PR:
bash
gh pr list --state merged --search "<commit-sha>" --json number --jq '.[0].number'如果存在未关联任何PR的提交,报告警告并列出这些提交,不阻止后续检查。
Check 6: Doc Link Validation
检查6:文档链接验证
Check for broken internal links in :
docs/content/docs/- Read markdown files and extract internal links (relative paths, attributes)
href - Verify each linked file exists
- For external URLs, verify they return HTTP 200 (skip rate-limited domains)
Report PASS or WARN with list of broken links.
检查中的内部链接是否失效:
docs/content/docs/- 读取markdown文件并提取内部链接(相对路径、属性)
href - 验证每个链接指向的文件是否存在
- 对于外部URL,验证其返回HTTP 200状态码(跳过有速率限制的域名)
报告通过或警告并列出失效链接。
Check 7: TODO Freshness
检查7:TODO项时效性
Read and all files in :
TODO.mdtodo/- Check if any items reference work that has already been completed (look for matching commits or closed PRs)
- Check if any items are stale (no related activity in recent commits)
Report PASS or WARN with findings.
读取和目录下的所有文件:
TODO.mdtodo/- 检查是否有项引用了已完成的工作(查找匹配的提交或已关闭的PR)
- 检查是否有项已过期(最近的提交中没有相关活动)
报告通过或警告并列出发现的问题。
Check 8: Security Exceptions
检查8:安全例外项
Read and present its contents to the user.
SECURITY_EXCEPTIONS.mdAsk: "Are these security exceptions still current? (yes/no)"
If the user says no, report REVIEW — the user needs to update the file before releasing.
If the user says yes, report PASS.
读取并将内容展示给用户。
SECURITY_EXCEPTIONS.md询问:“这些安全例外项是否仍然有效?(是/否)”
如果用户回答“否”,报告需审核——用户需要在发布前更新该文件。
如果用户回答“是”,报告通过。
Check 9: Docker Build Status
检查9:Docker构建状态
Check if Docker-related files changed since the last tag:
bash
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
CONSTRUCT_CHANGED=$(git diff --name-only "$LAST_TAG"..HEAD -- docker/construct/ 2>/dev/null)
RUNTIME_CHANGED=$(git diff --name-only "$LAST_TAG"..HEAD -- docker/runtime/ 2>/dev/null)If changed, verify the workflow passed (already checked in Check 1). Report PASS or SKIP.
construct.yml检查自上次标签以来Docker相关文件是否有变更:
bash
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
CONSTRUCT_CHANGED=$(git diff --name-only "$LAST_TAG"..HEAD -- docker/construct/ 2>/dev/null)
RUNTIME_CHANGED=$(git diff --name-only "$LAST_TAG"..HEAD -- docker/runtime/ 2>/dev/null)如果有变更,验证工作流是否通过(已在检查1中验证)。报告通过或跳过。
construct.ymlOutput
输出
Present a structured readiness report:
Release Readiness Report
========================
✓ CI: all workflows green
✓ Local tests: N passed, 0 failed
✓ Clippy: no warnings
✓ Format: clean
⚠ Direct commits: N commits since vX.Y.Z not from PRs
- <sha> <message>
✓ Doc links: all valid
✓ TODOs: up to date
? Security exceptions: review required (N items)
✓ Docker: builds pass (or: no changes, skipped)
Result: PASS | REVIEW NEEDED | FAIL生成结构化的就绪报告:
发布就绪报告
========================
✓ CI:所有工作流运行成功
✓ 本地测试:N项通过,0项失败
✓ Clippy:无警告
✓ 格式:符合规范
⚠ 直接提交:自vX.Y.Z以来有N项提交未来自PR
- <提交哈希> <提交信息>
✓ 文档链接:全部有效
✓ TODO项:时效性正常
? 安全例外项:需审核(共N项)
✓ Docker:构建通过(或:无变更,已跳过)
结果:通过 | 需审核 | 失败Blocking vs Non-blocking
阻塞与非阻塞
| Check | Failure behavior |
|---|---|
| CI status | BLOCK — cannot release with red CI |
| Local tests | BLOCK — cannot release with failing tests |
| Clippy | BLOCK — cannot release with clippy errors |
| Format | BLOCK — cannot release with fmt violations |
| Direct commits | WARN — show list, do not block |
| Doc links | WARN — show broken links, do not block |
| TODO freshness | WARN — show stale items, do not block |
| Security exceptions | REVIEW — ask user, block only if user says "no" |
| Docker builds | BLOCK if changed and CI failed; SKIP if unchanged |
| 检查项 | 失败行为 |
|---|---|
| CI状态 | 阻塞 — CI失败时无法发布 |
| 本地测试 | 阻塞 — 测试失败时无法发布 |
| Clippy检查 | 阻塞 — Clippy报错时无法发布 |
| 格式检查 | 阻塞 — 格式违规时无法发布 |
| 直接提交 | 警告 — 列出提交,不阻塞 |
| 文档链接 | 警告 — 列出失效链接,不阻塞 |
| TODO项时效性 | 警告 — 列出过期项,不阻塞 |
| 安全例外项 | 需审核 — 询问用户,仅当用户回答“否”时阻塞 |
| Docker构建 | 若有变更且CI失败则阻塞;若无变更则跳过 |