refactor: [#300] Phase 3 Port Topology Template Integration (P3.4)#302
Merged
Merged
Conversation
- Create port_derivation.rs with PORT-01 through PORT-11 rules - Create port_definition.rs with PortDefinition DTO and From<&PortBinding> - Add ports: Vec<PortDefinition> to all service context types - Simplify docker-compose.yml.tera to use loops over service.ports - Add port descriptions as YAML comments in rendered output - Add try_build() with port conflict validation to DockerComposeContextBuilder - Apply DDD 'always valid' pattern: DockerComposeTopology::new() returns Result - Use idiomatic From trait instead of helper functions Also adds: - Issue #301 spec for Phase 4 DDD Layer Alignment (future work) - Updated epic #287 with Phase 4 tasks
aeb981d to
8dcbbc9
Compare
Member
Author
|
ACK 8dcbbc9 |
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
Integrates the
PortBindingdomain types (created in #298) into the Docker Compose template rendering, completing Phase 3 of the topology refactoring.Changes
Port Derivation (
port_derivation.rs)derive_tracker_ports()- UDP always exposed, HTTP/API only when no TLSderive_caddy_ports()- Always exposes 80, 443, 443/udpderive_prometheus_ports()- 9090 on localhost onlyderive_grafana_ports()- 3000 only when no TLSderive_mysql_ports()- No exposed portsPort Definition DTO (
port_definition.rs)PortDefinitionstruct withbindinganddescriptionfieldsFrom<&PortBinding>trait for idiomatic conversionService Context Updates
ports: Vec<PortDefinition>to all service configsTemplate Simplification (
docker-compose.yml.tera)# {{ port.description }}needs_ports_sectionchecks (replaced byports | length > 0)Validation
try_build()method onDockerComposeContextBuildervalidates port uniquenessPortConflictErrorwithhelp()method for actionable error messagesDockerComposeTopology::new()returnsResultDocumentation
Testing
PortDefinitionconversiontry_build()validationRendered Output Example
Checklist
./scripts/pre-commit.shservice.portstry_build()Related
docs/issues/300-phase-3-port-topology-template-integration.md