mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-06 05:17:42 +00:00
refactor: remove storage api facade (#3490)
This commit is contained in:
@@ -49,7 +49,6 @@ PR_TYPE_HITS_FILE="${TMP_DIR}/pr_type_hits.txt"
|
||||
SOURCE_MARKERS_FILE="${TMP_DIR}/source_markers.txt"
|
||||
SOURCE_IDS_FILE="${TMP_DIR}/source_ids.txt"
|
||||
REGISTER_IDS_FILE="${TMP_DIR}/register_ids.txt"
|
||||
STORAGE_API_SUPERTRAITS_FILE="${TMP_DIR}/storage_api_supertraits.txt"
|
||||
|
||||
awk '
|
||||
/^## PR Types$/ {
|
||||
@@ -187,30 +186,6 @@ require_source_line \
|
||||
"pub use error::{StorageErrorCode, StorageResult};" \
|
||||
"storage-api public error contract re-export"
|
||||
|
||||
perl -0ne '
|
||||
if (/pub trait StorageAPI:\s*(.*?)\s*\{\s*\}/s) {
|
||||
my $body = $1;
|
||||
while ($body =~ /\b([A-Z][A-Za-z0-9_]*)\b/g) {
|
||||
print "$1\n";
|
||||
}
|
||||
}
|
||||
' "${ROOT_DIR}/crates/ecstore/src/store_api/traits.rs" |
|
||||
sort -u >"$STORAGE_API_SUPERTRAITS_FILE"
|
||||
|
||||
if [[ ! -s "$STORAGE_API_SUPERTRAITS_FILE" ]]; then
|
||||
report_failure "StorageAPI supertrait declaration not found in crates/ecstore/src/store_api/traits.rs"
|
||||
fi
|
||||
|
||||
for required_trait in ObjectIO BucketOperations ObjectOperations ListOperations MultipartOperations HealOperations Debug; do
|
||||
if ! contains_line "$required_trait" "$STORAGE_API_SUPERTRAITS_FILE"; then
|
||||
report_failure "StorageAPI no longer covers required operation group ${required_trait}"
|
||||
fi
|
||||
done
|
||||
|
||||
if contains_line "NamespaceLocking" "$STORAGE_API_SUPERTRAITS_FILE"; then
|
||||
report_failure "NamespaceLocking must remain separate from the full StorageAPI facade"
|
||||
fi
|
||||
|
||||
require_source_contains \
|
||||
"crates/ecstore/src/store_api/traits.rs" \
|
||||
"pub trait NamespaceLocking: Send + Sync + Debug + 'static" \
|
||||
@@ -221,8 +196,8 @@ require_source_contains \
|
||||
"ECStore StorageAdminApi compile-time coverage test"
|
||||
require_source_contains \
|
||||
"crates/ecstore/tests/storage_api_compat_test.rs" \
|
||||
"fn ecstore_implements_storage_api_and_namespace_locking_contracts()" \
|
||||
"ECStore StorageAPI and NamespaceLocking compile-time coverage test"
|
||||
"fn ecstore_implements_namespace_locking_contract()" \
|
||||
"ECStore NamespaceLocking compile-time coverage test"
|
||||
|
||||
if (( FAILURES > 0 )); then
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user