Commit Graph

1176 Commits

Author SHA1 Message Date
Oliver Falk
2b799ba83b Merge latest enhancements and bugfixes from devel to master 2025-10-29 17:18:49 +01:00
Oliver Falk
0ee2f807c0 Merge branch 'feature/configurable-gravatar-defaults' into 'master'
Add configurable defaults for gravatarproxy and gravatarredirect

Closes #94

See merge request oliver/ivatar!277
2025-10-29 11:30:48 +01:00
Oliver Falk
aecc8e8477 Add configurable defaults for gravatarproxy and gravatarredirect 2025-10-29 11:30:48 +01:00
Oliver Falk
a07db42ae4 Merge branch 'devel' into 'master'
Performance optimization and Django 5.x compatibility fixes

Closes #101 and #102

See merge request oliver/ivatar!276
2025-10-29 09:55:28 +01:00
Oliver Falk
a7b04dc2f4 Performance optimization and Django 5.x compatibility fixes 2025-10-29 09:55:28 +01:00
Oliver Falk
a9ddb040d3 Merge branch 'devel' into 'master'
Speed up robohash generation

See merge request oliver/ivatar!275
2025-10-24 17:42:00 +02:00
Oliver Falk
b44ee42398 Speed up robohash generation 2025-10-24 17:42:00 +02:00
Oliver Falk
96a62fe006 Merge branch 'devel' into 'master'
Enhance performance tests

See merge request oliver/ivatar!273
2025-10-24 13:51:46 +02:00
Oliver Falk
9cf1cb4745 Enhance performance tests 2025-10-24 13:51:45 +02:00
Oliver Falk
f0c604a523 Merge branch 'devel' 2025-10-22 12:53:42 +02:00
Oliver Falk
dead9cbd78 Merge branch 'devel' into 'master'
Add performance tests for produciton (merge latest development efforts)

See merge request oliver/ivatar!272
2025-10-22 12:52:30 +02:00
Oliver Falk
13165579e8 Add performance tests for produciton (merge latest development efforts) 2025-10-22 12:52:29 +02:00
Oliver Falk
84c209f453 Conditional django setup for local testing vs. remote testing 2025-10-22 12:39:36 +02:00
Oliver Falk
4103fcff55 Add performance tests 2025-10-22 11:56:54 +02:00
Oliver Falk
5119328346 Merge branch 'devel' into 'master'
ci: Make production deployment verification automatic

See merge request oliver/ivatar!271
2025-10-18 14:41:40 +02:00
Oliver Falk
f8f8beb52e ci: Make production deployment verification automatic
- Change verify_prod_deployment from 'when: manual' to 'when: on_success'
- Production deployment verification will now run automatically on master branch
- Ensures production deployments are verified just like dev deployments
- Maintains safety with allow_failure: false
2025-10-18 13:59:05 +02:00
Oliver Falk
8e556bb14d Merge branch 'devel' into 'master'
Fix deployment version endpoint and add comprehensive Prometheus metrics testing

See merge request oliver/ivatar!270
2025-10-18 13:53:18 +02:00
Oliver Falk
97c9b36258 feat: Add comprehensive Prometheus metrics testing for CI
- Add PrometheusMetricsIntegrationTest class with 7 comprehensive tests
- Test Prometheus server startup, custom metrics availability, and port conflict handling
- Test metrics increment, different labels, histogram metrics, and production mode
- Use random ports (9470-9570) to avoid conflicts between tests
- Make tests lenient about custom metrics timing (collection delays)
- Update OpenTelemetry configuration to handle MeterProvider conflicts gracefully
- Update documentation to clarify production vs development Prometheus usage
- Ensure metrics are properly exported via OTLP in production
- Verify comprehensive test coverage for CI environments

