-
Notifications
You must be signed in to change notification settings - Fork 417
Remove Remove method from Adapter interface and its implementations a… #9651
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove Remove method from Adapter interface and its implementations a… #9651
Conversation
|
@potapovkd please note your have some test errors (specifically the linters job which fails on code errors) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR removes the unused Remove method from the block adapter interface and all its implementations across various storage adapters (S3, GCS, Azure, Local, Memory, Transient), along with associated test code and metrics wrappers. This tech debt cleanup eliminates approximately 230 lines of dead code that was never called in production.
Key changes:
- Removed
Removemethod from theAdapterinterface - Removed all
Removeimplementations from adapters (S3, GCS, Azure, Local, Memory, Transient) - Removed metrics wrapper for the
Removemethod and thetestAdapterRemovetest function
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/block/adapter.go | Removed Remove method from the Adapter interface |
| pkg/block/s3/adapter.go | Removed S3 implementation of Remove with waiter logic |
| pkg/block/gs/adapter.go | Removed GCS implementation of Remove |
| pkg/block/azure/adapter.go | Removed Azure implementation of Remove |
| pkg/block/local/adapter.go | Removed local filesystem implementation and helper function removeEmptyDirUntil |
| pkg/block/mem/adapter.go | Removed in-memory implementation of Remove |
| pkg/block/transient/adapter.go | Removed transient implementation of Remove |
| pkg/block/metrics.go | Removed metrics wrapper for Remove method |
| pkg/block/blocktest/basic_suite.go | Removed testAdapterRemove test and unused deep import |
| pkg/block/blocktest/adapter.go | Removed testGetProperties function and sort import (issues found) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "mime" | ||
| "net/url" | ||
| "path" | ||
| "path/filepath" |
Copilot
AI
Dec 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sort import was removed, but sort.Strings(tree) is still used on line 270 in the dumpPathTree function. This will cause a compilation error.
The sort import should not be removed.
| "path/filepath" | |
| "path/filepath" | |
| "sort" |
pkg/block/blocktest/adapter.go
Outdated
| }) | ||
| } | ||
|
|
||
| func dumpPathTree(t testing.TB, ctx context.Context, adapter block.Adapter, qk block.QualifiedKey) []string { |
Copilot
AI
Dec 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The testGetProperties function is being removed here, but it's still called on line 28 in the AdapterTest function. This will cause a compilation error.
Either keep this function, or remove the call to it from line 28.
|
@N-o-Z done |
Thank you! |
zubron
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for this, @potapovkd! There's a MockAdapter implementation that also includes this method which we should remove, along with the error variable it returns. Other than that, it looks great!
It seems like we have some CI configuration issues where a necessary secret isn't being passed to forked repositories. I'll look into this with the team and make sure we get the tests running :)
|
@zubron thank you! I removed this method from the MockAdapter implementation |
zubron
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for tidying up that last bit, @potapovkd! I tested your changes in another PR and it was all good 👍
…cross various storage adapters
Closes #9614
Change Description
Remove unused
Adapter.Removemethod from the block adapter interface and all its implementations.Background
The
Removemethod in the block adapter interface was not being used anywhere in the codebase except in tests. As mentioned in issue #9614, this makes issue #6836 (which was about optimizing the S3 Remove implementation with wait/verify logic) meaningless since the method is never actually called in production code.This PR removes:
Removemethod from theAdapterinterfacetestAdapterRemoveThis simplifies the codebase and removes approximately ~230 lines of dead code, including the expensive
waiter.Waitoperation in the S3 adapter that was waiting for object deletion confirmation.Bug Fix
N/A - This is a tech debt cleanup, not a bug fix.
New Feature
N/A - This PR removes code rather than adding new features.
Testing Details
Removemethod is not called anywhere in production code using grep searchesRemovewere in test code, which has been appropriately removedBreaking Change?
Technically yes - this removes a public method from the
Adapterinterface. However, the method was not used anywhere in the actual codebase (only in tests), so there should be no practical impact on existing functionality.Impact:
Additional info
Files modified:
pkg/block/adapter.go- removed method from interfacepkg/block/s3/adapter.go- removed S3 implementationpkg/block/gs/adapter.go- removed GCS implementationpkg/block/azure/adapter.go- removed Azure implementationpkg/block/local/adapter.go- removed local filesystem implementationpkg/block/mem/adapter.go- removed in-memory implementationpkg/block/transient/adapter.go- removed transient implementationpkg/block/metrics.go- removed metrics wrapperpkg/block/blocktest/basic_suite.go- removed test and unused importContact Details
kdpotapov02@gmail.com