refactor(storage): trim _imported/ StorageDriver interface, S3 driver, and tests (S06 Step 12)

What

S06 Step 12 (see the storage-layer plan): narrow the inherited Container Registry StorageDriver interface to S06's shape and remove the corresponding methods and their tests from the S3 v2 driver and the generic driver test suite.

Deletion-only. internal/storage/_imported/ remains a pure deletion-subset of the Container Registry source at the pinned commit (e835b93c9a5e5dedd666eac3110adb2554e1957f) — see verification below. All work stays inside _imported/, which the Go toolchain excludes (leading underscore), so main stays green.

Removed (source + dedicated tests)

List, Walk, WalkParallel, DeleteFiles.

Kept — per the merged S06 interface (internal/storage/driver.go)

  • Delete — S06 retains a single-object (non-recursive) Delete. CR's recursive impl is kept verbatim here and simplified to single-object in the adjust step. Keeping it also satisfies the retained Move (which calls d.Delete).
  • Stat — the raw material the adjust step converts into S06's Exists(ctx, path) (bool, error) probe (per !376 (merged)); also used internally by copy/Move for multipart-copy sizing.

The intermediate StorageDeleter/StorageLister/StorageEnumerator interfaces are dropped; Delete is promoted to a direct method on StorageDriver.

Files

File Change
storagedriver.go drop the three sub-interfaces; Delete → direct method; Stat retained
s3-aws/v2/s3.go drop List, DeleteFiles, Walk, WalkParallel (+ walkInfoContainer/doWalk/doWalkParallel); keep Stat(+statHead/statList) and recursive Delete
testsuites/testsuites.go drop the 25 funcs dedicated to the removed surfaces
s3-aws/s3_test.go drop TestS3DriverEmptyRootList, TestWalkEmptyDir

Deliberately left for the adjust step (Step 16)

Shared/mixed code that incidentally references a removed surface is left in place — the test-side analog of the source-side base/ wrappers and copy/Move. These dangle only inside the non-compiled _imported/ and are rewired when the S3 driver and suite are promoted/adapted:

  • the base/ List/Walk wrappers,
  • the generic suite's TearDownTest cleanup probe (List),
  • two S3 tests whose primary subject is a retained surface: TestS3DriverClientTransport (transport) and TestS3DriverRetriesAndErrorHandling (Writer/Reader retries).

Follow-up

A later adjust MR (Step 16) simplifies CR's recursive Delete → S06 single-object Delete, converts StatExists (!376 (merged)), and rewires the dangling references above as the S3 driver and test suite are promoted out of _imported/.

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)
go build ./...   # passes; _imported/ excluded from the toolchain

Tests

None — Step 12 introduces no new behavior (per the plan). The trimmed suite is re-activated and run when the drivers are wired with concrete factories in the adjust steps.

Type label

type::maintenance / maintenance::refactor — interface narrowing and deletion of out-of-scope inherited code, no shippable behavior. Consistent with the sibling Track B steps.

🤖 Generated with Claude Code

Merge request reports

Loading
Loading