release-check

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Release 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
main
is green:
bash
gh run list --workflow=ci.yml --branch=main --limit=1 --json status,conclusion --jq '.[0]'
If
conclusion
is not
success
, report FAIL and stop.
Also check path-specific workflows if their paths changed since the last tag:
bash
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
验证
main
分支上最新的CI运行结果为绿色(成功):
bash
gh run list --workflow=ci.yml --branch=main --limit=1 --json status,conclusion --jq '.[0]'
如果
conclusion
的值不是
success
,则报告失败并停止检查。
同时检查路径特定的工作流(如果自上次标签以来这些路径有变更):
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 --locked
If any test fails, report FAIL and stop.
bash
cargo test --locked
如果任何测试失败,报告失败并停止检查。

Check 3: Clippy

检查3:Clippy检查

bash
cargo clippy -- -D warnings
If clippy reports any warnings-as-errors, report FAIL and stop.
bash
cargo clippy -- -D warnings
如果Clippy报告任何被视为错误的警告,报告失败并停止检查。

Check 4: Format Check

检查4:格式检查

bash
cargo fmt --check
If 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
fi
For 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,
    href
    attributes)
  • 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
TODO.md
and all files in
todo/
:
  • 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.md
todo/
目录下的所有文件:
  • 检查是否有项引用了已完成的工作(查找匹配的提交或已关闭的PR)
  • 检查是否有项已过期(最近的提交中没有相关活动)
报告通过警告并列出发现的问题。

Check 8: Security Exceptions

检查8:安全例外项

Read
SECURITY_EXCEPTIONS.md
and present its contents to the user.
Ask: "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
construct.yml
workflow passed (already checked in Check 1). Report PASS or SKIP.
检查自上次标签以来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)
如果有变更,验证
construct.yml
工作流是否通过(已在检查1中验证)。报告通过跳过

Output

输出

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

阻塞与非阻塞

CheckFailure behavior
CI statusBLOCK — cannot release with red CI
Local testsBLOCK — cannot release with failing tests
ClippyBLOCK — cannot release with clippy errors
FormatBLOCK — cannot release with fmt violations
Direct commitsWARN — show list, do not block
Doc linksWARN — show broken links, do not block
TODO freshnessWARN — show stale items, do not block
Security exceptionsREVIEW — ask user, block only if user says "no"
Docker buildsBLOCK if changed and CI failed; SKIP if unchanged
检查项失败行为
CI状态阻塞 — CI失败时无法发布
本地测试阻塞 — 测试失败时无法发布
Clippy检查阻塞 — Clippy报错时无法发布
格式检查阻塞 — 格式违规时无法发布
直接提交警告 — 列出提交,不阻塞
文档链接警告 — 列出失效链接,不阻塞
TODO项时效性警告 — 列出过期项,不阻塞
安全例外项需审核 — 询问用户,仅当用户回答“否”时阻塞
Docker构建若有变更且CI失败则阻塞;若无变更则跳过