Commit Graph

17 Commits

Author SHA1 Message Date
a0d2bd6996 🐛 fix: correct database.ssl_mode environment variable binding
Some checks failed
CI/CD Pipeline / Build Docker Cache (push) Successful in 10s
CI/CD Pipeline / CI Pipeline (push) Failing after 17s
- Fix environment variable binding for SSL mode
- Use correct mapstructure tag name
- Match struct field binding

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-04-08 00:28:18 +02:00
0026515237 🐛 fix: add missing database environment variable bindings
- Add BindEnv calls for database configuration
- DLC_DATABASE_HOST, DLC_DATABASE_PORT, DLC_DATABASE_USER
- DLC_DATABASE_PASSWORD, DLC_DATABASE_NAME, DLC_DATABASE_SSL_MODE
- Enable environment variable override for database config
- Fix BDD test database connection issues

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-04-08 00:25:01 +02:00
52065c9cf3 refactor: convert all DanceLessonsCoach mentions to kebab-case
Some checks failed
CI/CD Pipeline / Build Docker Cache (push) Successful in 10s
CI/CD Pipeline / CI Pipeline (push) Failing after 13s
2026-04-07 19:11:39 +02:00
f39a0df338 🧪 test: add JWT edge case scenarios with validation endpoint
- Add expired JWT token scenario

- Add wrong secret JWT token scenario

- Add malformed JWT token scenario

- Implement /api/v1/auth/validate endpoint

- Add JWT parsing and validation to BDD steps

Generated by Mistral Vibe.

Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-04-07 18:21:56 +02:00
d661098c5c 🔧 feat: add OpenTelemetry instrumentation to persistence layer
Some checks failed
CI/CD Pipeline / CI Pipeline (push) Has been cancelled
CI/CD Pipeline / CI Pipeline (pull_request) Successful in 11m33s
- Added persistence telemetry configuration option (telemetry.persistence.enabled)
- Created PersistenceTelemetryConfig struct for fine-grained control
- Added GetPersistenceTelemetryEnabled() helper method
- Implemented telemetry span creation in SQLite repository
- Added OpenTelemetry instrumentation to key repository methods:
  - CreateUser: Tracks user creation with error recording
  - GetUserByUsername: Tracks queries with username attribute
- Maintained backward compatibility - telemetry is optional and disabled by default
- Updated all tests to pass config parameter to repository constructor
- Added proper error recording and span attributes for observability

Benefits:
- Performance monitoring of database operations
- Flamegraph generation capability for persistence layer
- Distributed tracing across service boundaries
- Configurable instrumentation for production vs development

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-04-07 00:50:17 +02:00
08202a578d 📝 docs: add comprehensive SOLID analysis and code review findings
Some checks failed
CI/CD Pipeline / CI Pipeline (push) Has been cancelled
CI/CD Pipeline / CI Pipeline (pull_request) Successful in 15m34s
- Documented SOLID principle violations across codebase
- Identified security best practice improvements needed
- Analyzed performance optimization opportunities
- Added detailed refactoring recommendations
- Updated ADR-0018 with JWT secret rotation reference
- Enabled gitea-client skill for programmer agent

This commit captures the current state analysis before implementing improvements.
2026-04-06 23:49:03 +02:00
157d8e2d19 🔧 chore: update all references from DanceLessonsCoach to dance-lessons-coach
Some checks failed
CI/CD Pipeline / CI Pipeline (push) Failing after 4m0s
2026-04-06 17:27:07 +02:00
a5344d6ed8 📝 docs: add comprehensive version management and CLI documentation 2026-04-05 11:28:11 +02:00
9336178d73 📝 docs: add ADR for staged-only Git hooks formatting
- Add ADR-0012 documenting the decision to format only staged Go files
- Update ADR README.md with new entry
- Document rationale, alternatives, and verification results
- Include future considerations for monitoring and CI/CD integration

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-04-04 21:36:57 +02:00
875eb09fb7 feat: implement API v2 with feature flag control
- Added /api/v2/greet POST endpoint with JSON request/response

- Implemented ServiceV2 with Hello my friend <name>! greeting format

- Added api.v2_enabled feature flag (default: false)

- Extended BDD tests to cover v2 scenarios

- Maintained full backward compatibility with v1 API

- Added DLC_API_V2_ENABLED environment variable support

- Created ADR 0010-api-v2-feature-flag.md

- Updated configuration system to support API versioning
2026-04-04 20:39:46 +02:00
3c1aaea789 🔧 refactor: move log output setup to config package and change server logs to Trace level 2026-04-04 14:05:06 +02:00
25d8940db4 🔧 config: add log output file configuration and cleanup example files 2026-04-04 13:54:59 +02:00
00e796c608 Enhance build system and logging configuration
- Add scripts/build.sh to compile binaries into bin/ directory

- Move all zerolog setup logic from cmd/server/main.go to pkg/config

- Add log level configuration support (trace, debug, info, warn, error, fatal, panic)

- Simplify cmd/server/main.go from 57 to 27 lines (53% reduction)

- Update .gitignore to use bin/ directory instead of individual files

- Document build process and bin directory in AGENTS.md

- Maintain backward compatibility with all existing functionality
2026-04-04 13:24:33 +02:00
Mistral Vibe
36f0b79b90 Add OpenTelemetry instrumentation with middleware-only approach 2026-04-04 12:19:48 +02:00
Gabriel Radureau
7c5e61c386 Implement comprehensive graceful shutdown with JSON logging
- Added signal.NotifyContext for modern signal handling in cmd/server/main.go
- Implemented BaseContext for proper context propagation to HTTP handlers
- Added readiness drain delay before shutdown for graceful degradation
- Fixed PID detection in start-server.sh to target actual server process
- Added Logging.JSON configuration option with DLC_LOGGING_JSON environment variable
- Created comprehensive test script that validates entire server lifecycle
- Updated documentation with JSON logging configuration examples
- All shutdown logs now appear correctly in JSON format
- Server terminates gracefully on SIGTERM with proper log flushing

The graceful shutdown implementation follows VictoriaMetrics best practices:
1. Catches termination signals (SIGTERM, SIGINT)
2. Stops accepting new requests but allows ongoing requests to complete
3. Waits for active requests to finish within configured timeout
4. Releases resources and performs cleanup
5. Logs all shutdown steps for observability

Test script validates:
- Server startup and API functionality
- Graceful shutdown sequence
- JSON log format validation
- Complete log sequence verification
- Proper signal handling and context propagation

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-04-03 19:23:23 +02:00
Gabriel Radureau
eaaa63d74e Add flexible configuration with custom file path support
\n- Add DLC_CONFIG_FILE environment variable for custom config paths\n- Update config.go to support both default and custom config file locations\n- Update README.md and AGENTS.md with configuration documentation\n- Remove /Users/gabrielradureau/.dancelessonscoach/ directory approach\n- Add os import to config.go\n- Test all configuration scenarios
2026-04-03 15:50:18 +02:00
Gabriel Radureau
8103f64db9 Add configuration management with Viper
- Implement pkg/config package with Viper integration
- Support environment variables with DLC_ prefix
- Add configurable server host, port, and shutdown timeout
- Update server to use configuration values
- Add config.example.yaml template file
- Update AGENTS.md with configuration documentation
- Maintain backward compatibility with default values

Configuration options:
- DLC_SERVER_HOST (default: 0.0.0.0)
- DLC_SERVER_PORT (default: 8080)
- DLC_SHUTDOWN_TIMEOUT (default: 30s)
2026-04-03 13:53:57 +02:00