You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Revisit EnvContainer::initialize to accept narrower config slices instead of &Configuration #1861
Revisit the initialization API of EnvContainer (and related server environment types) to evaluate whether accepting narrower config slices (Arc<Core>, Arc<UdpTracker>, etc.) instead of &Configuration would reduce the coupling forcing function at the initialisation boundary.
Background
Issue #1856 (DEC-07) identified that the root reason a UDP-only binary must compile all service config types is not the config package structure — it is the EnvContainer::initialize / Environment::new signature, which accepts &Arc<Configuration> (the full aggregate) rather than only the config types actually needed by that server.
As a result, the compiler must include HttpTracker, HttpApi, HealthCheckApi, TslConfig, and AccessTokens even when none of those services run, because the initialisation function signature demands the full struct.
Goal
Evaluate whether changing the initialization API to accept narrower config slices is practical:
UdpEnvironment::new(&Arc<Core>, &Arc<UdpTracker>) instead of &Arc<Configuration>
HttpEnvironment::new(&Arc<Core>, &Arc<HttpTracker>) instead of &Arc<Configuration>
The output is a decision and, if narrowing is adopted, an implementation that verifies the UDP-only example binary no longer compiles HttpTracker/HttpApi/etc.
Acceptance Criteria
A decision entry is added to DECISIONS.md with the chosen approach and rationale
If narrowing is adopted: Environment::new accepts narrower config types and the coupling table in the Cargo examples no longer shows "Compiled but idle" types
The two Cargo examples in packages/udp-server/examples/ and packages/axum-http-server/examples/ are updated to reflect the new API
All tests pass; no new clippy warnings
Notes
This is a design-first issue. The implementation may require changes to how the bootstrap layer constructs config slices from the full Configuration, so that higher-level binaries still work without modification.
Activity
docs(1856): close remaining acceptance criteria and update EPIC.md (t…
docs(1669): add subissue specs for FU-1, FU-2, FU-3 from issue torrus…
Merge #1862: docs(configuration): analyse coupling, record DEC-07, ad…
refactor(env): narrow EnvContainer::initialize to accept per-service …
Merge #1866: refactor(env): narrow EnvContainer::initialize to accept…
chore(issues): archive closed specs for torrust#1851, torrust#1852, t…
Merge #1873: Archive closed issue specs from docs/issues/open
docs(issues): [torrust#1669] sync EPIC spec with current workspace state
Merge #2441: docs(issues): [#1669] sync EPIC spec with current worksp…