-
Notifications
You must be signed in to change notification settings - Fork 1
doc: 细化文档 #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
doc: 细化文档 #1
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
246fe62
doc: 细化文档
GatewayJ 95338fb
doc: Console 前端选型从 Vue 3 切换为 React 18
GatewayJ e42aa20
fix(doc): 补充 WaitingForMedia → Failed 状态转换
GatewayJ 707bbb5
fix(doc): 修复设计文档多项错误与缺失
GatewayJ 352e888
chore: 添加 pre-commit hook (fmt/clippy/check/test)
GatewayJ f80a567
refactor: 重构为多 crate workspace 架构
GatewayJ cb0da38
fix(ci): 安装 protoc 并完善 GitHub Actions workflow
GatewayJ File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,30 +1,8 @@ | ||
| # Rust | ||
| /target/ | ||
| **/*.rs.bk | ||
| *.pdb | ||
| /target | ||
| **/target | ||
| Cargo.lock | ||
|
|
||
| # IDE | ||
| .idea/ | ||
| .vscode/ | ||
| *.swp | ||
| *.swo | ||
| *~ | ||
|
|
||
| # OS | ||
| .DS_Store | ||
| Thumbs.db | ||
|
|
||
| # Config | ||
| config/config.yaml | ||
| !config/config.yaml.example | ||
|
|
||
| # Logs | ||
| .env | ||
| *.log | ||
| logs/ | ||
|
|
||
| # Cache | ||
| /var/cache/coldstore/ | ||
|
|
||
| # Test data | ||
| test_data/ | ||
| /data | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,69 +1,64 @@ | ||
| [package] | ||
| name = "coldstore" | ||
| [workspace] | ||
| resolver = "2" | ||
| members = [ | ||
| "crates/proto", | ||
| "crates/common", | ||
| "crates/metadata", | ||
| "crates/gateway", | ||
| "crates/scheduler", | ||
| "crates/cache", | ||
| "crates/tape", | ||
| ] | ||
|
|
||
| [workspace.package] | ||
| version = "0.1.0" | ||
| edition = "2021" | ||
| authors = ["Your Name <your.email@example.com>"] | ||
| description = "S3-compatible tape-based cold storage archive system" | ||
| license = "MIT OR Apache-2.0" | ||
| repository = "https://github.com/yourusername/coldstore" | ||
|
|
||
| [dependencies] | ||
| [workspace.dependencies] | ||
| # Async runtime | ||
| tokio = { version = "1.35", features = ["full"] } | ||
| tokio = { version = "1", features = ["full"] } | ||
|
|
||
| # gRPC | ||
| tonic = "0.12" | ||
| tonic-build = "0.12" | ||
| prost = "0.13" | ||
| prost-types = "0.13" | ||
|
|
||
| # HTTP server and S3 compatibility | ||
| # HTTP server (Gateway S3 layer) | ||
| axum = "0.7" | ||
| tower = "0.4" | ||
| tower-http = { version = "0.5", features = ["cors", "trace"] } | ||
| http = "1.0" | ||
| hyper = "1.0" | ||
| http = "1" | ||
| hyper = "1" | ||
|
|
||
| # Serialization | ||
| serde = { version = "1.0", features = ["derive"] } | ||
| serde_json = "1.0" | ||
| serde = { version = "1", features = ["derive"] } | ||
| serde_json = "1" | ||
| serde_yaml = "0.9" | ||
|
|
||
| # Database and metadata storage | ||
| sqlx = { version = "0.7", features = ["runtime-tokio-rustls", "postgres", "chrono", "uuid"] } | ||
| # etcd-rs = "1.0" # 暂时注释,等需要时再添加 | ||
|
|
||
| # Error handling | ||
| anyhow = "1.0" | ||
| thiserror = "1.0" | ||
| anyhow = "1" | ||
| thiserror = "2" | ||
|
|
||
| # Logging and observability | ||
| tracing = "0.1" | ||
| tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] } | ||
| tracing-appender = "0.2" | ||
|
|
||
| # Time and identity | ||
| chrono = { version = "0.4", features = ["serde"] } | ||
| uuid = { version = "1", features = ["v4", "serde"] } | ||
|
|
||
| # Configuration | ||
| config = "0.14" | ||
|
|
||
| # Time and date | ||
| chrono = { version = "0.4", features = ["serde"] } | ||
| uuid = { version = "1.6", features = ["v4", "serde"] } | ||
| # Streaming | ||
| tokio-stream = "0.1" | ||
|
|
||
| # Checksum and hashing | ||
| # Checksum | ||
| sha2 = "0.10" | ||
| crc32fast = "1.3" | ||
|
|
||
| # Cache | ||
| lru = "0.12" | ||
|
|
||
| # Tape and storage | ||
| # Note: These may need to be replaced with actual tape library bindings | ||
| # For now, we'll use placeholder dependencies | ||
|
|
||
| # Message queue and notifications | ||
| # rabbitmq-stream-client = "0.12" # Optional: for MQ integration | ||
|
|
||
| # Metrics (optional) | ||
| # prometheus = "0.13" | ||
|
|
||
| [dev-dependencies] | ||
| tokio-test = "0.4" | ||
| mockall = "0.12" | ||
|
|
||
| [[bin]] | ||
| name = "coldstore" | ||
| path = "src/main.rs" | ||
| # Internal crates | ||
| coldstore-proto = { path = "crates/proto" } | ||
| coldstore-common = { path = "crates/common" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,133 +1,60 @@ | ||
| .PHONY: build fmt clippy run clean test help | ||
| .PHONY: build fmt clippy test clean check help install-hooks lint | ||
|
|
||
| # 默认目标 | ||
| .DEFAULT_GOAL := help | ||
|
|
||
| # 项目名称 | ||
| PROJECT := coldstore | ||
|
|
||
| # 构建模式(release 或 debug) | ||
| BUILD_MODE ?= release | ||
|
|
||
| # 运行参数 | ||
| RUN_ARGS ?= | ||
|
|
||
| # 构建项目 | ||
| build: | ||
| @echo "构建项目 ($(BUILD_MODE))..." | ||
| @if [ "$(BUILD_MODE)" = "release" ]; then \ | ||
| cargo build --release; \ | ||
| else \ | ||
| cargo build; \ | ||
| fi | ||
| @echo "Building all crates ($(BUILD_MODE))..." | ||
| @if [ "$(BUILD_MODE)" = "release" ]; then cargo build --release; else cargo build; fi | ||
|
|
||
| # 快速构建(debug 模式) | ||
| build-debug: | ||
| @$(MAKE) BUILD_MODE=debug build | ||
|
|
||
| # 格式化代码 | ||
| fmt: | ||
| @echo "格式化代码..." | ||
| @cargo fmt --all | ||
| @echo "代码格式化完成" | ||
|
|
||
| # 检查代码格式 | ||
| fmt-check: | ||
| @echo "检查代码格式..." | ||
| @cargo fmt --all -- --check | ||
|
|
||
| # 运行 Clippy 代码检查 | ||
| clippy: | ||
| @echo "运行 Clippy 代码检查..." | ||
| @cargo clippy --all-targets --all-features -- -D warnings | ||
| @echo "Clippy 检查完成" | ||
|
|
||
| # 运行 Clippy(允许警告) | ||
| clippy-allow: | ||
| @echo "运行 Clippy 代码检查(允许警告)..." | ||
| @cargo clippy --all-targets --all-features | ||
|
|
||
| # 运行项目 | ||
| run: | ||
| @echo "运行项目..." | ||
| @cargo run --release -- $(RUN_ARGS) | ||
|
|
||
| # 运行项目(debug 模式) | ||
| run-debug: | ||
| @echo "运行项目(debug 模式)..." | ||
| @cargo run -- $(RUN_ARGS) | ||
|
|
||
| # 清理构建产物 | ||
| clean: | ||
| @echo "清理构建产物..." | ||
| @cargo clean | ||
| @echo "清理完成" | ||
|
|
||
| # 运行测试 | ||
| test: | ||
| @echo "运行测试..." | ||
| @cargo test --all-features | ||
| @echo "测试完成" | ||
|
|
||
| # 运行测试(显示输出) | ||
| test-verbose: | ||
| @echo "运行测试(显示输出)..." | ||
| @cargo test --all-features -- --nocapture | ||
|
|
||
| # 检查代码(不构建) | ||
| check: | ||
| @echo "检查代码..." | ||
| @cargo check --all-targets --all-features | ||
| @echo "检查完成" | ||
|
|
||
| # 完整检查(格式化 + Clippy + 测试) | ||
| check-all: fmt-check clippy test | ||
| @echo "所有检查完成" | ||
| clean: | ||
| @cargo clean | ||
|
|
||
| # 开发前检查(格式化 + Clippy) | ||
| dev-check: fmt-check clippy | ||
| @echo "开发检查完成" | ||
| run-metadata: | ||
| @cargo run -p coldstore-metadata | ||
| run-gateway: | ||
| @cargo run -p coldstore-gateway | ||
| run-scheduler: | ||
| @cargo run -p coldstore-scheduler | ||
| run-cache: | ||
| @cargo run -p coldstore-cache | ||
| run-tape: | ||
| @cargo run -p coldstore-tape | ||
|
|
||
| lint: fmt-check clippy check test | ||
| @echo "All lint checks passed." | ||
|
|
||
| install-hooks: | ||
| @cp scripts/pre-commit .git/hooks/pre-commit | ||
| @chmod +x .git/hooks/pre-commit | ||
| @echo "Pre-commit hook installed." | ||
|
|
||
| # 安装开发工具 | ||
| install-tools: | ||
| @echo "安装开发工具..." | ||
| @rustup component add rustfmt clippy | ||
| @echo "开发工具安装完成" | ||
| @echo "protobuf-compiler required: apt install protobuf-compiler" | ||
|
|
||
| # 更新依赖 | ||
| update: | ||
| @echo "更新依赖..." | ||
| @cargo update | ||
| @echo "依赖更新完成" | ||
| setup: install-tools install-hooks | ||
| @echo "Development environment ready." | ||
|
|
||
| # 显示帮助信息 | ||
| help: | ||
| @echo "ColdStore 项目 Makefile" | ||
| @echo "" | ||
| @echo "可用目标:" | ||
| @echo " build - 构建项目(release 模式)" | ||
| @echo " build-debug - 构建项目(debug 模式)" | ||
| @echo " fmt - 格式化代码" | ||
| @echo " fmt-check - 检查代码格式" | ||
| @echo " clippy - 运行 Clippy 代码检查(严格模式)" | ||
| @echo " clippy-allow - 运行 Clippy 代码检查(允许警告)" | ||
| @echo " run - 运行项目(release 模式)" | ||
| @echo " run-debug - 运行项目(debug 模式)" | ||
| @echo " clean - 清理构建产物" | ||
| @echo " test - 运行测试" | ||
| @echo " test-verbose - 运行测试(显示输出)" | ||
| @echo " check - 检查代码(不构建)" | ||
| @echo " check-all - 完整检查(格式化 + Clippy + 测试)" | ||
| @echo " dev-check - 开发前检查(格式化 + Clippy)" | ||
| @echo " install-tools - 安装开发工具(rustfmt, clippy)" | ||
| @echo " update - 更新依赖" | ||
| @echo " help - 显示此帮助信息" | ||
| @echo "ColdStore Workspace Makefile" | ||
| @echo "" | ||
| @echo "示例:" | ||
| @echo " make build # 构建 release 版本" | ||
| @echo " make build-debug # 构建 debug 版本" | ||
| @echo " make fmt # 格式化代码" | ||
| @echo " make clippy # 运行 Clippy 检查" | ||
| @echo " make run # 运行项目" | ||
| @echo " make run RUN_ARGS='--help' # 带参数运行" | ||
| @echo " make check-all # 运行所有检查" | ||
| @echo "Build: build build-debug clean" | ||
| @echo "Quality: fmt fmt-check clippy test check check-all lint" | ||
| @echo "Run: run-metadata run-gateway run-scheduler run-cache run-tape" | ||
| @echo "Setup: setup install-tools install-hooks" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gitignore drops common IDE and OS file patterns
Low Severity
The rewrite of
.gitignoreremoved entries for.DS_Store,Thumbs.db,.idea/,.vscode/,*~,*.rs.bk, and*.pdb. These common IDE configuration directories and OS-generated files are no longer ignored, risking accidental commits of developer-local artifacts into the repository.