All 34 OpenTelemetry tests pass successfully.
2025-10-18 13:46:20 +02:00
Oliver Falk
eca9db8d16 Merge remote-tracking branch 'origin/master' into devel 2025-10-18 13:03:27 +02:00
Oliver Falk
7b34bdef87 Update cursor rules 2025-10-18 13:01:20 +02:00
Oliver Falk
c7efcb7246 Fix /deployment/version/ endpoint to show commit_date and add deployment_date
- Fix commit_date parsing from git logs (was showing 'unknown')
- Add deployment_date field using manage.py modification time
- Improve git log parsing to handle author names with spaces
- Both dates now show in proper format: YYYY-MM-DD HH:MM:SS +timezone

The endpoint now returns:
- commit_date: When the commit was made (from git logs)
- deployment_date: When the code was deployed (from file mtime)
2025-10-18 12:48:37 +02:00
Oliver Falk
fd10f66dab Merge branch 'devel' into 'master'
Get OTEL fixed

See merge request oliver/ivatar!269
2025-10-18 12:30:38 +02:00
Oliver Falk
b9fbf37308 Get OTEL fixed 2025-10-18 12:30:37 +02:00
Oliver Falk
6f39be3b6d Keep OTEL enabled - last merge disabled it again 2025-10-18 11:32:09 +02:00
Oliver Falk
4c5c4ab8fa Merge master into devel - resolve OpenTelemetry middleware conflict 2025-10-18 11:31:26 +02:00
Oliver Falk
4aeacf9fab Fix traces 2025-10-18 11:15:40 +02:00
Oliver Falk
d228674d4b Fix test with DjangoInstrumentor 2025-10-18 11:08:40 +02:00
Oliver Falk
c3c4a23619 Enable OTEL again, but only in one place 2025-10-18 11:00:49 +02:00
Oliver Falk
45387a1a43 Merge branch 'devel' into 'master'
Merge latest devel fixes

See merge request oliver/ivatar!268
2025-10-17 16:56:14 +02:00
Oliver Falk
8b2675591e Merge latest devel fixes 2025-10-17 16:56:13 +02:00
Oliver Falk
54426c84bc Merge branch 'master' into devel 2025-10-17 16:54:54 +02:00
Oliver Falk
a10a73c56e Do not add the OTEL middleware currently 2025-10-17 16:54:04 +02:00
Oliver Falk
f699a66236 Temporarily disable Django instrumentation to test Host header issue
- Comment out DjangoInstrumentor().instrument() to test if it's causing duplicate Host headers
- Remove unused DjangoInstrumentor import
- Keep other instrumentation (database, HTTP client) enabled
- This is a temporary test to isolate the Host header duplication issue
2025-10-17 15:42:53 +02:00
Oliver Falk
ac9c8fcbc3 Merge devel into master - resolve OpenTelemetry conflict
- Resolve merge conflict in opentelemetry_config.py
- Keep improved OSError handling for 'Address in use' error
- Include latest OpenTelemetry multiple initialization fix
2025-10-17 14:57:48 +02:00
Oliver Falk
ad4e5068b9 Fix OpenTelemetry multiple initialization issue
- Add _ot_initialized flag to prevent multiple setup calls
- Make setup_opentelemetry() idempotent
- Handle 'Address in use' error gracefully for Prometheus server
- Prevent OpenTelemetry setup failures due to multiple initialization
2025-10-17 14:56:15 +02:00
Oliver Falk
684cdca4e4 Merge branch 'devel' into 'master'
Enhance the version endpoint and fix OTEL deployment

See merge request oliver/ivatar!267
2025-10-17 14:49:10 +02:00
Oliver Falk
6db3450b20 Enhance the version endpoint and fix OTEL deployment 2025-10-17 14:49:10 +02:00
Oliver Falk
8e61f02702 Fix OpenTelemetry initialization - remove ENABLE_OPENTELEMETRY dependency
- Always initialize OpenTelemetry in Django settings (instrumentation always enabled)
- Remove ENABLE_OPENTELEMETRY feature flag from config.py
- Simplify views.py OpenTelemetry imports to always use real implementation
- Export control now handled by OTEL_EXPORT_ENABLED environment variable only

