Commit Graph

4 Commits

Author SHA1 Message Date
760d1cc8b0 🔧 feat: enhance readiness endpoint with database health check
Some checks failed
CI/CD Pipeline / CI Pipeline (push) Has been cancelled
CI/CD Pipeline / CI Pipeline (pull_request) Successful in 11m58s
- Added CheckDatabaseHealth() method to UserRepository interface
- Implemented database connectivity check in SQLite repository
- Enhanced /ready endpoint to verify database health before reporting ready
- Improved readiness logic: checks both server shutdown status and database connectivity
- Better observability: Logs database health check failures with warnings

Benefits:
- More accurate readiness reporting for Kubernetes/container environments
- Detects database connectivity issues before accepting traffic
- Prevents application from accepting requests when database is unavailable
- Maintains backward compatibility with existing readiness checks

Implementation:
- Simple COUNT query to test database responsiveness
- Graceful handling of database unavailability
- Proper HTTP 503 status when not ready
- Comprehensive logging for troubleshooting

Testing:
-  Readiness endpoint returns true when database is healthy
-  Readiness endpoint returns false when database is unhealthy
-  All existing functionality preserved
-  All 25 BDD scenarios passing
-  All unit tests passing

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-04-07 01:02:53 +02:00
79c9313fab 🎯 refactor: implement unified authentication endpoint
Some checks failed
CI/CD Pipeline / CI Pipeline (push) Has been cancelled
CI/CD Pipeline / CI Pipeline (pull_request) Successful in 11m42s
- Unified login endpoint now supports both regular users and admin authentication
- Simplified API surface from 2 endpoints to 1 for authentication
- Maintains security separation internally (tries regular user first, then admin)
- Updated Swagger documentation to reflect unified authentication
- All existing functionality preserved with improved user experience

Benefits:
- Simpler API: One endpoint instead of /auth/login and /auth/admin/login
- Better UX: Users don't need to know if they're admin or regular user
- Backward Compatible: Existing admin functionality fully preserved
- Cleaner Architecture: Complexity hidden internally

Testing:
-  Admin authentication through unified endpoint
-  Regular user authentication through unified endpoint
-  Error handling for invalid credentials
-  All 25 BDD scenarios passing
-  All unit tests passing

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-04-07 00:57:30 +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