refactor(storage): delete out-of-scope driver trees from _imported/ (S06 Step 14)
What
S06 Step 14 (see the storage-layer plan): wholesale removal of the inherited Container Registry driver trees and the redirect middleware that S06 lists as out of scope. After this MR _imported/ retains only what Steps 15–20 promote.
Deletion-only. Whole-directory deletions, no per-file edits. internal/storage/_imported/ remains a pure deletion-subset of the Container Registry source at the pinned commit (e835b93c9a5e5dedd666eac3110adb2554e1957f) — see verification below. _imported/ is excluded from the Go toolchain (leading underscore), so main stays green.
Removed (whole trees) — each maps to the spec's Out of Scope section
| Tree | Justification (spec Out of Scope) |
|---|---|
driver/azure/ |
Azure driver — deferred post-MVP per ADR-006. |
driver/filesystem/ |
Filesystem driver — the service is Kubernetes-only (ADR-006). |
driver/inmemory/ |
In-memory dev/test backend — MVP backends are S3 and GCS only. |
driver/testdriver/ |
In-memory test driver wrapping the inmemory backend above. |
driver/middleware/redirect/ |
Redirect middleware — S06 uses CloudFront / Cloud CDN / URL Cache, not the bare redirect. |
No separate "v1 S3" tree exists to delete. s3-aws/ holds only common/ + v2/ plus a registration shim (s3.go) that aliases the legacy V1 driver names to the v2 implementation. The shim and the v2 driver are retained.
Remaining _imported/ tree (what Steps 15–20 promote)
driver/
├── storagedriver.go, fileinfo.go, utils.go, walk.go (interface + support)
├── base/ factory/ internal/ mocks/ (shared infra)
├── s3-aws/{common,v2}/ + s3.go (trimmed S3 driver — Step 16)
├── gcs/ (trimmed GCS driver — Step 17; trim in !404)
├── testsuites/ (generic suite — Step 15)
└── middleware/{cloudfront,googlecdn,urlcache}/ (Steps 18–20)Dangling references left for the promote/adjust steps
Consistent with !393 (merged)'s documented pattern — references that incidentally point at a removed tree are left in place and rewired when the consumer is promoted. Benign because _imported/ is non-compiled:
testsuites/testsuites.gostill importsdriver/azure/{common,v2}. Step 15 (promote testsuites) strips all driver-package imports — its acceptance requires the suite to compile in isolation with no driver-package imports.middleware/googlecdntest files still referencedriver/testdriver. Step 19 (adjust Cloud CDN) rewires them onto a real/mock driver.
Verification
# pure deletion-subset of CR at the pinned commit — no additions anywhere
diff -r "$CONTAINER_REGISTRY_PATH/registry/storage/driver" \
internal/storage/_imported/driver | grep '^>' # (no output)
# the five trees are whole-directory removals (Only-in-CR)
diff -rq "$CONTAINER_REGISTRY_PATH/registry/storage/driver" \
internal/storage/_imported/driver | grep '^Only in' # azure, filesystem, inmemory, testdriver, redirect
go build ./... # passes; _imported/ excluded from the toolchainDiffstat: 19 files changed, 5453 deletions(-) — deletion-only (0 insertions).
Tests
None — Step 14 introduces no new behavior (per the plan). The pruned test files belonging to retained trees are re-activated when the drivers/suite are wired with concrete factories in the adjust steps.
Type label
type::maintenance / maintenance::refactor — deletion of out-of-scope inherited code, no shippable behavior. Consistent with sibling Steps 12 (!393 (merged)) and 13 (!404 (merged)).
Note on raw LOC
High raw line count (wholesale deletions), but per the plan's "ceiling exceeded" framing for Step 14 the per-reviewer-attention cost is ~0: each deletion is a one-line "out of scope per spec section X" verification, and the deletion-subset diff against CR is the audit trail.