refactor(storage): trim _imported/ GCS driver and tests (S06 Step 13)

What

S06 Step 13 (see the storage-layer plan): remove the methods on the GCS v2 driver that implemented the interface surface dropped by Step 12 (!393 (merged)), so the driver matches the narrowed StorageDriver interface.

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, DeleteFiles, Walk, WalkParallel.

Kept — per the merged S06 interface (internal/storage/_imported/driver/storagedriver.go, narrowed in !393 (merged))

  • Delete — S06 retains a single-object (non-recursive) Delete. CR's recursive impl is kept verbatim here (and its listAll helper, still used by Delete) and simplified to single-object in the adjust step. Keeping it also satisfies the retained Move.
  • Stat — the raw material the adjust step converts into S06's Exists(ctx, path) (bool, error) probe; also used internally by Move.

Files

File Change
gcs/gcs.go drop List, DeleteFiles, Walk, WalkParallel; keep Stat, recursive Delete (+ listAll), Move
gcs/gcs_test.go drop TestGCSDriverEmptyRootList, TestGCSDriverSubpathList (both dedicated to List)

Deliberately left for the adjust step (Step 17)

Shared/mixed code that incidentally references a removed surface is left in place — the test-side analog of the source-side retained helpers — and dangles only inside the non-compiled _imported/ until the GCS driver and suite are promoted/adapted:

  • the generic suite's TearDownTest cleanup probe (List) — already left in place by !393 (merged);
  • the now-orphaned package constants maxWalkConcurrency / maxDeleteConcurrency in gcs/common.go and any now-unused imports — untouched, mirroring !393 (merged)'s treatment of the S3 driver's orphaned listMax / sync / multierror. Unused package-level decls and imports are benign because _imported/ is excluded from the toolchain.

Note: the plan's Step 13 text mentions trimming "GCS-specific entries in testsuites/testsuites.go" and removing Stat / recursive Delete. Following the precedent actually established by Step 12 (!393 (merged)): the generic testsuites.go is driver-agnostic and was already fully trimmed there, and the merged interface retains Stat and a single-object Delete — so this MR keeps both on the GCS driver to satisfy the interface, exactly as !393 (merged) kept them on the S3 driver.

Follow-up

A later adjust MR (Step 17) promotes the GCS driver out of _imported/, simplifies recursive Delete → S06 single-object Delete, converts StatExists, prunes the now-dead constants/imports, and rewires the dangling references above.

Verification

# pure deletion-subset of CR at the pinned commit — no additions in _imported/
diff -r "$CONTAINER_REGISTRY_PATH/registry/storage/driver/gcs" \
        internal/storage/_imported/driver/gcs | grep '^>'   # (no output)
go build ./...   # passes; _imported/ excluded from the toolchain

Diffstat: 227 deletions(-), deletion-only (no added lines outside hunk headers).

Tests

None — Step 13 introduces no new behavior (per the plan). The trimmed GCS suite is re-activated and run when the driver is wired with a concrete factory in the adjust step (Step 17).

Type label

type::maintenance / maintenance::refactor — deletion of out-of-scope inherited code to match the narrowed interface, no shippable behavior. Consistent with sibling Step 12 (!393 (merged)).

🤖 Generated with Claude Code

Merge request reports

Loading
Loading