From 0f95ca49971c5cc489439906307a2a0d2289b993 Mon Sep 17 00:00:00 2001 From: k2safe Date: Sun, 20 Sep 2026 20:12:17 +0800 Subject: [PATCH] build: add repeatable local release gates --- Makefile | 5 ++++- docs/08-development-plan.md | 2 ++ docs/20-operations-runbook.md | 8 ++++++++ scripts/check-release-local.sh | 15 +++++++++++++++ 4 files changed, 29 insertions(+), 1 deletion(-) create mode 100755 scripts/check-release-local.sh diff --git a/Makefile b/Makefile index f5e0894..fc3e6f4 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ GO ?= go -.PHONY: fmt test vet build image integration mysql-replication mysql-compatibility sdk-check protocol-check docs-check schedule-backlog +.PHONY: fmt test vet build image integration mysql-replication mysql-compatibility sdk-check protocol-check docs-check schedule-backlog release-local-check fmt: $(GO) fmt ./... cd sdk/go && $(GO) fmt ./... @@ -47,6 +47,9 @@ protocol-check: docs-check: ./scripts/check-doc-links.sh +release-local-check: + ./scripts/check-release-local.sh + # Runs the bounded, intentionally incomplete persistent backlog rehearsal in an isolated MySQL. schedule-backlog: ./scripts/test-schedule-backlog.sh diff --git a/docs/08-development-plan.md b/docs/08-development-plan.md index 10781bb..458c7f9 100644 --- a/docs/08-development-plan.md +++ b/docs/08-development-plan.md @@ -8,6 +8,8 @@ 完成标准包括服务端、SDK、迁移及运行工具、Markdown 接口手册、可运行场景示例,以及实际正确性/故障/性能验证记录。完成设计、单机运行或展示一条正常路径,均不等同于完成首版交付。 +仓库内的开发回归统一入口为 `make release-local-check`,它只负责可重复的本地门禁;真实 MySQL 全量回归使用 `make integration`,目标拓扑生产验收仍按交付清单单独留证。 + ## 1.1 当前交付快照(2026-09-20) 当前不是“还剩一半代码”的状态,而是核心平台已经进入生产验收阶段。为避免把代码完成度和上线完成度混在一起,按三层记录: diff --git a/docs/20-operations-runbook.md b/docs/20-operations-runbook.md index b3cef6c..70f6bfd 100644 --- a/docs/20-operations-runbook.md +++ b/docs/20-operations-runbook.md @@ -4,6 +4,14 @@ ## 1. 发布前检查 +仓库内的可重复门禁可以一次执行: + +```sh +make release-local-check +``` + +该命令覆盖服务端/SDK/独立示例的竞态测试、静态检查、构建、当前协议门禁和文档链接检查,并验证 SDK 不依赖服务端或数据库包。它不会替代 `make integration` 的真实 MySQL 回归,也不会替代目标拓扑的容量、故障切换、RPO/RTO 和生产审批。 + 服务端不会在启动时自动修改数据库。发布人员先准备与当前版本匹配的 `orbit-migrate`、`orbit-admin` 和 `orbit`,再用迁移账户执行一次迁移;运行账户只需要服务运行所需的数据库权限。 ```sh diff --git a/scripts/check-release-local.sh b/scripts/check-release-local.sh new file mode 100755 index 0000000..317f807 --- /dev/null +++ b/scripts/check-release-local.sh @@ -0,0 +1,15 @@ +#!/bin/sh +# Run the repository-local release gates. This does not claim production HA, +# capacity, failover, RPO/RTO, or target-environment approval. +set -eu + +TASK_MAKE=${MAKE:-make} + +"$TASK_MAKE" test +"$TASK_MAKE" vet +"$TASK_MAKE" build +"$TASK_MAKE" protocol-check +"$TASK_MAKE" docs-check +"$TASK_MAKE" sdk-check + +printf '%s\n' '{"status":"local_release_gates_passed","mysql_integration":"run make integration separately","production_acceptance":"target environment evidence still required"}'