You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: align project docs and console-web pre-commit (#100)
Clarify CI vs make pre-commit, service ports, and roadmap status. Standardize scripts and READMEs to English. Translate console module comments to English (no behavior change). Fix console-web lint (eslint .) and Prettier targets via npm scripts and Makefile.
Made-with: Cursor
Copy file name to clipboardExpand all lines: .github/AGENTS.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,12 +19,14 @@ Applies to `.github/` and repository pull-request operations.
19
19
20
20
## CI Alignment
21
21
22
-
When changing CI-sensitive behavior, keep local validation aligned with `.github/workflows/ci.yml`.
22
+
When changing CI-sensitive behavior, keep local validation aligned with [`Makefile`](Makefile) at the repo root.
23
23
24
-
Current `test-and-lint` gate includes:
24
+
**Local bar before push (authoritative for contributors):**`make pre-commit` — runs Rust `fmt-check`, `clippy`, `test`, plus `console-web` lint and Prettier check (see `Makefile`).
25
25
26
+
**CI workflow**[`.github/workflows/ci.yml`](workflows/ci.yml)`test-and-lint` job currently runs:
27
+
28
+
-`cargo nextest run --all --no-tests pass` and `cargo test --all --doc`
Copy file name to clipboardExpand all lines: CHANGELOG.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
## [Unreleased]
9
9
10
+
### Documentation
11
+
12
+
- Aligned [`CLAUDE.md`](CLAUDE.md) and [`ROADMAP.md`](ROADMAP.md) with current code: Tenant status conditions and StatefulSet updates on the successful reconcile path are documented as implemented; remaining work (status on early errors, integration tests, rollout extras) is listed explicitly.
13
+
- Clarified the documentation map: [`CONTRIBUTING.md`](CONTRIBUTING.md) (quality gates and CI alignment), [`docs/DEVELOPMENT.md`](docs/DEVELOPMENT.md) (environment setup), [`docs/DEVELOPMENT-NOTES.md`](docs/DEVELOPMENT-NOTES.md) (historical notes, not normative).
14
+
- Updated [`examples/README.md`](examples/README.md): Tenant Services document S3 **9000** and RustFS Console **9001**; distinguished the Operator HTTP Console (default **9090**, `cargo run -- console`) from the Tenant `{tenant}-console` Service.
15
+
- Standardized [`README.md`](README.md), [`scripts/README.md`](scripts/README.md), and shell scripts under `scripts/` to English for consistency with architecture and development docs.
16
+
- Translated Rust doc and line comments in [`src/console/`](src/console/) to English (no behavior change).
17
+
18
+
### Fixed
19
+
20
+
-**`console-web` / `make pre-commit`**: `npm run lint` now runs `eslint .` (bare `eslint` only printed CLI help). Added `format` / `format:check` scripts; [`Makefile`](Makefile)`console-fmt` and `console-fmt-check` call them so Prettier resolves from `node_modules` after `npm install` in `console-web/`.
Copy file name to clipboardExpand all lines: CLAUDE.md
+21-19Lines changed: 21 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
7
7
This is a Kubernetes operator for RustFS, written in Rust using the `kube-rs` library. The operator manages a custom resource `Tenant` (CRD) that provisions and manages RustFS storage clusters in Kubernetes.
8
8
9
9
**Current Status**: v0.1.0 (pre-release) - Early development, not yet production-ready
10
-
**Test Coverage**: 25 tests, all passing ✅
10
+
**Test Coverage**: 47 library unit tests, all passing ✅ (run `cargo test --all` for current count)
11
11
12
12
## Build and Development Commands
13
13
@@ -31,8 +31,11 @@ cargo run -- crd
31
31
# Generate CRD YAML to file
32
32
cargo run -- crd -f tenant-crd.yaml
33
33
34
-
# Run the controller (requires Kubernetes cluster access)
34
+
# Run the Kubernetes controller (requires cluster access)
35
35
cargo run -- server
36
+
37
+
# Run the operator HTTP console API (default port 9090; used by console-web)
38
+
cargo run -- console
36
39
```
37
40
38
41
### Docker
@@ -41,7 +44,7 @@ cargo run -- server
41
44
docker build -t operator .
42
45
```
43
46
44
-
Note: The Dockerfile uses a multi-stage build with Rust 1.91-alpine.
47
+
Note: The Dockerfile uses a multi-stage build (`rust:bookworm`, cargo-chef); the final image defaults to `debian:bookworm-slim`.
45
48
46
49
### Scripts (deploy / cleanup / check)
47
50
Shell scripts are under `scripts/` and grouped by purpose. Run from project root (scripts will `cd` to project root automatically):
@@ -85,7 +88,7 @@ See `docs/architecture-decisions.md` for detailed ADRs.
85
88
### Reconciliation Loop
86
89
87
90
The operator follows the standard Kubernetes controller pattern:
88
-
-**Entry Point**: `src/main.rs` - CLI with two subcommands: `crd` and `server`
-**Controller**: `src/lib.rs:run()` - Sets up the controller that watches `Tenant` resources and owned resources (ConfigMaps, Secrets, ServiceAccounts, Pods, StatefulSets)
90
93
-**Reconciliation Logic**: `src/reconcile.rs:reconcile_rustfs()` - Main reconciliation function that creates/updates Kubernetes resources for a Tenant
91
94
-**Error Handling**: `src/reconcile.rs:error_policy()` - Intelligent retry intervals based on error type:
@@ -170,8 +173,9 @@ The `Tenant` type in `src/types/v1alpha1/tenant.rs` has factory methods for crea
170
173
### Status Management
171
174
172
175
-**Status Types**: `src/types/v1alpha1/status/` - Status structures including state, pool status, and certificate status
173
-
- The status is updated via the Kubernetes status subresource
174
-
-**TODO at `reconcile.rs:92`**: Implement comprehensive status condition updates on errors (Ready, Progressing, Degraded)
176
+
- The status is updated via the Kubernetes status subresource (`Context::update_status`, with a single retry on conflict)
177
+
-**Implemented (successful reconcile path)**: Aggregates per-pool StatefulSet status, sets `Ready` / `Progressing` / `Degraded` conditions, overall `current_state`, and pool entries—see `reconcile_rustfs()` in `src/reconcile.rs`
178
+
-**Remaining (Issue #42 follow-up)**: When reconcile returns early with `Err` (e.g. credential/KMS validation, immutable field violations), status is not always updated to reflect that failure; consider setting conditions or state before returning
175
179
176
180
### Utilities
177
181
@@ -188,29 +192,29 @@ The `Tenant` type in `src/types/v1alpha1/tenant.rs` has factory methods for crea
188
192
189
193
## Code Structure Notes
190
194
191
-
- Uses `kube-rs` with specific git revisions for `k8s-openapi`and `kube` crates
195
+
- Uses `kube` and `k8s-openapi`from crates.io (see `Cargo.toml` for versions)
192
196
- Kubernetes version target: v1.30
193
197
- Error handling uses the `snafu` crate for structured error types
194
198
- All files include Apache 2.0 license headers
195
199
- Uses `strum::Display` for enum-to-string conversions (`ImagePullPolicy`, `PodManagementPolicy`, `PoolState`, `State`)
196
200
197
201
## Important Dependencies
198
202
199
-
-**kube** and **k8s-openapi**: Pinned to specific git revisions (not crates.io versions)
200
-
- TODO: Evaluate migration to crates.io versions
203
+
-**kube** / **k8s-openapi**: Versions pinned in `Cargo.toml` (crates.io)
201
204
- Uses Rust edition 2024
202
-
- Build script (`build.rs`) generates build metadata using the `built` crate
205
+
- Build script (`build.rs`) generates build metadata using the `shadow-rs` crate
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+37-50Lines changed: 37 additions & 50 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,13 @@
1
1
# RustFS Development Guide
2
2
3
+
## Documentation map
4
+
5
+
-**This file (`CONTRIBUTING.md`)** — Authoritative for **code quality**, commit workflow, formatting, and alignment with `make pre-commit` and CI. When instructions conflict, prefer this file plus [`Makefile`](Makefile) and [`.github/workflows/ci.yml`](.github/workflows/ci.yml).
6
+
7
+
-**[`docs/DEVELOPMENT.md`](docs/DEVELOPMENT.md)** — Local environment setup (Kubernetes, kind, optional tools), IDE hints, and longer workflows. It **does not** redefine the quality gates above; run `make pre-commit` as the single local bar before pushing.
8
+
9
+
-**[`docs/DEVELOPMENT-NOTES.md`](docs/DEVELOPMENT-NOTES.md)** — Historical design notes and analysis sessions (not a normative spec). For current behavior, use the source tree, [`CHANGELOG.md`](CHANGELOG.md), and [`CLAUDE.md`](CLAUDE.md).
10
+
3
11
## 📋 Code Quality Requirements
4
12
5
13
### 🔧 Code Formatting Rules
@@ -8,9 +16,9 @@
8
16
9
17
#### Pre-commit Requirements
10
18
11
-
Before every commit, you **MUST**:
19
+
Before every commit, you **MUST** pass the same checks as `make pre-commit` (see below). In practice, the steps are:
12
20
13
-
1.**Format your code**:
21
+
1.**Format your code** (or rely on `make fmt-check` to fail if not formatted):
14
22
15
23
```bash
16
24
cargo fmt --all
@@ -25,63 +33,56 @@ Before every commit, you **MUST**:
Run this command once after cloning the repository:
77
+
Optional quick compile (not a separate `make` target):
75
78
76
79
```bash
77
-
make setup-hooks
80
+
cargo check --all-targets
78
81
```
79
82
80
-
Or manually:
83
+
### 🔒 Git hooks (optional)
81
84
82
-
```bash
83
-
chmod +x .git/hooks/pre-commit
84
-
```
85
+
The repository does **not** ship a `make setup-hooks` target. To run checks automatically on `git commit`, add your own `.git/hooks/pre-commit` that invokes `make pre-commit` (or the individual commands above).
0 commit comments