Resolve import cycles and migrate to chorus.services module path
This comprehensive refactoring addresses critical architectural issues: IMPORT CYCLE RESOLUTION: • pkg/crypto ↔ pkg/slurp/roles: Created pkg/security/access_levels.go • pkg/ucxl → pkg/dht: Created pkg/storage/interfaces.go • pkg/slurp/leader → pkg/election → pkg/slurp/storage: Moved types to pkg/election/interfaces.go MODULE PATH MIGRATION: • Changed from github.com/anthonyrawlins/bzzz to chorus.services/bzzz • Updated all import statements across 115+ files • Maintains compatibility while removing personal GitHub account dependency TYPE SYSTEM IMPROVEMENTS: • Resolved duplicate type declarations in crypto package • Added missing type definitions (RoleStatus, TimeRestrictions, KeyStatus, KeyRotationResult) • Proper interface segregation to prevent future cycles ARCHITECTURAL BENEFITS: • Build now progresses past structural issues to normal dependency resolution • Cleaner separation of concerns between packages • Eliminates circular dependencies that prevented compilation • Establishes foundation for scalable codebase growth 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/dht"
|
||||
"chorus.services/bzzz/pkg/dht"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/dht"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
"chorus.services/bzzz/pkg/dht"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
)
|
||||
|
||||
// Phase 1 Integration Tests for BZZZ-RUSTLE Mock Implementation
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/config"
|
||||
"github.com/anthonyrawlins/bzzz/pkg/dht"
|
||||
"chorus.services/bzzz/pkg/config"
|
||||
"chorus.services/bzzz/pkg/dht"
|
||||
)
|
||||
|
||||
// Phase 2 Hybrid DHT Integration Tests
|
||||
@@ -40,7 +40,7 @@ func TestPhase2HybridDHTBasic(t *testing.T) {
|
||||
func testHybridDHTCreation(t *testing.T, ctx context.Context) {
|
||||
// Create configuration for mock-only mode
|
||||
config := &config.HybridConfig{
|
||||
DHT: config.DHTConfig{
|
||||
DHT: config.HybridDHTConfig{
|
||||
Backend: "mock",
|
||||
FallbackOnError: true,
|
||||
HealthCheckInterval: 5 * time.Second,
|
||||
@@ -75,7 +75,7 @@ func testHybridDHTCreation(t *testing.T, ctx context.Context) {
|
||||
|
||||
func testMockBackendOperations(t *testing.T, ctx context.Context) {
|
||||
config := &config.HybridConfig{
|
||||
DHT: config.DHTConfig{
|
||||
DHT: config.HybridDHTConfig{
|
||||
Backend: "mock",
|
||||
FallbackOnError: true,
|
||||
HealthCheckInterval: 5 * time.Second,
|
||||
@@ -149,7 +149,7 @@ func testMockBackendOperations(t *testing.T, ctx context.Context) {
|
||||
|
||||
func testBackendSwitching(t *testing.T, ctx context.Context) {
|
||||
config := &config.HybridConfig{
|
||||
DHT: config.DHTConfig{
|
||||
DHT: config.HybridDHTConfig{
|
||||
Backend: "mock",
|
||||
FallbackOnError: true,
|
||||
HealthCheckInterval: 5 * time.Second,
|
||||
@@ -204,7 +204,7 @@ func testBackendSwitching(t *testing.T, ctx context.Context) {
|
||||
|
||||
func testHealthMonitoring(t *testing.T, ctx context.Context) {
|
||||
config := &config.HybridConfig{
|
||||
DHT: config.DHTConfig{
|
||||
DHT: config.HybridDHTConfig{
|
||||
Backend: "mock",
|
||||
FallbackOnError: true,
|
||||
HealthCheckInterval: 1 * time.Second, // Fast for testing
|
||||
@@ -254,7 +254,7 @@ func testHealthMonitoring(t *testing.T, ctx context.Context) {
|
||||
|
||||
func testMetricsCollection(t *testing.T, ctx context.Context) {
|
||||
config := &config.HybridConfig{
|
||||
DHT: config.DHTConfig{
|
||||
DHT: config.HybridDHTConfig{
|
||||
Backend: "mock",
|
||||
FallbackOnError: true,
|
||||
HealthCheckInterval: 5 * time.Second,
|
||||
@@ -401,7 +401,7 @@ func TestPhase2ConfigurationFromEnv(t *testing.T) {
|
||||
|
||||
func TestPhase2ConcurrentOperations(t *testing.T) {
|
||||
config := &config.HybridConfig{
|
||||
DHT: config.DHTConfig{
|
||||
DHT: config.HybridDHTConfig{
|
||||
Backend: "mock",
|
||||
FallbackOnError: true,
|
||||
HealthCheckInterval: 5 * time.Second,
|
||||
|
||||
@@ -3,7 +3,7 @@ package integration
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/ucxl"
|
||||
"chorus.services/bzzz/pkg/ucxl"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user