Skip to content

Commit afbde49

Browse files
committed
feat: release v1.1.0 api metrics docs alignment
1 parent dd9441f commit afbde49

28 files changed

Lines changed: 1686 additions & 4780 deletions

.github/workflows/release.yml

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -228,46 +228,29 @@ jobs:
228228
- name: Generate changelog
229229
run: |
230230
VERSION="${{ needs.pre-release-validation.outputs.version }}"
231-
232-
# 获取上一个标签
231+
232+
NOTES_FILE="docs/development/release-notes-${VERSION}.md"
233+
if [ -f "$NOTES_FILE" ]; then
234+
cp "$NOTES_FILE" CHANGELOG.md
235+
exit 0
236+
fi
237+
233238
PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
234-
235-
echo "# Release Notes for $VERSION" > CHANGELOG.md
239+
240+
echo "# BatchFlow $VERSION" > CHANGELOG.md
236241
echo "" >> CHANGELOG.md
237242
echo "Release Date: $(date -u '+%Y-%m-%d %H:%M:%S UTC')" >> CHANGELOG.md
238243
echo "" >> CHANGELOG.md
239-
244+
240245
if [ -n "$PREVIOUS_TAG" ]; then
241246
echo "## Changes since $PREVIOUS_TAG" >> CHANGELOG.md
242247
echo "" >> CHANGELOG.md
243-
244-
# 生成提交日志
245248
git log --pretty=format:"- %s (%h)" $PREVIOUS_TAG..HEAD >> CHANGELOG.md
246249
else
247250
echo "## Initial Release" >> CHANGELOG.md
248251
echo "" >> CHANGELOG.md
249252
echo "This is the initial release of BatchFlow." >> CHANGELOG.md
250253
fi
251-
252-
echo "" >> CHANGELOG.md
253-
echo "## Test Results" >> CHANGELOG.md
254-
echo "- ✅ All unit tests passed" >> CHANGELOG.md
255-
echo "- ✅ MySQL integration tests passed" >> CHANGELOG.md
256-
echo "- ✅ PostgreSQL integration tests passed" >> CHANGELOG.md
257-
echo "- ✅ Redis integration tests passed" >> CHANGELOG.md
258-
echo "- ✅ Monitoring system tests passed" >> CHANGELOG.md
259-
echo "- ⚠️ SQLite tests show expected architectural limitations" >> CHANGELOG.md
260-
echo "" >> CHANGELOG.md
261-
echo "## Features" >> CHANGELOG.md
262-
echo "- 🚀 Multi-database support: MySQL, PostgreSQL, SQLite, Redis" >> CHANGELOG.md
263-
echo "- 📊 Prometheus + Grafana monitoring integration" >> CHANGELOG.md
264-
echo "- 📚 Complete documentation system in docs/ directory" >> CHANGELOG.md
265-
echo "- 🧪 Comprehensive test suite with 95%+ pass rate" >> CHANGELOG.md
266-
echo "" >> CHANGELOG.md
267-
echo "## Installation" >> CHANGELOG.md
268-
echo '```bash' >> CHANGELOG.md
269-
echo "go get github.com/rushairer/batchflow@$VERSION" >> CHANGELOG.md
270-
echo '```' >> CHANGELOG.md
271254
272255
- name: Upload changelog
273256
uses: actions/upload-artifact@v4
@@ -334,4 +317,4 @@ jobs:
334317
title: title,
335318
body: body,
336319
labels: success ? ['release', 'success'] : ['release', 'failure', 'investigation-needed']
337-
});
320+
});

Makefile

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
docker-mysql-test-with-monitoring docker-postgres-test-with-monitoring docker-sqlite-test-with-monitoring docker-redis-test-with-monitoring docker-all-tests-with-monitoring \
88
deps deps-update \
99
monitoring monitoring-foreground monitoring-stop monitoring-status monitoring-logs monitoring-cleanup \
10-
dev-setup fmt lint clean clean-all benchmark docs ci release-check docker-build docker-test quick-test full-test dev info cover
10+
dev-setup fmt lint clean clean-all benchmark docs docs-check ci release-check docker-build docker-test quick-test full-test dev info cover
1111

1212
# 默认目标
1313
help: ## 显示帮助信息
@@ -68,6 +68,7 @@ help: ## 显示帮助信息
6868
@echo "ℹ️ 其他:"
6969
@echo " \033[36mdev-setup\033[0m 设置开发环境"
7070
@echo " \033[36mdocs\033[0m 生成/预览文档"
71+
@echo " \033[36mdocs-check\033[0m 检查关键文档是否引用过期 API/指标"
7172
@echo " \033[36minfo\033[0m 显示项目信息"
7273

7374
# 构建相关
@@ -209,11 +210,14 @@ fmt: ## 格式化代码
209210

210211
lint: ## 运行代码检查
211212
@echo "🔍 运行代码检查..."
212-
@if command -v golangci-lint >/dev/null 2>&1; then \
213+
@LINTER="$$(go env GOPATH)/bin/golangci-lint"; \
214+
if [ -x "$$LINTER" ]; then \
215+
"$$LINTER" run; \
216+
elif command -v golangci-lint >/dev/null 2>&1; then \
213217
golangci-lint run; \
214218
else \
215219
echo "⚠️ golangci-lint 未安装,跳过代码检查"; \
216-
echo "💡 安装方法: go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest"; \
220+
echo "💡 安装方法: go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest"; \
217221
fi
218222

219223
# 清理相关
@@ -242,12 +246,17 @@ docs: ## 生成文档
242246
echo "💡 安装方法: go install golang.org/x/tools/cmd/godoc@latest"; \
243247
fi
244248

249+
docs-check: ## 检查关键文档与当前 API/指标契约是否一致
250+
@echo "📘 检查关键文档一致性..."
251+
@chmod +x ./scripts/check-doc-consistency.sh
252+
@./scripts/check-doc-consistency.sh
253+
245254
# CI/CD 相关
246-
ci: deps fmt lint test test-race ## CI 流程(依赖安装 + 格式化 + 代码检查 + 测试)
255+
ci: deps fmt lint docs-check test test-race ## CI 流程(依赖安装 + 格式化 + 文档检查 + 代码检查 + 测试)
247256
@echo "🚀 CI 流程完成 - 所有检查通过"
248257

249258
# 发布相关
250-
release-check: lint test ## 发布前检查
259+
release-check: docs-check lint test ## 发布前检查
251260
@echo "🔍 发布前检查..."
252261
@echo "✅ 测试通过"
253262
@echo "✅ 代码检查通过"
@@ -263,10 +272,10 @@ docker-test: ## 在 Docker 中运行测试
263272
docker run --rm -v $(PWD):/app -w /app golang:1.21 make test
264273

265274
# 快捷命令组合
266-
quick-test: fmt test ## 快速测试(格式化 + 单元测试)
275+
quick-test: fmt docs-check test ## 快速测试(格式化 + 文档检查 + 单元测试)
267276
@echo "⚡ 快速测试完成"
268277

269-
full-test: fmt test test-race test-integration ## 完整测试套件
278+
full-test: fmt docs-check test test-race test-integration ## 完整测试套件
270279
@echo "🎉 完整测试套件完成"
271280

272281
dev: monitoring test-integration-with-monitoring ## 开发模式(启动监控 + 集成测试)
@@ -283,4 +292,4 @@ info: ## 显示项目信息
283292
@echo "📊 监控地址:"
284293
@echo " Grafana: http://localhost:3000 (admin/admin)"
285294
@echo " Prometheus: http://localhost:9091"
286-
@echo " 指标端点: http://localhost:9090/metrics"
295+
@echo " 指标端点: http://localhost:9090/metrics"

0 commit comments

Comments
 (0)