mirror of
https://github.com/rustfs/rustfs.git
synced 2026-07-26 08:18:18 +00:00
12 KiB
12 KiB
Architecture Migration Progress
Status values: [ ] not started, [~] in progress, [x] complete, [!] blocked.
Current Context
- Issue:
rustfs/backlog#660 - Branch:
overtrue/arch-config-consumer-inventory - Baseline:
upstream/mainata73c90c813bba16e668be090c5c4ca22c765b81b - PR type for this branch:
docs-only - Runtime behavior changes: none.
- Rust code changes: none.
- CI/script changes: none
- Docs changes: add the CFG-002 config model boundary ADR and link it from the architecture overview, crate-boundary guardrails, and this progress handoff.
Phase 0 Tasks
G-001Refreshmainand record baseline.- Acceptance: baseline commit, title, and branch are recorded.
- Verification:
git fetch upstream main --prune;git rev-parse upstream/main.
G-002Create migration tracking checklist.- Acceptance: this file records task state, context, verification, and handoff.
G-003Classify PR types.- Acceptance:
crate-boundaries.mdlists exactly one allowed PR type per PR.
- Acceptance:
G-004Define re-export and wrapper policy.- Acceptance: temporary compatibility code must use
RUSTFS_COMPAT_TODO.
- Acceptance: temporary compatibility code must use
G-005Add dependency direction guard.- Acceptance:
./scripts/check_layer_dependencies.shpasses on currentupstream/mainwhile still rejecting new unaccepted layer dependencies.
- Acceptance:
- [~]
G-006Create migration loss-prevention checks.- Current branch: add a mechanical admin route matrix guard from
admin-route-action-snapshot.mdandrustfs/src/admin/route_registration_test.rs. - Remaining follow-up: add checks for public re-export and storage trait coverage before pure moves.
- Current branch: add a mechanical admin route matrix guard from
G-007Create startup timeline table.- Acceptance:
startup-timeline.mdrecords current binary startup order, side effects, fatal boundaries, and readiness stages.
- Acceptance:
G-008Capture admin route-action snapshot.- Acceptance:
admin-route-action-snapshot.mdrecords current route families, handler ownership, authorization actions, public exceptions, table-catalog routes, and/minio/admincompatibility alias behavior.
- Acceptance:
G-009Enforce pre-push three-expert review.- Acceptance:
crate-boundaries.mdrequires quality/architecture, migration-preservation, and testing/verification review before push.
- Acceptance:
G-010Inventoryecstore::config::{Config, KV, KVS}consumers.- Acceptance:
ecstore-config-consumer-inventory.mdrecords the current model definitions, global accessors, persistence helpers, consumer groups, migration risks, and do-not-change contract.
- Acceptance:
TEST-PRTYPE-001Check PR type enum consistency.- Acceptance:
./scripts/check_architecture_migration_rules.shparses the allowed PR types fromcrate-boundaries.mdand fails whenARCHITECTURE.mdor architecture docs reference an unknown PR type.
- Acceptance:
COMPAT-REG-001Check temporary compatibility cleanup consistency.- Acceptance:
./scripts/check_architecture_migration_rules.shfails when a sourceRUSTFS_COMPAT_TODO(<task-id>)marker lacks a cleanup-register entry, when a register entry lacks a source marker, or when a source marker omits a removal condition.
- Acceptance:
Phase 1a Config Model Tasks
CFG-001Inventoryecstore::config::{Config, KV, KVS}consumers.- Acceptance:
ecstore-config-consumer-inventory.mdrecords the current definitions, persistence helpers, global accessors, consumer groups, migration risks, and do-not-change contract.
- Acceptance:
CFG-002Decide model boundary.- Acceptance:
config-model-boundary-adr.mdrecordsrustfs-configas the target package,server_configas the future model module, allowed dependencies, forbidden dependencies, preserved shape, and extraction verification gates.
- Acceptance:
CFG-003Move pure model definitions.- Next boundary: move only
Config,KV,KVS, and default-registration surface intorustfs-config; keep persistence helpers and global server-config state inecstore.
- Next boundary: move only
CFG-004Keep oldecstore::config::*compatibility path.- Required compatibility: source must contain
RUSTFS_COMPAT_TODO(CFG-004)and a matching cleanup-register entry.
- Required compatibility: source must contain
Phase 1 Security Governance Tasks
S-001Addcrates/security-governance.- Acceptance: the crate is a workspace member and has no dependency on
rustfs,ecstore, admin handlers, Axum, or runtime state. - Verification:
cargo check -p rustfs-security-governance.
- Acceptance: the crate is a workspace member and has no dependency on
S-002Add admin route matrix core types.- Acceptance:
AdminRouteSpec,AdminRouteAccess,AdminActionRef,PublicRouteKind,RouteRiskLevel, and validation errors model route governance metadata without registering routes or enforcing auth. - Verification:
cargo test -p rustfs-security-governance.
- Acceptance:
S-003Add redaction contract types.- Acceptance:
RedactionRule,RedactionLevel, and validation errors model sensitive field handling without logging, masking, or runtime integration. - Verification:
cargo test -p rustfs-security-governance.
- Acceptance:
S-004Add serde policy marker types.- Acceptance:
SerdePolicy,SerdePolicyKind,UnknownFieldPolicy, and validation errors model strict ingress and compatibility serde contracts without changing deserialization behavior. - Verification:
cargo test -p rustfs-security-governance.
- Acceptance:
S-005Add supply-chain policy contract types.- Acceptance:
ArtifactIntegrityPolicy,ArtifactSourceKind, and validation errors model digest, signature, and provenance requirements without changing release or CI behavior. - Verification:
cargo test -p rustfs-security-governance.
- Acceptance:
S-006Addrustfs/src/admin/route_policy.rsbacked by these contract types, without changing route registration or auth behavior.- Acceptance: direct
AdminRouteSpecentries cover routes with a single stable admin policy action, deferred inventory records routes that need richer contract support, and tests prove the combined inventory covers every registered admin route.
- Acceptance: direct
S-011Add KMS action taxonomy.- Acceptance:
KmsActioncan parse and serialize dedicated configure, service-control, clear-cache, generate-data-key, delete, rotate, list, and describe actions; wildcard matching still works. - Verification:
cargo test -p rustfs-policy action --no-fail-fast.
- Acceptance:
S-012Migrate KMS handlers to dedicated actions.- Acceptance: KMS data-key, delete/cancel-delete, cache, configure,
service-control, list, and describe handlers use dedicated
kms:*actions. - Compatibility: legacy KMS create/status admin actions are retained only as
temporary compatibility paths and registered in
compat-cleanup-register.md. - Verification: focused handler and route policy tests, migration rules,
formatting, and
make pre-commit.
- Acceptance: KMS data-key, delete/cancel-delete, cache, configure,
service-control, list, and describe handlers use dedicated
S-013Apply KMS redaction.- Acceptance: KMS Debug output and admin status response summaries contain no Vault token, AppRole secret ID, or local master key values.
- Must preserve: internal KMS config values remain available to runtime code and persisted config serialization still writes the original secret values.
- Verification: focused KMS redaction/status tests, full KMS tests, migration
guards, Rust quality scan, clippy, and
make pre-commitpassed.
Phase 2 Storage API Tasks
API-001Addcrates/storage-api.- Acceptance:
rustfs-storage-apiis a workspace member and remains a dependency-free contract crate. - Verification:
cargo check -p rustfs-storage-api.
- Acceptance:
- [~]
API-002Move public storage error/result contracts.- Current slice: add public
StorageErrorCodeandStorageResultcontracts inrustfs-storage-api, then make ECStoreStorageError::to_u32/from_u32consume the shared code table. - Deferred: keep the full ECStore
StorageErrorenum and ECStore-specific conversions inrustfs-ecstoreuntil theDiskError, filemeta, lock, andstd::io::Errordowncast boundary is proven safe. - Acceptance: storage-api contract tests pass, ECStore compatibility tests
prove numeric codes match the new contract, and
cargo check -p rustfs-storage-api -p rustfs-ecstorepasses. - Must preserve: storage error display, conversions, object error mapping,
quorum classification, and reserved code gaps
0x2B/0x2C. - Risk defense: no storage hot-path enum move in this PR; only numeric code mapping uses the new contract.
- Current slice: add public
Phase 8 Background Controller Tasks
BGC-001Inventory background services.- Acceptance:
background-services-inventory.mdrecords scanner, heal, lifecycle, replication, config reload, metrics, shutdown, cancellation, and side-effect surfaces before controller work. - Must preserve: no code behavior change and no new controller contract in this PR.
- Verification: docs-only architecture checks and diff hygiene.
- Acceptance:
BGC-002Define minimal controller contract.- Acceptance:
background-controller-contract.mddefines desired/current/status/reconcile vocabulary, status state semantics, service boundaries, and side-effect rules without starting workers or changing scheduling. - Must preserve: no Rust trait, scheduler, service registry, worker start/stop path, storage write, readiness change, peer signal, or runtime behavior change.
- Verification: docs-only architecture checks and diff hygiene.
- Acceptance:
Next PRs
- Continue
API-002only after reviewing whetherDiskErrorandstd::io::Errorconversion ownership can move without orphan-rule or downcast behavior loss. contract: move DTOs that are contract-only inAPI-003; keep ECStore implementation, KMS/SSE readers, erasure logic, and remote disk internals out of rustfs-storage-api.test-only: add focused compatibility checks before moving store traits or consumer imports.api-extraction: move only the pure server-config model into rustfs-config as CFG-003.api-extraction: keep the old rustfs_ecstore::config::* path with RUSTFS_COMPAT_TODO(CFG-004) and cleanup-register coverage.consumer-migration: migrate external consumers one group at a time only after the model path and compatibility shim are stable.
Pre-Push Review Log
| Expert | Status | Notes |
|---|---|---|
| Quality/architecture | pass | Single docs-only PR; ADR chooses existing rustfs-config, records module path and dependency boundaries, and avoids a speculative new crate. |
| Migration preservation | pass | No code movement; ADR explicitly keeps persistence helpers, global server-config state, startup order, and old-path compatibility requirements out of CFG-002. |
| Testing/verification | pass | Docs-only verification uses migration guard scripts, metrics reference guard, layer dependency guard, and whitespace checks. |
Verification Notes
Passed:
./scripts/check_architecture_migration_rules.sh./scripts/check_layer_dependencies.sh./scripts/check_metrics_migration_refs.shgit diff --checkgit diff --name-only -- '*.rs' 'Cargo.toml' 'Cargo.lock' '.github/**' 'Makefile' 'Justfile'
Notes:
- This branch changes architecture documentation only.
- No Rust source, Cargo manifest, workflow, script, or runtime configuration is changed.
make pre-commitis intentionally not required for this docs-only PR.
Handoff Notes
- Keep this CFG-002 branch as a focused
docs-onlyPR. Do not moveConfig,KV,KVS, persistence helpers, global server-config state, Storage API code, startup code, or target/notify/audit/IAM consumers in this branch. - The next extraction PR must preserve the tuple-struct shape, serde fields,
hiddenIfEmptyalias,Config::newdefault behavior, marshal/unmarshal behavior, and oldrustfs_ecstore::config::*path. - Do not add temporary compatibility code without a matching
RUSTFS_COMPAT_TODO(<task-id>)marker and cleanup-register entry. - Do not create a new config-model crate unless a later implementation attempt
proves
rustfs-configcannot hold the pure model boundary.