Commit 5eaa205
committed
6c68db2 docs: [#334] mark implementation complete with all acceptance criteria (Jose Celano)
6217ad9 docs: [#334] update run command documentation with service URLs (Jose Celano)
4aba5ab feat: [#334] display service URLs after run command completes (Jose Celano)
9fb67d9 feat: [#334] add shared service URL views (Jose Celano)
Pull request description:
## Description
Enhances the `run` command output to display service URLs immediately after services start, improving actionability by giving users direct access to their deployed services.
Closes #334
## Changes
### Phase 1: Shared View Components ✅
- Created `src/presentation/views/commands/shared/service_urls/` module
- **CompactServiceUrlsView** - Renders service URLs in compact format (10 unit tests)
- **DnsHintView** - Provides DNS configuration hints for HTTPS services (5 unit tests)
- All 15 tests passing
### Phase 2: Enhanced Run Command Output ✅
- Modified `RunCommandController::complete_workflow()` to display service URLs
- Added `display_service_urls()` method using shared views
- Added `load_environment()` method reusing show command pattern
- Added `From<RepositoryError>` conversion for proper error handling
- All 2210 tests passing
### Phase 3: Documentation ✅
- Updated [`docs/user-guide/commands/run.md`](docs/user-guide/commands/run.md) with new output examples
- Updated [`docs/console-commands.md`](docs/console-commands.md) with new output format
- Issue specification marked complete with all acceptance criteria
## Sample Output
### Run Command (New Feature - HTTPS/TLS Environment)
```bash
$ cargo run -- run lxd-local-https-example
```
```
⏳ [1/2] Validating environment...
⏳ ✓ Environment name validated: lxd-local-https-example (took 0ms)
⏳ [2/2] Running application services...
⏳ ✓ Services started (took 24.0s)
✅ Run command completed for 'lxd-local-https-example'
Services are now accessible:
Tracker (UDP): udp://udp.tracker.local:6969/announce
Tracker (HTTP): https://http.tracker.local/announce
API: https://api.tracker.local/api
Health Check: https://health.tracker.local/health_check
Grafana: https://grafana.tracker.local/
Note: HTTPS services require DNS configuration. See 'show' command for details.
Tip: Run 'torrust-tracker-deployer show lxd-local-https-example' for full details
```
### Show Command (Comparison - Full Details)
```bash
$ cargo run -- show lxd-local-https-example
```
```
Environment: lxd-local-https-example
State: Running
Provider: LXD
Created: 2026-02-11 09:52:28 UTC
Infrastructure:
Instance IP: 10.140.190.36
SSH Port: 22
SSH User: torrust
SSH Key: /home/josecelano/Documents/git/committer/me/github/torrust/torrust-tracker-deployer-agent-01/fixtures/testing_rsa
Connection:
ssh -i /home/josecelano/Documents/git/committer/me/github/torrust/torrust-tracker-deployer-agent-01/fixtures/testing_rsa torrust@10.140.190.36
Tracker Services:
UDP Trackers:
- udp://udp.tracker.local:6969/announce
HTTP Trackers (HTTPS via Caddy):
- https://http.tracker.local/announce
API Endpoint (HTTPS via Caddy):
- https://api.tracker.local/api
Health Check (HTTPS via Caddy):
- https://health.tracker.local/health_check
Prometheus:
Internal only (localhost:9090) - not exposed externally
Grafana (HTTPS via Caddy):
https://grafana.tracker.local/
Note: HTTPS services require domain-based access. For local domains (*.local),
add the following to your /etc/hosts file:
10.140.190.36 http.tracker.local api.tracker.local grafana.tracker.local health.tracker.local
Internal ports (7070, 1212, 3000, 1313) are not directly accessible when TLS is enabled.
Services are running. Use 'test' to verify health.
```
## Architecture
- **DDD Layer**: Presentation
- **Module Path**: `src/presentation/views/commands/shared/service_urls/`
- **Pattern**: View composition with shared components
- **Design**: Reuses shared views between `run` and `show` commands (no duplication)
## Quality Assurance
- ✅ **All linters passing**: markdown, yaml, toml, cspell, clippy, rustfmt, shellcheck
- ✅ **All 2210 unit tests passing**
- ✅ **E2E tests passing** (infrastructure lifecycle + deployment workflow)
- ✅ **Documentation builds successfully**
- ✅ **Pre-commit checks passing**
- ✅ **Manual E2E test verified** with live deployment
## Architecture Compliance
- ✅ Follows DDD layer separation (Presentation layer)
- ✅ Reuses shared view components (no duplication)
- ✅ Uses `UserOutput` methods (no `println!`)
- ✅ Output goes to stdout via `ProgressReporter::result()`
- ✅ Follows module organization conventions
- ✅ Error handling follows project conventions
## Commits
1. `feat: [#334] add shared service URL views` - Phase 1: Shared view components
2. `feat: [#334] display service URLs after run command completes` - Phase 2: Enhanced output
3. `docs: [#334] update run command documentation with service URLs` - Phase 3: Documentation (part 1)
4. `docs: [#334] mark implementation complete with all acceptance criteria` - Phase 3: Documentation (part 2)
## Testing
Verified with manual E2E test:
1. Configured environment: `configure lxd-local-https-example`
2. Released application: `release lxd-local-https-example`
3. Started services: `run lxd-local-https-example` ✅ New output displayed
4. Compared with: `show lxd-local-https-example` ✅ Full details shown
## Rationale
1. **Actionable** - Users immediately know where to access services
2. **Not overwhelming** - Doesn't duplicate full `show` output (omits SSH details, internal ports)
3. **Educational** - Teaches users about the `show` command
4. **Follows project principles** - "Actionability: The system must always tell users how to continue"
The `run` command is the moment users want to _use_ the services, so showing URLs immediately provides high value.
Top commit has no ACKs.
Tree-SHA512: c0656c215c2850ded7033568b2d290f78acde5cedf3f0ad4fed524c60d2a15cdfd93000dc6624b632541648a409af93499b3bb39641b88efa73e27cccb1010b5
10 files changed
Lines changed: 744 additions & 78 deletions
File tree
- docs
- issues
- user-guide/commands
- src/presentation
- controllers/run
- views/commands
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
840 | 840 | | |
841 | 841 | | |
842 | 842 | | |
843 | | - | |
844 | | - | |
845 | | - | |
846 | | - | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
847 | 853 | | |
848 | 854 | | |
849 | 855 | | |
| |||
Lines changed: 69 additions & 72 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
123 | 122 | | |
124 | | - | |
| 123 | + | |
125 | 124 | | |
126 | 125 | | |
127 | 126 | | |
128 | | - | |
129 | | - | |
130 | | - | |
| 127 | + | |
| 128 | + | |
131 | 129 | | |
132 | | - | |
| 130 | + | |
133 | 131 | | |
134 | | - | |
135 | | - | |
136 | | - | |
| 132 | + | |
137 | 133 | | |
138 | | - | |
| 134 | + | |
139 | 135 | | |
140 | 136 | | |
141 | 137 | | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
148 | 145 | | |
149 | | - | |
| 146 | + | |
150 | 147 | | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
155 | 154 | | |
156 | | - | |
| 155 | + | |
157 | 156 | | |
158 | 157 | | |
159 | 158 | | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
167 | 164 | | |
168 | | - | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
169 | 168 | | |
170 | 169 | | |
171 | 170 | | |
172 | 171 | | |
173 | 172 | | |
174 | 173 | | |
175 | 174 | | |
176 | | - | |
| 175 | + | |
177 | 176 | | |
178 | 177 | | |
179 | 178 | | |
180 | 179 | | |
181 | 180 | | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
189 | 188 | | |
190 | 189 | | |
191 | 190 | | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
198 | 197 | | |
199 | 198 | | |
200 | 199 | | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
205 | 203 | | |
206 | 204 | | |
207 | 205 | | |
208 | | - | |
209 | | - | |
210 | | - | |
| 206 | + | |
| 207 | + | |
211 | 208 | | |
212 | 209 | | |
213 | 210 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
75 | 116 | | |
76 | 117 | | |
77 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
100 | 120 | | |
101 | 121 | | |
102 | 122 | | |
| |||
0 commit comments