Skip to content

Remove unused Factory and Inheritable interfaces from v1 storage#7755

Merged
yurishkuro merged 3 commits intomainfrom
copilot/remove-factory-interface
Dec 18, 2025
Merged

Remove unused Factory and Inheritable interfaces from v1 storage#7755
yurishkuro merged 3 commits intomainfrom
copilot/remove-factory-interface

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 18, 2025

The Factory, BaseFactory, and Inheritable interfaces in internal/storage/v1/factory.go are no longer used. All binaries have been refactored to use v2 storage, which wraps v1 concrete types directly without polymorphism.

Changes

Removed interfaces:

  • Factory - extended BaseFactory with Initialize()
  • BaseFactory - defined CreateSpanReader/Writer/DependencyReader()
  • Inheritable - defined InheritSettingsFrom(other Factory)

Updated implementations:

  • Removed interface conformance checks from badger/cassandra/elasticsearch factories
  • Removed InheritSettingsFrom() method from cassandra factory (never called)
  • Removed test for InheritSettingsFrom()
  • Regenerated mocks (Factory/BaseFactory/Inheritable mocks removed)

Retained interfaces (actively used):

  • SamplingStoreFactory, Purger, MetricStoreFactory, V1MetricStoreFactory, ArchiveCapable

Context

v2 storage wrappers call v1 factory methods directly on concrete types:

// v2/badger/factory.go
v1Factory := badger.NewFactory()
v1Factory.Config = &cfg
err := v1Factory.Initialize(metricsFactory, logger)  // Direct call, not through interface

No code accepts storage.Factory as a parameter or uses it for polymorphism.

Original prompt

is the Factory interface from internal/storage/v1/factory.go still needed? All binaries that used to call it have been either deleted or refactored to use v2 storage.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits December 18, 2025 14:39
Co-authored-by: yurishkuro <3523016+yurishkuro@users.noreply.github.com>
Co-authored-by: yurishkuro <3523016+yurishkuro@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove unnecessary Factory interface from internal/storage/v1 Remove unused Factory and Inheritable interfaces from v1 storage Dec 18, 2025
Copilot AI requested a review from yurishkuro December 18, 2025 14:59
@yurishkuro yurishkuro added the changelog:refactoring Internal code refactoring without functional changes label Dec 18, 2025
@yurishkuro yurishkuro marked this pull request as ready for review December 18, 2025 15:09
@yurishkuro yurishkuro requested a review from a team as a code owner December 18, 2025 15:09
@dosubot dosubot bot added the area/storage label Dec 18, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented Dec 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.58%. Comparing base (69bf65c) to head (84871b0).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7755      +/-   ##
==========================================
+ Coverage   95.55%   95.58%   +0.03%     
==========================================
  Files         307      307              
  Lines       15395    15392       -3     
==========================================
+ Hits        14710    14713       +3     
+ Misses        537      533       -4     
+ Partials      148      146       -2     
Flag Coverage Δ
badger_v1 9.74% <ø> (+<0.01%) ⬆️
badger_v2 2.03% <ø> (+<0.01%) ⬆️
cassandra-4.x-v1-manual 14.09% <ø> (+<0.01%) ⬆️
cassandra-4.x-v2-auto 2.02% <ø> (+<0.01%) ⬆️
cassandra-4.x-v2-manual 2.02% <ø> (+<0.01%) ⬆️
cassandra-5.x-v1-manual 14.09% <ø> (+<0.01%) ⬆️
cassandra-5.x-v2-auto 2.02% <ø> (+<0.01%) ⬆️
cassandra-5.x-v2-manual 2.02% <ø> (+<0.01%) ⬆️
clickhouse 1.95% <ø> (+<0.01%) ⬆️
elasticsearch-6.x-v1 18.60% <ø> (+<0.01%) ⬆️
elasticsearch-7.x-v1 18.64% <ø> (+<0.01%) ⬆️
elasticsearch-8.x-v1 18.80% <ø> (+<0.01%) ⬆️
elasticsearch-8.x-v2 2.12% <ø> (+0.08%) ⬆️
elasticsearch-9.x-v2 2.03% <ø> (+<0.01%) ⬆️
grpc_v1 9.61% <ø> (+<0.01%) ⬆️
grpc_v2 2.03% <ø> (+<0.01%) ⬆️
kafka-3.x-v2 2.03% <ø> (+<0.01%) ⬆️
memory_v2 2.03% <ø> (+<0.01%) ⬆️
opensearch-1.x-v1 18.68% <ø> (+<0.01%) ⬆️
opensearch-2.x-v1 18.68% <ø> (+<0.01%) ⬆️
opensearch-2.x-v2 2.03% <ø> (+<0.01%) ⬆️
opensearch-3.x-v2 2.03% <ø> (+<0.01%) ⬆️
query 2.03% <ø> (+<0.01%) ⬆️
tailsampling-processor 0.59% <ø> (+<0.01%) ⬆️
unittests 94.14% <ø> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yurishkuro yurishkuro merged commit b934656 into main Dec 18, 2025
83 of 86 checks passed
@yurishkuro yurishkuro deleted the copilot/remove-factory-interface branch December 18, 2025 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/storage changelog:refactoring Internal code refactoring without functional changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants