refactor: remove remaining compatibility bridges (#3738)

This commit is contained in:
Zhengchao An
2026-06-22 16:53:14 +08:00
committed by GitHub
parent a66350b645
commit b63b076275
37 changed files with 324 additions and 691 deletions
+87 -11
View File
@@ -5,16 +5,16 @@ Status values: `[ ]` not started, `[~]` in progress, `[x]` complete, `[!]` block
## Current Context
- Issue: [`rustfs/backlog#660`](https://github.com/rustfs/backlog/issues/660)
- Branch: `overtrue/arch-runtime-local-compat-bridges`
- Baseline: completed `C-011/C-012/C-013/API-055/API-059/API-079/API-080/API-081/API-082/API-083/API-084/API-085/API-086/API-087/API-088/API-089/API-090/API-091/API-092/API-093/API-094/API-095/API-096/API-097/API-098/API-099/API-100/API-101/API-102/API-103/API-104/API-105/API-106/API-107/API-108/API-109/API-110/API-111/API-112/API-113/API-114/API-115/API-116`.
- Based on: API-116 slice.
- Branch: `overtrue/arch-test-fuzz-compat-bridge-cleanup`
- Baseline: completed `C-011/C-012/C-013/API-055/API-059/API-079/API-080/API-081/API-082/API-083/API-084/API-085/API-086/API-087/API-088/API-089/API-090/API-091/API-092/API-093/API-094/API-095/API-096/API-097/API-098/API-099/API-100/API-101/API-102/API-103/API-104/API-105/API-106/API-107/API-108/API-109/API-110/API-111/API-112/API-113/API-114/API-115/API-116/API-117/API-118/API-119/API-120/API-121/API-122/API-123`.
- Based on: API-123 slice.
- PR type for this branch: `pure-move`
- Runtime behavior changes: none.
- Rust code changes: remove app/admin, storage core, nested, handler, capacity,
server, and S3 API secondary compatibility bridges.
- CI/script changes: guard against reintroducing the removed secondary bridge
modules or their consumer paths.
- Docs changes: record the API-117 through API-121 compatibility bridge cleanup.
- Rust code changes: remove heal/scanner test and fuzz storage compatibility
bridges, then route their consumers directly to ECStore API owner modules.
- CI/script changes: allow the migrated test/fuzz targets to import owner APIs
directly and reject reintroduced test/fuzz bridge modules.
- Docs changes: record the API-124 test/fuzz bridge cleanup.
## Phase 0 Tasks
@@ -709,6 +709,48 @@ Status values: `[ ]` not started, `[~]` in progress, `[x]` complete, `[!]` block
- Verification: RustFS compile coverage, runtime local bridge residual scan,
migration and layer guards, formatting, diff hygiene, path-only risk
review, and three-expert review.
- [x] `API-122` Remove root one-off compatibility bridges.
- Completed slice: replace config test, error mapping, runtime capability,
table catalog, and workload admission consumers with direct ECStore API
imports, then delete the root one-off bridge modules.
- Acceptance: the deleted bridge files and module declarations are gone;
migration rules reject reintroduced files, declarations, or bridge
references.
- Must preserve: config disk-layout tests, API error mapping, runtime
topology snapshots, table-catalog paths and lock behavior, and workload
admission snapshots.
- Verification: RustFS compile coverage, root one-off bridge residual scan,
migration and layer guards, formatting, diff hygiene, Rust risk scan, and
three-expert review.
- [x] `API-123` Remove startup storage compatibility bridge.
- Completed slice: replace startup storage, notification, bucket metadata,
service, shutdown, server, lifecycle, IAM, background, fs guard, and init
consumers with direct ECStore API owner imports, then delete
`startup_storage_compat.rs`.
- Acceptance: startup/init consumers no longer route through the startup
compatibility bridge; migration rules reject the deleted file, module
declaration, or bridge references.
- Must preserve: endpoint parsing, unsupported filesystem policy, ECStore
initialization, global endpoint/erasure registration, local disk and lock
client initialization, config migration/retry behavior, metadata/IAM
migration, notification startup, background replication, scanner/heal
startup and shutdown, and readiness marking.
- Verification: RustFS compile coverage, startup bridge residual scan,
migration and layer guards, formatting, diff hygiene, Rust risk scan, and
three-expert review.
- [x] `API-124` Remove test and fuzz storage compatibility bridges.
- Completed slice: replace heal tests, scanner lifecycle tests, and bucket/path
fuzz targets with direct ECStore API owner imports, then delete their local
`storage_compat.rs` modules.
- Acceptance: migrated test/fuzz targets no longer route through local
storage compatibility bridges; migration rules reject deleted files, module
declarations, or bridge references.
- Must preserve: heal endpoint indexing, heal mock storage signatures,
lifecycle metadata updates, scanner warm-tier mocks, fuzz target validation
invariants, and direct compile coverage for affected crates/targets.
- Verification: heal/scanner test compile coverage, fuzz target compile
coverage, test/fuzz bridge residual scan, migration and layer guards,
formatting, diff hygiene, Rust risk scan, and three-expert review.
- [x] `G-012` Inventory placement and repair invariants.
- Acceptance:
[`placement-repair-invariants.md`](placement-repair-invariants.md) records
@@ -3742,14 +3784,48 @@ Status values: `[ ]` not started, `[~]` in progress, `[x]` complete, `[!]` block
| Expert | Status | Notes |
|---|---|---|
| Quality/architecture | pass | API-121 removes capacity, server, and S3 API local bridge modules while keeping direct owner API calls explicit. |
| Migration preservation | pass | The extended guard rejects deleted runtime bridge files, module declarations, and local bridge consumers. |
| Testing/verification | pass | RustFS compile, runtime local bridge residual scan, migration guard, layer guard, formatting, diff hygiene, pre-commit, and path-only risk review passed. |
| Quality/architecture | pass | API-124 removes only test/fuzz bridge modules and keeps call sites on explicit ECStore owner APIs. |
| Migration preservation | pass | The migration guard now rejects the deleted test/fuzz bridge files, module declarations, and bridge consumers. |
| Testing/verification | pass | Heal/scanner test compile, fuzz target compile, residual scan, migration guard, layer guard, formatting, and diff hygiene passed. |
## Verification Notes
Passed before push:
- Issue #660 API-124 current slice:
- `cargo check --tests -p rustfs-heal -p rustfs-scanner`: passed.
- `cargo check --manifest-path fuzz/Cargo.toml --bins`: passed; transient `fuzz/Cargo.lock` refresh was restored to avoid dependency churn.
- `cargo fmt --all`: passed.
- `cargo fmt --all --check`: passed.
- `git diff --check`: passed.
- `bash -n scripts/check_architecture_migration_rules.sh`: passed.
- `./scripts/check_architecture_migration_rules.sh`: passed.
- `./scripts/check_layer_dependencies.sh`: passed.
- Test/fuzz compatibility bridge residual scan: passed.
- Rust risk scan: reviewed pre-existing test-only unwrap/expect/panic/unsafe usage; no new production risk.
- Issue #660 API-123 current slice:
- `cargo check -p rustfs --tests`: passed.
- `cargo fmt --all`: passed.
- `cargo fmt --all --check`: passed.
- `git diff --check`: passed.
- `bash -n scripts/check_architecture_migration_rules.sh`: passed.
- `./scripts/check_architecture_migration_rules.sh`: passed.
- `./scripts/check_layer_dependencies.sh`: passed.
- Startup compatibility bridge residual scan: passed.
- Rust risk scan: passed.
- Issue #660 API-122 current slice:
- `cargo check -p rustfs --tests`: passed.
- `cargo fmt --all`: passed.
- `cargo fmt --all --check`: passed.
- `git diff --check`: passed.
- `bash -n scripts/check_architecture_migration_rules.sh`: passed.
- `./scripts/check_architecture_migration_rules.sh`: passed.
- `./scripts/check_layer_dependencies.sh`: passed.
- Root one-off compatibility bridge residual scan: passed.
- Rust risk scan: passed.
- Issue #660 API-121 current slice:
- `cargo check -p rustfs --tests`: passed.
- `cargo fmt --all`: passed.