Skip to content

Configuration overhaul final cleanup: remove global re-exports, migrate consumers to explicit versioned imports #1980

Description

@josecelano

Part of EPIC: #1978 — Configuration Overhaul (schema v3.0.0)
EPIC position: Subissue #9 of 9 — must be last. Depends on ALL other subissues being complete.
Spec: docs/issues/drafts/configuration-overhaul-final-cleanup.md

Goal

After all v3 schema changes are implemented, perform the final cleanup:

  1. Migrate all consumers from global re-exports (pub type Core = v2_0_0::core::Core) to explicit versioned imports (use torrust_tracker_configuration::v3_0_0::core::Core)
  2. Remove the global re-exports from packages/configuration/src/lib.rs
  3. Remove the crate-root packages/configuration/src/logging.rs (now duplicated inside v2_0_0/ and v3_0_0/)
  4. Apply any other cleanup discovered during the EPIC implementation

Background

The packages/configuration/src/lib.rs currently re-exports all v2 types as global aliases. These re-exports silently couple consumers to a specific schema version. When the EPIC switches the default to v3, consumers that use torrust_tracker_configuration::Core would silently get a different type — potentially breaking at compile time in confusing ways.

The decision is to remove all global re-exports and force consumers to import from explicit versioned paths. This is a breaking change appropriate for the major version bump accompanying this EPIC.

Scope

In Scope

  • Migrate all ~30 consumer files from global re-exports to explicit v3_0_0 imports
  • Remove global type aliases from packages/configuration/src/lib.rs
  • Remove crate-root packages/configuration/src/logging.rs
  • Ensure all tests pass after migration
  • Any additional cleanup items discovered during EPIC implementation

Out of Scope

  • Removing v2_0_0/ module (it stays deprecated for backward compatibility)
  • Changes to the v3 schema itself (already done in previous subissues)

Implementation Plan

ID Task Notes
T1 Migrate all consumer imports to explicit v3_0_0 paths ~30 files; see Consumer Migration Map in spec
T2 Remove global type aliases from lib.rs pub type Configuration = ... etc.
T3 Remove crate-root logging.rs Already copied into v2_0_0/ and v3_0_0/
T4 Remove pub mod logging; from lib.rs Or redirect to versioned module if needed
T5 Apply any additional cleanup discovered during EPIC Document in progress log
T6 Run linter all and full test suite

Acceptance Criteria

  • All consumer imports use explicit v3_0_0 paths (no global re-export usage remains)
  • Global type aliases removed from packages/configuration/src/lib.rs
  • Crate-root packages/configuration/src/logging.rs removed
  • All tests pass with the new import paths
  • v2_0_0 module remains available (deprecated but not removed)
  • linter all exits with code 0

Metadata

Metadata

Assignees

Type

Fields

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions