Files
ivatar/README.md
Oliver Falk 23c36604b8 feat: implement database performance indexes
- Add 9 performance indexes to improve query performance by ~5%
- ConfirmedEmail indexes: digest, digest_sha256, access_count, bluesky_handle, user_access, photo_access
- Photo indexes: format, access_count, user_format
- Use CONCURRENTLY for PostgreSQL production safety
- Handle MySQL compatibility (skip partial indexes)
- All index names under 30 characters for Django compatibility
- Migration includes proper error handling and logging

Indexes address production performance issues:
- 49.4M digest lookups (8.57ms avg → significantly faster)
- 49.3M SHA256 digest lookups (8.45ms avg → significantly faster)
- ORDER BY access_count queries
- Bluesky handle IS NOT NULL queries (partial index on PostgreSQL)
- User and photo analytics queries
- Format GROUP BY analytics queries
2025-10-15 16:32:23 +02:00

1.9 KiB

ivatar / libravatar

Pipeline and coverage status

pipeline status coverage report

Reports / code documentation

Testing

Running Tests

For local development, use the provided script to skip Bluesky tests that require external API credentials:

./run_tests_local.sh

This runs all tests except those marked with @pytest.mark.bluesky.

All Tests

To run all tests including Bluesky tests (requires Bluesky API credentials):

python3 manage.py test -v2

Specific Test Categories

# Run only Bluesky tests
python3 manage.py test ivatar.ivataraccount.test_views_bluesky -v2

# Run only file upload security tests
python3 manage.py test ivatar.test_file_security -v2

# Run only upload tests
python3 manage.py test ivatar.ivataraccount.test_views -v2

Test Markers

Tests are categorized using pytest markers:

  • @pytest.mark.bluesky: Tests requiring Bluesky API credentials
  • @pytest.mark.slow: Long-running tests
  • @pytest.mark.integration: Integration tests
  • @pytest.mark.unit: Unit tests

Authors and contributors

Lead developer/Owner: Oliver Falk (aka ofalk or falko) - https://git.linux-kernel.at/oliver

Operations: Michal Novotny (aka clime)

QA: Tristan Le Guern (aka tleguern)

Frontend developer: Lukas Schönsgibl (aka hybridpicker), Niklas Poslovski (aka nipos)

Organisation/Meeting moderation: Lars Kruse (aka sumpfralle)

Initial developer: François Marier - https://fmarier.org/