refactor: remove unused methods from RepositoryService and repository layer - #2105
Merged
Conversation
… layer RepositoryService had accumulated public methods with no production caller, mostly superseded by later, more general query variants (e.g. findScansFiltered/ countScansFiltered superseded by the *FullyFiltered versions, which already carry their own totals via Page) or left behind by earlier refactors. Removes 42 such methods, and makes hasMemberships(Namespace, String) private since it's now only used internally by isVerified(). Removing those delegates orphaned the underlying derived-query methods they called on the lower-level *Repository interfaces/classes in the same package. Removes 51 more unused methods across AdminScanDecisionRepository, ExtensionJooqRepository, ExtensionScanRepository, ExtensionThreatRepository, ExtensionValidationFailureRepository, ExtensionVersionJooqRepository, ExtensionVersionRepository, FileDecisionRepository, MigrationItemRepository, ScanCheckResultRepository, ScannerJobRepository and UserDataRepository, plus their now-unused imports. MigrationItemJooqRepository is deleted outright: its one method was dead, and removing it left an empty class with no other purpose - migration item discovery already goes through the generic findNotMigratedItems() path. Test-side: trims the corresponding entries out of RepositoryServiceSmokeTest's exhaustive per-method coverage list, and drops two stale Mockito stubs in ScanAPITest/AdminAPITest for methods that no longer exist. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
Author
|
This PR removes any unused method in the RepositoryService and related Repository classes. Over the time various stuff has been added that is not needed anymore or never has been used. To keep things clean and easier to understand, remove everything this is currently not used. Edit: most of the unused method are from the scan infrastructure, where no cleanup was ever done and the unused methods are mainly from some refactoring during the implementation of the feature in the first place. |
gnugomez
approved these changes
Aug 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
RepositoryServicehad accumulated a number of public methods with no production caller - mostly superseded by later, more general query variants (e.g.findScansFiltered/countScansFilteredsuperseded by the*FullyFilteredversions, whosePageresult already carries its own total) or left behind by earlier refactors.Changes
RepositoryService.java: removes 42 unused public methods, and makeshasMemberships(Namespace, String)private since it's now only used internally byisVerified().*Repositoryinterfaces/classes in the same package. Removes 51 more unused methods acrossAdminScanDecisionRepository,ExtensionJooqRepository,ExtensionScanRepository,ExtensionThreatRepository,ExtensionValidationFailureRepository,ExtensionVersionJooqRepository,ExtensionVersionRepository,FileDecisionRepository,MigrationItemRepository,ScanCheckResultRepository,ScannerJobRepository, andUserDataRepository, plus their now-unused imports.MigrationItemJooqRepository: deleted outright - its one method was dead, and removing it left an empty class with no other purpose. Migration item discovery already goes through the genericfindNotMigratedItems()path.RepositoryServiceSmokeTest's exhaustive per-method coverage list, and drops two stale Mockito stubs inScanAPITest/AdminAPITestfor methods that no longer exist.The other ~27 files in
org.eclipse.openvsx.repositorieswere checked and had no unused methods.Testing
Full
./gradlew testrun: 1048 tests, 0 failures, 0 errors.