refactor: tighten storage compat store_api aliases (#3582)

* refactor: collapse storage compat store_api modules

* chore: guard storage compat store_api aliases
This commit is contained in:
安正超
2026-06-18 22:50:02 +08:00
committed by GitHub
parent c28fee0013
commit 205f964dc5
10 changed files with 119 additions and 66 deletions
+62 -3
View File
@@ -1049,6 +1049,43 @@ Status values: `[ ]` not started, `[~]` in progress, `[x]` complete, `[!]` block
check, diff hygiene, risk scan, full pre-commit, and required three-expert
review passed.
- [x] `API-039` Collapse nested `store_api` compatibility modules.
- Current branch: `overtrue/arch-compat-boundary-prune`.
- Current slice: replace nested `store_api` compatibility modules in RustFS
storage, scanner, heal, Swift, S3 Select, IAM, and notify boundaries with
direct local type aliases, and add a migration rule rejecting nested
`store_api` modules in storage compatibility files.
- Acceptance: storage compatibility boundaries no longer recreate
`store_api` module shapes; downstream aliases keep the same concrete
contract types; migration rules reject restoring nested `store_api`
compatibility modules outside ECStore and test-only boundaries.
- Must preserve: object info/options reader aliases, scanner/heal/Swift/S3
Select/IAM/notify compile-time contracts, storage API compatibility names,
and ECStore-owned concrete type ownership.
- Risk defense: this is a local alias-shape cleanup only; it does not move
definitions, alter storage/runtime control flow, change object metadata
conversion, or mutate reader behavior.
- Verification: focused multi-crate compile, migration and layer guards,
formatting check, diff hygiene, risk scan, full pre-commit, and required
three-expert review passed.
- [x] `API-040` Lock remaining `store_api` compatibility aliases.
- Current branch: `overtrue/arch-compat-boundary-prune`.
- Current slice: add a migration rule that allows the remaining
`rustfs_ecstore::store_api::*` references in production storage
compatibility files only when they are explicit local type aliases to the
four ECStore-owned contracts still intentionally kept in ECStore.
- Acceptance: production compatibility boundaries can keep only explicit
aliases to `GetObjectReader`, `ObjectInfo`, `ObjectOptions`, and
`PutObjReader`; any broader import, module recreation, or new raw
`store_api` compatibility dependency fails the architecture guard.
- Must preserve: existing local alias names and concrete ECStore-owned reader,
object info, and object option contract ownership.
- Risk defense: this is a guardrail-only slice; it does not change runtime
code, storage behavior, object metadata shape, or reader behavior.
- Verification: migration and layer guards, formatting check, diff hygiene,
risk scan, full pre-commit, and required three-expert review passed.
## Phase 8 Background Controller Tasks
- [x] `BGC-001` Inventory background services.
@@ -1319,20 +1356,42 @@ Status values: `[ ]` not started, `[~]` in progress, `[x]` complete, `[!]` block
1. `pure-move`/`consumer-migration`: continue larger cleanup slices with the
loss-prevention guards active for remaining ECStore compatibility contracts
outside the source/test compatibility boundaries already cleaned.
outside the production compatibility boundaries already cleaned.
## Pre-Push Review Log
| Expert | Status | Notes |
|---|---|---|
| Quality/architecture | passed | Delete-object DTO ownership lives in storage-api; ECStore internal consumers use storage-api directly while public aliases remain, and store_api compatibility boundaries now expose explicit contract types only. |
| Migration preservation | passed | Field shape, helper semantics, delete behavior, replication scheduling, MRF delete replay, object info/options aliases, reader aliases, and old ECStore public import compatibility are preserved. |
| Quality/architecture | passed | Delete-object DTO ownership lives in storage-api; ECStore internal consumers use storage-api directly while public aliases remain, and store_api compatibility boundaries now expose only direct explicit contract aliases guarded by a whitelist. |
| Migration preservation | passed | Field shape, helper semantics, delete behavior, replication scheduling, MRF delete replay, object info/options aliases, reader aliases, and old ECStore concrete type compatibility are preserved. |
| Testing/verification | passed | Multi-crate compile, guards, formatting, diff hygiene, risk scan, and full `make pre-commit` passed. |
## Verification Notes
Passed before push:
- API-040 current slice:
- `./scripts/check_architecture_migration_rules.sh`: passed.
- `./scripts/check_layer_dependencies.sh`: passed.
- `cargo fmt --all --check`: passed.
- `git diff --check`: passed.
- Rust risk scan: passed; no new unwrap/expect, numeric casts, string error
public APIs, boxed public errors, production println/eprintln, or relaxed
ordering introduced in changed Rust files.
- `make pre-commit`: passed.
- API-039 current slice:
- `cargo check --tests -p rustfs -p rustfs-scanner -p rustfs-heal -p rustfs-protocols -p rustfs-s3select-api -p rustfs-iam -p rustfs-notify`:
passed.
- `./scripts/check_architecture_migration_rules.sh`: passed.
- `./scripts/check_layer_dependencies.sh`: passed.
- `cargo fmt --all --check`: passed.
- `git diff --check`: passed.
- Rust risk scan: passed; no new unwrap/expect, numeric casts, string error
public APIs, boxed public errors, production println/eprintln, or relaxed
ordering introduced in changed Rust files.
- `make pre-commit`: passed.
- API-038 current slice:
- `cargo check --tests -p rustfs -p rustfs-scanner -p rustfs-heal -p rustfs-protocols -p rustfs-s3select-api -p rustfs-iam -p rustfs-notify`:
passed.