📝 docs: audit and correct all ADR statuses and content
Full pass over all 25 ADRs to align documentation with actual implementation state. Changes by ADR: README index: completely rewritten — previous table mapped numbers to wrong titles from 0010 onward. 0008 (BDD Testing): added note that flat features/ structure and godog CLI invocation are superseded by ADR-0024; framework decision stands. 0009 (Hybrid Testing): renamed from "Combine BDD and Swagger-based testing" to "BDD Testing with OpenAPI Documentation"; clarified that the SDK-testing layer was never built and has no open issue. 0013 (OpenAPI/Swagger): removed leftover merge conflict artifact (=======) and duplicated 60-line block. 0015 (Cobra CLI): fixed status contradiction — body said "Implemented" while footer said "Proposed". Now Accepted. 0018 (User Management): status Proposed → Accepted; system is fully implemented (JWT, bcrypt, GORM repos all present). 0019 (PostgreSQL): status Proposed → Accepted (Partial); added warning that sqlite_repository.go and gorm/driver/sqlite still present contrary to ADR intent. 0021 (JWT Retention): fixed wrong cross-reference (previously cited ADR-0009 "Hybrid Testing" as source of JWT multi-secret support); fixed title number from "10" to "21"; clarified that base JWT is implemented but the retention cleanup job is not. 0022 (Rate Limiting/Cache): added warning block linking to open Gitea issue #13; changed all 20 false ✅ implementation checkboxes to ❌. 0023 (Config Hot Reloading): added note that BDD scenarios exist for this feature but the feature itself is not yet implemented. 0024 (BDD Organization): status Proposed → Accepted; modular domain structure is fully built. 0025 (BDD Scenario Isolation): status Proposed → Accepted (Partial); Phase 1 done, Phase 2 blocked on ADR-0022. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -378,68 +378,6 @@ Added to `.gitea/workflows/go-ci-cd.yaml` lint-format job:
|
||||
# Format swagger comments manually
|
||||
swag fmt
|
||||
|
||||
# Format is automatically run in:
|
||||
# - pre-commit hook
|
||||
# - CI/CD lint-format job
|
||||
```
|
||||
=======
|
||||
### Final Implementation
|
||||
|
||||
```bash
|
||||
# 1. Install swaggo
|
||||
go install github.com/swaggo/swag/cmd/swag@latest
|
||||
|
||||
# 2. Add swagger metadata to main.go
|
||||
// @title dance-lessons-coach API
|
||||
// @version 1.0
|
||||
// @description API for dance-lessons-coach service
|
||||
// @host localhost:8080
|
||||
// @BasePath /api
|
||||
package main
|
||||
```
|
||||
|
||||
### Swag Formatting Integration
|
||||
|
||||
To ensure consistent swagger comment formatting, we've integrated `swag fmt` into our workflow:
|
||||
|
||||
#### Git Hooks
|
||||
Added to `.git/hooks/pre-commit`:
|
||||
```bash
|
||||
# Run swag fmt to format swagger comments
|
||||
echo "Running swag fmt..."
|
||||
if command -v swag >/dev/null 2>&1; then
|
||||
swag fmt
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERROR: swag fmt failed"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "swag not installed, skipping swag fmt"
|
||||
fi
|
||||
```
|
||||
|
||||
#### CI/CD Integration
|
||||
Added to `.gitea/workflows/go-ci-cd.yaml` lint-format job:
|
||||
```yaml
|
||||
- name: Install swag
|
||||
run: go install github.com/swaggo/swag/cmd/swag@latest
|
||||
|
||||
- name: Run swag fmt
|
||||
run: swag fmt
|
||||
```
|
||||
|
||||
#### Benefits
|
||||
- **Consistent Formatting**: Automatic formatting of swagger comments
|
||||
- **Pre-Commit Validation**: Catches issues before commit
|
||||
- **CI/CD Enforcement**: Ensures formatting in all pull requests
|
||||
- **Team Consistency**: Everyone follows the same rules
|
||||
- **Automatic Fixes**: Issues are fixed automatically
|
||||
|
||||
#### Usage
|
||||
```bash
|
||||
# Format swagger comments manually
|
||||
swag fmt
|
||||
|
||||
# Format is automatically run in:
|
||||
# - pre-commit hook
|
||||
# - CI/CD lint-format job
|
||||
|
||||
Reference in New Issue
Block a user