feat(configuration): copy v2_0_0 schema to v3_0_0 as baseline (#1979)#1999
Merged
josecelano merged 3 commits intoJul 20, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR establishes the configuration schema v3.0.0 baseline by copying the existing v2.0.0 schema into a new v3_0_0 module, updating internal references to point at v3, and making versioned modules more self-contained (notably around logging) while keeping global re-exports on v2 until the final migration subissue.
Changes:
- Introduces
packages/configuration/src/v3_0_0/as a v2-derived baseline and exposes it viapub mod v3_0_0. - Adds
Metadata::with_schema_versionand av3_0_0::Configurationdefault that pinsschema_version = "3.0.0", plus smoke tests for version acceptance/rejection. - Duplicates crate-root logging setup into both
v2_0_0::loggingandv3_0_0::loggingfor versioned self-containment.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/configuration/src/v3_0_0/udp_tracker.rs | Adds v3 UDP tracker config struct + defaults. |
| packages/configuration/src/v3_0_0/tracker_api.rs | Adds v3 HTTP API config (access tokens, TLS config placeholder) + tests. |
| packages/configuration/src/v3_0_0/network.rs | Adds v3 network config + validated ExternalIp type. |
| packages/configuration/src/v3_0_0/mod.rs | Adds v3 root configuration module, loader, defaults, and smoke tests. |
| packages/configuration/src/v3_0_0/logging.rs | Adds v3 logging config and initialization helpers. |
| packages/configuration/src/v3_0_0/http_tracker.rs | Adds v3 HTTP tracker config struct + defaults. |
| packages/configuration/src/v3_0_0/health_check_api.rs | Adds v3 health check API bind config + defaults. |
| packages/configuration/src/v3_0_0/database.rs | Adds v3 DB config + secret-masking helpers/tests. |
| packages/configuration/src/v3_0_0/core.rs | Adds v3 core config wiring (announce policy, DB, net, etc.). |
| packages/configuration/src/v2_0_0/logging.rs | Makes v2 logging module self-contained by embedding setup helpers. |
| packages/configuration/src/logging.rs | Points crate-root logging setup at v2 logging types. |
| packages/configuration/src/lib.rs | Exposes v3_0_0 module and adds Metadata::with_schema_version. |
| docs/issues/open/1979-1978-copy-configuration-schema-v2-to-v3-baseline.md | Updates spec progress, marks deferred items, and records verification. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…t#1979) Subissue #1 of EPIC torrust#1978 — Configuration Overhaul (schema v3.0.0). - Copy `packages/configuration/src/v2_0_0/` to `v3_0_0/` as the starting point for all breaking changes - Update all internal `v2_0_0` references in `v3_0_0/` to `v3_0_0` (doc links, VERSION constant, test imports, schema_version strings) - Merge the crate-root `logging.rs` behaviour (TraceStyle, setup, tracing_init) into both `v2_0_0/logging.rs` and `v3_0_0/logging.rs`, making each versioned module fully self-contained - Add `pub mod v3_0_0` to `lib.rs` alongside `pub mod v2_0_0` - Add `Metadata::with_schema_version` helper constructor to `lib.rs` - Add `v3_0_0::Configuration::Default` impl that sets schema version to "3.0.0" explicitly - Add smoke tests: v3 loads "3.0.0" configs and rejects "2.0.0" configs - Global re-exports and default config files stay at v2 until the final cleanup subissue torrust#1980 switches all consumers atomically T6 (update default config files) and T7 (wire bootstrap to v3) are deferred to torrust#1980: the bootstrap uses the global `Configuration` re-export (= v2_0_0) and cannot be switched without migrating all consumers at once. All 48 test suites pass; `linter all` exits 0. Closes torrust#1979
josecelano
force-pushed
the
config-copy-v2-to-v3-baseline
branch
from
July 20, 2026 09:44
95d93fe to
cd786f1
Compare
- Fix "Weather" → "Whether" typo in doc comments for `tracker_usage_statistics` field in v2_0_0 and v3_0_0 (udp_tracker.rs, http_tracker.rs, core.rs) - Fix v3_0_0/mod.rs module doc: "Version `1`" → "Version `3`" - Fix v3_0_0/mod.rs TSL section: replace reference to non-existent `ssl_enabled` flag with accurate description of `tsl_config` section - Fix v3_0_0/tracker_api.rs: remove reference to non-existent `ssl_enabled` field in `tsl_config` doc comment - Simplify `default_access_tokens()` in v3_0_0/tracker_api.rs: replace `[].iter().cloned().collect()` with `HashMap::new()`
Member
Author
|
All 7 Copilot review comments have been addressed in commit
|
Member
Author
|
ACK 2b6bc1a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Subissue #1 of 9 in EPIC #1978 — Configuration Overhaul (schema v3.0.0).
This is the foundation PR: all other subissues in the EPIC depend on this being merged first.
What this PR does
packages/configuration/src/v2_0_0/→v3_0_0/as the clean baseline for all v3 breaking changesv2_0_0references insidev3_0_0/(doc links,VERSIONconstant, test imports, schema version strings in test fixtures)logging.rsbehaviour (TraceStyle,setup(),tracing_init()) into bothv2_0_0/logging.rsandv3_0_0/logging.rs, making each versioned module fully self-containedpub mod v3_0_0tolib.rsalongsidepub mod v2_0_0Metadata::with_schema_versionhelper constructor tolib.rsDefaultimpl forv3_0_0::Configurationthat setsschema_version = "3.0.0""3.0.0"configs and rejects"2.0.0"configsWhat is intentionally NOT done here
Global re-exports (
pub type Configuration = v2_0_0::Configuration, etc.) and default config files stay at v2 until subissue #1980 (final cleanup), when all consumers are migrated atomically. Doing it now would require touching ~30 consumer files and tangle subsequent subissues (#2–#8) that are still modifying the v3 types.AC3 (application uses v3 by default) and AC5 (config files reference
"3.0.0") are explicitly deferred to #1980.Verification
linter all→ ✅ passedcargo test --doc --workspace→ ✅ passedRelated
docs/issues/open/1979-1978-copy-configuration-schema-v2-to-v3-baseline.mdtsl_config→tls_configtypo across the codebase #1981 (fixtsl_config→tls_configtypo)