This ensures OpenTelemetry is properly initialized during Django startup
and the Prometheus metrics server starts correctly.
2025-10-17 14:43:05 +02:00
Oliver Falk
c17b078913 Add prometheus-client dependency for OpenTelemetry metrics server 2025-10-17 14:32:34 +02:00
Oliver Falk
ba4c587e5c Simplify version endpoint caching to indefinite cache
Since containers restart on content changes, remove TTL-based cache expiration
and cache version information indefinitely. This provides maximum performance
benefit while maintaining correctness.

- Remove timestamp-based cache expiration logic
- Cache version info indefinitely until container restart
- Simplify caching function by removing TTL complexity
- Maintain optimized git log file reading
2025-10-17 14:14:14 +02:00
Oliver Falk
8a1ccb1e0f Fix OpenTelemetry Prometheus metrics server startup
- Add _start_prometheus_server method to start HTTP server
- Register PrometheusMetricReader collector with prometheus_client REGISTRY
- Parse endpoint to extract host and port for HTTP server
- This fixes the issue where metrics endpoint was not accessible
2025-10-17 14:07:27 +02:00
Oliver Falk
e79398bc33 Fix performance issues in /deployment/version/ endpoint
- Add proper cache expiration with 5-minute TTL
- Optimize git log file reading to avoid loading entire file
- Read only last chunk (1024 bytes) instead of all lines
- Add shorter TTL (30s) for error cases to allow retry
- Improve error handling with UnicodeDecodeError support
- Maintain backward compatibility and security (no subprocess calls)

This fixes the 30-second response time issue by implementing efficient
caching and optimized file I/O operations.
2025-10-17 14:03:45 +02:00
Oliver Falk
25e9e489c3 Merge branch 'devel' into 'master'
Pull latest fixed from devel

See merge request oliver/ivatar!266
2025-10-17 12:56:16 +02:00
Oliver Falk
d3ffef3407 Pull latest fixed from devel 2025-10-17 12:56:15 +02:00
Oliver Falk
e8951014f9 Resolve merge conflict in test_views.py - choose devel version formatting 2025-10-17 12:42:47 +02:00
Oliver Falk
a6751d79d4 Merge branch 'master' into devel 2025-10-17 12:38:37 +02:00
Oliver Falk
1411420c65 Add comprehensive OpenID error handling tests for error.html template coverage
- Add OpenIDErrorHandlingTestCase with 8 test methods
- Test OpenID discovery failures, confirmation failures, and cancellations
- Test template inheritance (openid/failure.html extends error.html)
- Test direct error.html template rendering with authenticated/anonymous users
- Use unittest.mock to simulate OpenID failures without external dependencies
- Verify error messages are properly displayed to users
- Ensure comprehensive coverage of error.html template through OpenID scenarios

All tests pass and maintain existing test coverage.
2025-10-17 11:25:26 +02:00
Oliver Falk
2966a85083 Merge branch 'devel' into 'master'
File upload security (iteration 1), security enhancements and OpenTelemetry (OTEL) implementation (sending data disabled by default)

See merge request oliver/ivatar!265
2025-10-17 11:16:49 +02:00
Oliver Falk
780dc18fa4 File upload security (iteration 1), security enhancements and OpenTelemetry (OTEL) implementation (sending data disabled by default) 2025-10-17 11:16:48 +02:00
Oliver Falk
dcdbc6b608 Update test scripts and documentation for simplified OpenTelemetry approach
- Update all test scripts to use OTEL_EXPORT_ENABLED instead of legacy flags
- Remove references to deprecated ENABLE_OPENTELEMETRY and OTEL_ENABLED
- Simplify run_tests_local.sh to use --exclude-tag=bluesky
- Update documentation to reflect instrumentation always enabled
- Remove legacy configuration section from README.md

All scripts now use the new approach where:
- OpenTelemetry instrumentation is always enabled
- Only data export is controlled by OTEL_EXPORT_ENABLED flag
- Cleaner configuration with single export control flag
2025-10-17 11:00:04 +02:00