Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 9, 2025

Remove namespace concept from Cassandra options

Since v1 binaries have been deprecated, the namespace concept is no longer needed. This PR simplifies the configuration structs.

Changes Made:

  • Understand current structure and usage
  • Simplify Options struct by removing NamespaceConfig wrapper
  • Replace namespace field with explicit ArchiveEnabled field
  • Update NewOptions to not require namespace parameter
  • Update IsArchiveCapable to use ArchiveEnabled field
  • Update all callers of NewOptions in v1 tests
  • Update storageconfig to use simplified Options
  • Update v2 cassandra factory to use Configuration.Validate()
  • Update v2 cassandra tests to use simplified Options
  • Update integration test to use simplified Options
  • Run fmt and fix formatting
  • All tests passing
  • Code review completed (no issues)
  • Lint passes
  • make fmt, make lint, and make test all successful

Summary:

This PR successfully removes the deprecated namespace concept from the Cassandra storage options:

  • Removed NamespaceConfig struct that unnecessarily wrapped config.Configuration
  • Removed the unused namespace string field (was only used for distinguishing archive storage)
  • Replaced with explicit ArchiveEnabled bool field for clarity
  • Simplified NewOptions() constructor to take no parameters
  • Updated IsArchiveCapable() to simply check the ArchiveEnabled field
  • Reduced nesting and complexity in the Options struct
  • Updated all test files across v1 and v2 cassandra packages and integration tests
  • Updated storageconfig to use the simplified structure

All tests pass successfully. The changes are backward compatible as they only affect internal implementation details.

Original prompt

in internal/storage/v1/cassandra/options.go we still have the notion of the "namespace" like NamespaceConfig etc, but since v1 binaries have been deprecated I don't think there is any use for this concept anymore. Please see if we can remove it and simplify the configuration structs, reduce unnecessary nesting, and remove unnecessary functions.


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

Copilot AI changed the title [WIP] Remove namespace configuration and simplify structs Remove deprecated namespace concept from Cassandra storage options Dec 9, 2025
Copilot AI requested a review from yurishkuro December 9, 2025 15:44
@yurishkuro yurishkuro added the changelog:refactoring Internal code refactoring without functional changes label Dec 9, 2025
@yurishkuro
Copy link
Member

@copilot make sure you can run make fmt, make lint and make test successfully. Right now I am getting errors

Error: internal/storage/integration/cassandra_test.go:71:3: unknown field NamespaceConfig in struct literal of type "github.com/jaegertracing/jaeger/internal/storage/v1/cassandra".Options
Error: internal/storage/integration/cassandra_test.go:71:32: undefined: cassandrav1.NamespaceConfig

Copy link
Contributor Author

Copilot AI commented Dec 9, 2025

@copilot make sure you can run make fmt, make lint and make test successfully. Right now I am getting errors

Error: internal/storage/integration/cassandra_test.go:71:3: unknown field NamespaceC...

Fixed in commit ecf151e. Updated the integration test to use the simplified Options structure. All three commands now pass successfully:

  • make fmt
  • make lint ✅ (0 issues)
  • make test ✅ (all tests passing)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • go
    • Triggering command: /tmp/go-build656798182/b2519/services.test /tmp/go-build656798182/b2519/services.test -test.testlogfile=/tmp/go-build656798182/b2519/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true -dwarf=false -goversion go1.25.4 -c=4 -race -nolocalimports -importcfg -o g_.a ortcfg ux-amd64/pkg/tool/linux_amd64/vet -p nal/impersonate t ux-amd64/pkg/too-importcfg (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

ProcessTags: true,
Logs: true,
},
ArchiveEnabled: false,
Copy link
Member

@yurishkuro yurishkuro Dec 9, 2025

Choose a reason for hiding this comment

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

redundant, can skip

Suggested change
ArchiveEnabled: false,

ProcessTags: true,
},
SpanStoreWriteCacheTTL: time.Hour * 12,
ArchiveEnabled: false,
Copy link
Member

@yurishkuro yurishkuro Dec 9, 2025

Choose a reason for hiding this comment

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

redundant, can skip

Suggested change
ArchiveEnabled: false,

},
Configuration: config.DefaultConfiguration(),
SpanStoreWriteCacheTTL: time.Hour * 12,
ArchiveEnabled: false,
Copy link
Member

@yurishkuro yurishkuro Dec 9, 2025

Choose a reason for hiding this comment

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

redundant, can skip

Suggested change
ArchiveEnabled: false,

@codecov
Copy link

codecov bot commented Dec 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.61%. Comparing base (b728d61) to head (ecf151e).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7719      +/-   ##
==========================================
+ Coverage   95.59%   95.61%   +0.02%     
==========================================
  Files         311      311              
  Lines       15517    15511       -6     
==========================================
- Hits        14833    14831       -2     
+ Misses        535      532       -3     
+ Partials      149      148       -1     
Flag Coverage Δ
badger_v1 9.90% <0.00%> (+<0.01%) ⬆️
badger_v2 2.07% <0.00%> (+<0.01%) ⬆️
cassandra-4.x-v1-manual 14.05% <55.55%> (-0.03%) ⬇️
cassandra-4.x-v2-auto 2.06% <0.00%> (+<0.01%) ⬆️
cassandra-4.x-v2-manual 2.06% <0.00%> (+<0.01%) ⬆️
cassandra-5.x-v1-manual 14.05% <55.55%> (-0.03%) ⬇️
cassandra-5.x-v2-auto 2.06% <0.00%> (+<0.01%) ⬆️
cassandra-5.x-v2-manual 2.06% <0.00%> (+<0.01%) ⬆️
clickhouse 1.98% <0.00%> (+<0.01%) ⬆️
elasticsearch-6.x-v1 18.80% <0.00%> (+0.01%) ⬆️
elasticsearch-7.x-v1 18.83% <0.00%> (?)
elasticsearch-8.x-v1 19.00% <0.00%> (+0.01%) ⬆️
elasticsearch-8.x-v2 2.07% <0.00%> (+<0.01%) ⬆️
elasticsearch-9.x-v2 2.07% <0.00%> (?)
grpc_v1 9.69% <0.00%> (+<0.01%) ⬆️
grpc_v2 2.07% <0.00%> (+<0.01%) ⬆️
kafka-3.x-v2 2.07% <0.00%> (+<0.01%) ⬆️
memory_v2 2.07% <0.00%> (+<0.01%) ⬆️
opensearch-1.x-v1 18.88% <0.00%> (+0.01%) ⬆️
opensearch-2.x-v1 18.88% <0.00%> (+0.01%) ⬆️
opensearch-2.x-v2 2.07% <0.00%> (+<0.01%) ⬆️
opensearch-3.x-v2 2.07% <0.00%> (+<0.01%) ⬆️
query 2.07% <0.00%> (+<0.01%) ⬆️
tailsampling-processor 0.59% <0.00%> (+<0.01%) ⬆️
unittests 94.18% <100.00%> (+0.02%) ⬆️

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 marked this pull request as ready for review December 9, 2025 20:14
@yurishkuro yurishkuro requested a review from a team as a code owner December 9, 2025 20:14
@yurishkuro yurishkuro requested a review from jkowall December 9, 2025 20:14
@yurishkuro yurishkuro merged commit d843097 into main Dec 9, 2025
73 of 122 checks passed
@yurishkuro yurishkuro deleted the copilot/remove-namespace-config branch December 9, 2025 20:15
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 enhancement storage/cassandra

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants