Commit Graph

11 Commits

Author SHA1 Message Date
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