Skip to content

refactor: remove unused methods from RepositoryService and repository layer - #2105

Merged
netomi merged 1 commit into
mainfrom
cleanup/repository-layer-unused-methods
Aug 27, 2026
Merged

refactor: remove unused methods from RepositoryService and repository layer#2105
netomi merged 1 commit into
mainfrom
cleanup/repository-layer-unused-methods

Conversation

@netomi

@netomi netomi commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

What

RepositoryService had accumulated a number of public methods with no production caller - mostly superseded by later, more general query variants (e.g. findScansFiltered/countScansFiltered superseded by the *FullyFiltered versions, whose Page result already carries its own total) or left behind by earlier refactors.

Changes

  • RepositoryService.java: removes 42 unused public methods, and makes hasMemberships(Namespace, String) private since it's now only used internally by isVerified().
  • Repository layer: 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: 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.
  • Tests: 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.

The other ~27 files in org.eclipse.openvsx.repositories were checked and had no unused methods.

Testing

Full ./gradlew test run: 1048 tests, 0 failures, 0 errors.

… 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>
@netomi
netomi requested review from cstamas and gnugomez August 27, 2026 09:22
@netomi

netomi commented Aug 27, 2026

Copy link
Copy Markdown
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.

@cstamas cstamas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WOW

@netomi
netomi merged commit d057611 into main Aug 27, 2026
5 checks passed
@netomi
netomi deleted the cleanup/repository-layer-unused-methods branch August 27, 2026 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants