Skip to content

Commit a4a890c

Browse files
committed
docs: [#14] improve documentation organization and markdownlint configuration
- Create dedicated ADR documentation (docs/adr/README.md) - Add ADR guidelines, template, and lessons learned - Move ADR list from docs/README.md to dedicated location - Document best practices for keeping ADRs focused - Configure global table line length exclusion in markdownlint - Update .markdownlint.json to exclude tables from MD013 rule - Create .markdownlint.md with configuration documentation - Update .github/copilot-instructions.md with simplified table guidance - Remove unnecessary markdownlint ignore blocks from existing tables - Document SSH host key verification troubleshooting - Create docs/infrastructure/ssh-host-key-verification.md - Provide comprehensive solution for VM development warnings - Improve documentation structure and navigation - Update docs/README.md with cleaner organization - Add cross-references and proper categorization - Include reference to markdownlint configuration guidelines Benefits: - Tables automatically ignore line length limits (no manual ignore blocks needed) - Cleaner markdown files without visual clutter - Better organized ADR documentation with clear guidelines - Comprehensive troubleshooting documentation for common issues
1 parent c4a1e7b commit a4a890c

File tree

6 files changed

+385
-16
lines changed

6 files changed

+385
-16
lines changed

.github/copilot-instructions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,8 @@ The twelve-factor **Build, Release, Run** stages apply to the application deploy
300300
- **Structure**: Use consistent heading hierarchy
301301
- **Links**: Prefer relative links for internal documentation
302302
- **Code blocks**: Always specify language for syntax highlighting
303+
- **Tables**: Tables automatically ignore line length limits (configured globally in
304+
`.markdownlint.json`). No special formatting required for table line lengths.
303305

304306
#### Automated Linting
305307

.markdownlint.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"default": true,
33
"MD013": {
4-
"line_length": 100
4+
"line_length": 100,
5+
"tables": false
56
},
67
"MD031": true,
78
"MD032": true,

.markdownlint.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Markdownlint Configuration
2+
3+
This file documents the markdownlint configuration for the project.
4+
5+
## Line Length Handling
6+
7+
The project enforces a 100-character line limit for markdown files (`MD013` rule).
8+
Tables are automatically excluded from this limit to maintain readability.
9+
10+
### Table Line Length Configuration
11+
12+
Tables are configured to ignore line length limits globally via the `.markdownlint.json` configuration:
13+
14+
```json
15+
"MD013": {
16+
"line_length": 100,
17+
"tables": false
18+
}
19+
```
20+
21+
This means:
22+
23+
- **Regular text**: Must stay within 100 characters per line
24+
- **Tables**: Can exceed line length limits without linting errors
25+
- **Code blocks**: Follow normal line length rules
26+
27+
### Alternative Approach
28+
29+
If you need to disable line length for specific non-table content, you can still use
30+
markdownlint ignore blocks:
31+
32+
```markdown
33+
<!-- markdownlint-disable MD013 -->
34+
35+
Very long line content that needs to exceed the normal limit
36+
37+
<!-- markdownlint-enable MD013 -->
38+
```

docs/README.md

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Documentation Structure
1+
docs/README.md# Documentation Structure
22

33
This directory contains general cross-cutting documentation for the Torrust
44
Tracker Demo project.
@@ -14,20 +14,10 @@ This directory currently contains cross-cutting documentation:
1414

1515
### 📋 [`adr/`](adr/) (Architecture Decision Records)
1616

17-
**Current ADRs:**
18-
19-
- [ADR-001: Makefile Location](adr/001-makefile-location.md) - Decision to keep
20-
Makefile at repository root level
21-
- [ADR-002: Docker for All Services](adr/002-docker-for-all-services.md) - Decision
22-
to use Docker for all services including UDP tracker
23-
- [ADR-003: Use MySQL Over MariaDB](adr/003-use-mysql-over-mariadb.md) - Decision
24-
to use MySQL instead of MariaDB for database backend
25-
- [ADR-004: Configuration Approach Files vs Environment Variables]
26-
(adr/004-configuration-approach-files-vs-environment-variables.md) -
27-
Configuration approach decision for application settings
28-
- [ADR-005: Sudo Cache Management for Infrastructure Operations]
29-
(adr/005-sudo-cache-management-for-infrastructure-operations.md) -
30-
Proactive sudo cache management for better UX during testing
17+
**Important architectural decisions** that affect the system structure, behavior, or
18+
development process.
19+
20+
📖 **[See ADR README](adr/README.md)** for complete list, guidelines, and best practices.
3121

3222
### 📅 [`plans/`](plans/) (Ongoing Plans and Roadmaps)
3323

@@ -43,6 +33,30 @@ This directory currently contains cross-cutting documentation:
4333
- [Phase 1: MySQL Migration](issues/12-use-mysql-instead-of-sqlite-by-default.md) -
4434
Detailed implementation plan for database migration from SQLite to MySQL
4535

36+
### 🏗️ [`infrastructure/`](infrastructure/) (Infrastructure Documentation)
37+
38+
**Cross-cutting infrastructure documentation** - For infrastructure-related
39+
documentation that affects the project as a whole or provides reference materials.
40+
41+
**Current Infrastructure Documentation:**
42+
43+
- [SSH Host Key Verification](infrastructure/ssh-host-key-verification.md) -
44+
Explains and resolves SSH host key verification warnings in VM development
45+
46+
### 📚 [`guides/`](guides/) (User and Developer Guides)
47+
48+
**High-level guides and end-to-end workflows** - For complete procedures
49+
that span multiple components.
50+
51+
**Current Guides:**
52+
53+
- [Integration Testing Guide](guides/integration-testing-guide.md) - Step-by-step
54+
guide for running integration tests following twelve-factor methodology
55+
- [Quick Start Guide](guides/quick-start.md) - Fast setup guide for getting
56+
started quickly
57+
- [Smoke Testing Guide](guides/smoke-testing-guide.md) - End-to-end testing
58+
using official Torrust client tools
59+
4660
### 🔧 [`refactoring/`](refactoring/) (Refactoring Documentation)
4761

4862
**Major refactoring initiatives and changes** - Documentation of significant
@@ -110,3 +124,5 @@ When adding new documentation:
110124
- **ADRs**: Should follow standard ADR template format and affect multiple layers
111125
- **Theory**: Should explain concepts clearly with examples when possible
112126
- **Benchmarks**: Should include methodology, environment, and reproducible results
127+
- **Markdown Tables**: For tables exceeding line length limits, see
128+
[`.markdownlint.md`](../.markdownlint.md) for proper formatting guidelines

docs/adr/README.md

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
# Architecture Decision Records (ADRs)
2+
3+
This directory contains Architecture Decision Records (ADRs) for the Torrust Tracker Demo project.
4+
5+
## What are ADRs?
6+
7+
Architecture Decision Records document important architectural decisions made during the project
8+
lifecycle. They provide context, rationale, and consequences of decisions that affect the
9+
system's structure, behavior, or development process.
10+
11+
## ADR Guidelines
12+
13+
### When to Create an ADR
14+
15+
Create an ADR for decisions that:
16+
17+
- **Affect multiple system components** or development workflows
18+
- **Have significant long-term implications** for the project
19+
- **Involve trade-offs** between different approaches
20+
- **Need to be communicated** to the team and future contributors
21+
- **May be questioned** or reversed in the future
22+
23+
### When NOT to Create an ADR
24+
25+
Avoid creating ADRs for:
26+
27+
- **Implementation details** specific to a single component
28+
- **Temporary workarounds** or quick fixes
29+
- **Obvious technical choices** with no reasonable alternatives
30+
- **Operational procedures** (use operational documentation instead)
31+
32+
### ADR Structure
33+
34+
Each ADR should follow this template:
35+
36+
```markdown
37+
# ADR-XXX: [Decision Title]
38+
39+
## Status
40+
41+
[Proposed | Accepted | Deprecated | Superseded]
42+
43+
## Context
44+
45+
[Describe the problem, constraints, and forces at play]
46+
47+
## Decision
48+
49+
[State the decision clearly and concisely]
50+
51+
## Alternatives Considered
52+
53+
[List other options that were considered and why they were rejected]
54+
55+
## Rationale
56+
57+
[Explain why this decision was made]
58+
59+
## Consequences
60+
61+
### Positive
62+
63+
- [List benefits and positive outcomes]
64+
65+
### Negative
66+
67+
- [List costs, risks, and negative impacts]
68+
69+
### Neutral
70+
71+
- [List neutral consequences and trade-offs]
72+
73+
## Implementation Details
74+
75+
[Optional: Include relevant implementation specifics]
76+
77+
## Monitoring
78+
79+
[How will we measure if this decision is working]
80+
81+
## Related Decisions
82+
83+
[Link to related ADRs]
84+
85+
## References
86+
87+
[Links to supporting documentation, discussions, etc.]
88+
```
89+
90+
## Lessons Learned
91+
92+
### Keep ADRs Focused
93+
94+
**❌ Bad Practice**: Mixing multiple unrelated decisions in a single ADR
95+
96+
**✅ Good Practice**: Each ADR should address a single architectural decision
97+
98+
**Example**: ADR-005 originally mixed sudo cache management with SSH host key verification.
99+
These are separate infrastructure concerns and should be documented separately:
100+
101+
- Sudo cache management → ADR (architectural decision)
102+
- SSH host key verification → Operational documentation (troubleshooting guide)
103+
104+
### Separate Concerns by Type
105+
106+
| Documentation Type | Purpose | Location | Example |
107+
| ------------------------ | ------------------------------ | ---------------------- | ------------------- |
108+
| **ADR** | Record architectural decisions | `docs/adr/` | Database choice |
109+
| **Operational Docs** | Solve immediate problems | `docs/infrastructure/` | SSH troubleshooting |
110+
| **Implementation Plans** | Detail feature implementation | `docs/issues/` | Development plans |
111+
| **User Guides** | End-to-end workflows | `docs/guides/` | Testing procedures |
112+
113+
### Scope and Audience
114+
115+
- **ADRs**: For contributors understanding design decisions
116+
- **Operational Docs**: For users encountering specific problems
117+
- **Guides**: For users following complete procedures
118+
119+
## Current ADRs
120+
121+
### 📋 Active ADRs
122+
123+
- [ADR-001: Makefile Location](001-makefile-location.md) - Decision to keep
124+
Makefile at repository root level
125+
- [ADR-002: Docker for All Services](002-docker-for-all-services.md) - Decision
126+
to use Docker for all services including UDP tracker
127+
- [ADR-003: Use MySQL Over MariaDB](003-use-mysql-over-mariadb.md) - Decision
128+
to use MySQL instead of MariaDB for database backend
129+
- [ADR-004: Configuration Approach Files vs Environment Variables]
130+
(004-configuration-approach-files-vs-environment-variables.md) -
131+
Configuration approach decision for application settings
132+
- [ADR-005: Sudo Cache Management for Infrastructure Operations]
133+
(005-sudo-cache-management-for-infrastructure-operations.md) -
134+
Proactive sudo cache management for better UX during testing
135+
136+
### 📊 ADR Statistics
137+
138+
- **Total ADRs**: 5
139+
- **Status**: All Accepted
140+
- **Coverage**: Infrastructure (3), Application (1), Development Workflow (1)
141+
142+
## Contributing
143+
144+
### Creating a New ADR
145+
146+
1. **Identify the decision** that needs documentation
147+
2. **Check existing ADRs** to avoid duplication
148+
3. **Determine ADR number** (next sequential number)
149+
4. **Use the template** provided above
150+
5. **Focus on a single decision** - avoid mixing multiple concerns
151+
6. **Get team review** before marking as "Accepted"
152+
7. **Update this README** to include the new ADR in the list
153+
154+
### Updating Existing ADRs
155+
156+
- **Status changes**: Update status from "Proposed" to "Accepted"
157+
- **Superseding**: When replacing an ADR, update the old one's status to "Superseded"
158+
- **References**: Add references when decisions are implemented or referenced
159+
160+
### Best Practices
161+
162+
1. **Write for the future**: Assume readers don't have current context
163+
2. **Include alternatives**: Show what options were considered
164+
3. **Be honest about trade-offs**: Document both benefits and costs
165+
4. **Keep it concise**: Focus on the decision, not implementation details
166+
5. **Link related decisions**: Cross-reference related ADRs
167+
6. **Update when necessary**: ADRs can evolve as understanding improves
168+
169+
## Templates and Examples
170+
171+
- **Template**: Use the structure outlined in "ADR Structure" above
172+
- **Good Examples**: ADR-001 (clear trade-offs), ADR-003 (thorough alternatives analysis)
173+
- **Lessons Learned**: See ADR-005 for an example of how to keep focused scope
174+
175+
## Related Documentation
176+
177+
- [Main Documentation Guide](../README.md) - Overall documentation structure
178+
- [Infrastructure Documentation](../../infrastructure/docs/) - Infrastructure-specific docs
179+
- [Application Documentation](../../application/docs/) - Application-specific docs
180+
- [Guides](../guides/) - End-to-end procedures and workflows

0 commit comments

Comments
 (0)