[WIP] Create input layer in presentation structure#157
Conversation
|
@copilot the linting workflow is failing: |
28c21bf to
0805d1e
Compare
|
@copilot The PR has been rebased onto the latest Context: The previous timeout issue that was blocking progress (caused by pre-commit checks taking longer than the command execution timeout) has been resolved in #121. The E2E tests are now skipped in the Copilot agent environment using the You can now continue with the implementation of this PR. All phases are marked as complete in the description, but please verify the current state and proceed with any remaining work or testing. |
|
@copilot, before committing, make sure the environment variable TORRUST_TD_SKIP_SLOW_TESTS is set to true to skip slow tests. Otherwise, pre-commit checks take longer than the bash command execution, and we reach the whole session timeout (30") trying to commit in an infinite loop. |
|
I will do it with a local agent. |
Proposal 1: Create Input Layer
This PR implements the first step of the Presentation Layer Reorganization refactoring by establishing an explicit Input Layer in the presentation structure.
Progress:
src/presentation/input/directorysrc/presentation/input/mod.rswith module documentationsrc/presentation/cli/tosrc/presentation/input/cli/src/presentation/cli/directory removed (by move operation)src/presentation/mod.rspresentation::clisrc/presentation/commands/mod.rssrc/presentation/commands/create/mod.rssrc/presentation/commands/create/handler.rssrc/presentation/commands/create/tests/template.rssrc/presentation/commands/create/tests/integration.rssrc/presentation/input/cli/args.rs(internal references)src/presentation/input/cli/mod.rs(internal references)Related:
Fixes #155
Original prompt
This section details on the original issue you should resolve
<issue_title>Proposal 1: Create Input Layer</issue_title>
<issue_description>## Overview
Establish an explicit Input Layer in the presentation structure by creating
src/presentation/input/and moving the CLI module there. This is the first step in transforming the presentation layer into a four-layer architecture (Input → Dispatch → Controllers → Views).Parent Epic: #154 - Presentation Layer Reorganization
Related: Refactor Plan | Design Proposal
Impact: 🟢🟢 Medium - Clear separation of user input parsing from command execution
Effort: 🔵🔵 Medium - Straightforward move with import updates
Estimated Time: 2-3 hours
Goals
src/presentation/input/directory with proper module structuresrc/presentation/cli/tosrc/presentation/input/cli/presentation::clitopresentation::input::clicommands/,user_output/) remains functional🏗️ Architecture Requirements
DDD Layer: Presentation
Module Path:
src/presentation/input/Pattern: Input Layer (Layer 1 of 4-layer presentation architecture)
Target Structure
After this proposal:
Implementation Plan
Phase 1: Create Directory Structure (30 minutes)
src/presentation/input/directorysrc/presentation/input/mod.rswith module documentationPhase 2: Move CLI Module (30 minutes)
src/presentation/cli/tosrc/presentation/input/cli/src/presentation/cli/directoryPhase 3: Update Imports (60 minutes)
src/presentation/mod.rs:pub mod input;src/main.rs:use torrust_tracker_deployer_lib::presentation::input::cli::Cli;rg "use.*presentation::cli" --type rustpresentation::input::cliPhase 4: Documentation Updates (30 minutes)
README.mdif it references presentation structurePhase 5: Testing & Verification (30 minutes)
./scripts/pre-commit.shcargo run -- --help, etc.Acceptance Criteria
Quality Checks:
./scripts/pre-commit.shStructure:
src/presentation/input/directory existssrc/presentation/input/mod.rscontains module documentationsrc/presentation/input/cli/contains moved CLI modulesrc/presentation/cli/directory removedImports:
presentation::clitopresentation::input::clicargo buildcompletes without warningsFunctionality:
--helpoutput unchangedcommands/,user_output/) still functionalDocumentation:
input/mod.rsexplains input layer purposeMergeable State:
📚 Related Documentation
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.