This commit introduces a Semgrep ignore file to suppress false positives and low-risk findings, particularly for controlled inputs in database scripts and development configurations. Additionally, a new CI Job Status Configuration document is added to clarify which CI jobs should fail on errors and which are informational, enhancing the overall CI/CD process documentation.
This commit modifies several test cases to reflect changes in the API response structure, including:
- Updating assertions to check for `tag_name` instead of `tag` in tag-related tests.
- Adjusting the response data checks for bulk add/remove favorites to use `added_count` and `removed_count`.
- Ensuring the photo search test verifies the linked face and checks for the presence of the photo in the results.
These changes enhance the accuracy and reliability of the tests in relation to the current API behavior.
This commit adds blank lines to the end of several files, including pytest.ini, README.md, and various scripts in the viewer-frontend. These changes enhance the readability and maintainability of the codebase by ensuring consistent formatting.
The test for photo deletion now checks for "deleted_count" in the response data, ensuring that the count of deleted photos is non-negative. This change aligns the test with the actual API response structure.
- Fix DELETE endpoint test to accept 204 (No Content) status code
- Fix PhotoTag import to PhotoTagLinkage (correct model name)
- Fix Tag model instantiation to use tag_name instead of tag
- Update photo search test to use partial name matching (John instead of John Doe)
The SSE endpoint returns 'text/event-stream; charset=utf-8' but the test
was checking for an exact match. Update the test to use startswith() to
handle the charset parameter correctly.
- Add test_api_photos.py with photo search, favorites, retrieval, and deletion tests
- Add test_api_people.py with people listing, CRUD, and faces tests
- Add test_api_tags.py with tag listing, CRUD, and photo-tag operations tests
- Add test_api_users.py with user listing, CRUD, and activation tests
- Add test_api_jobs.py with job status and streaming tests
- Add test_api_health.py with health check and version tests
These tests expand CI coverage based on API_TEST_PLAN.md and will run in the CI pipeline.
This commit modifies the CI workflow to utilize the virtual environment's pip and python directly, avoiding shell activation issues. Additionally, it enhances the CI workflow summary by providing a clearer overview of job results, including detailed descriptions of each job's purpose and how to interpret the backend test results. This improves the overall clarity and usability of the CI process.
This commit introduces a Gitleaks configuration file to manage known false positives and improve security by preventing the accidental exposure of sensitive information. Additionally, it enhances the CI workflow by adding a step to validate backend imports and application structure, ensuring that core modules and API routers can be imported successfully without starting the server or connecting to a database.
This commit updates the CI workflow summary to provide a clearer overview of job results and their purposes. It also modifies the JWT token generation in the authentication API to include a unique identifier (`jti`) for both access and refresh tokens, improving token management. Additionally, the test for the token refresh endpoint is adjusted to ensure it verifies the new access token correctly.
This commit replaces hardcoded sensitive information, such as database passwords and secret keys, in the README and deployment documentation with placeholders and instructions to use environment variables. This change enhances security by preventing exposure of sensitive data in the codebase. Additionally, it updates the database session management to raise an error if the DATABASE_URL environment variable is not set, ensuring proper configuration for development environments.
This commit introduces a custom security dependency, `get_bearer_token`, in the authentication API to ensure compliance with HTTP standards by returning a 401 Unauthorized status for missing or invalid tokens. Additionally, it updates test user fixtures to include full names for better clarity in tests.
This commit introduces a new `pytest.ini` configuration file for backend tests, specifying test discovery patterns and output options. Additionally, the CI workflow is updated to set an environment variable that prevents DeepFace and TensorFlow from loading during tests, avoiding illegal instruction errors on certain CPUs. The face service and pose detection modules are modified to conditionally import DeepFace and RetinaFace based on this environment variable, enhancing test reliability. These changes improve the testing setup and contribute to a more robust CI process.
This commit enhances the CI workflow by adding steps to create test databases and install new testing dependencies, including `pytest`, `httpx`, and `pytest-cov`. Additionally, comprehensive test plan documentation is introduced to outline the structure and best practices for backend API tests. These changes improve the testing environment and contribute to a more robust CI process.
This commit introduces a new API for managing pending tag linkages, allowing admins to review and approve or deny user-suggested tags. The frontend has been updated with a new User Tagged Photos page for displaying pending linkages, including options for filtering and submitting decisions. Additionally, the Layout component has been modified to include navigation to the new page. Documentation has been updated to reflect these changes.
This commit improves the `run_api_with_worker.sh` script by ensuring the virtual environment is created if it doesn't exist and dependencies are installed. It also adds a check to ensure the database schema is up to date. Additionally, new functionality has been introduced to calculate and store file hashes for uploaded photos, preventing duplicates. The database schema has been updated to include a `file_hash` column in the `photos` table, along with an index for efficient querying. The frontend has been updated to handle warnings for duplicate photos during the review process. Documentation has been updated to reflect these changes.
This commit adds a new command-line interface (CLI) and graphical user interface (GUI) components for the PunimTag desktop application. The `photo_tagger.py` script serves as the CLI entry point, enabling users to scan, process, and manage photos with facial recognition capabilities. The GUI includes a unified dashboard with various panels for identifying, modifying, and managing tags for photos. Additionally, comprehensive documentation has been created to guide users through installation and usage, ensuring a smooth experience. This update enhances the overall functionality and accessibility of the PunimTag application.
This commit introduces the Modify Identified workflow, allowing users to edit person information, view associated faces, and unmatch faces from identified people. The API has been updated with new endpoints for unmatching faces and retrieving faces for specific persons. The frontend includes a new Modify page with a user-friendly interface for managing identified persons, including search and edit functionalities. Documentation and tests have been updated to reflect these changes, ensuring reliability and usability.
This commit introduces a new feature in the Identify component that allows users to filter for unique faces only, hiding duplicates with ≥60% match confidence. The API has been updated to log calls to the get_similar_faces endpoint, including warnings for non-existent faces and information on the number of results returned. Additionally, the SimilarFaceItem schema has been updated to include the filename, improving data handling and user experience. Documentation and tests have been updated accordingly.
This commit enhances the README with detailed instructions on the automatic database initialization and schema compatibility between the web and desktop versions. It also introduces new API endpoints for managing unidentified faces and people, including listing, creating, and identifying faces. The schemas for these operations have been updated to reflect the new data structures. Additionally, tests have been added to ensure the functionality of the new API features, improving overall coverage and reliability.
This commit introduces a comprehensive EXIF orientation handling system to improve face processing accuracy. Key changes include the addition of an `exif_orientation` field in the database schema, updates to the `FaceProcessor` class for applying orientation corrections before face detection, and the implementation of a new `EXIFOrientationHandler` utility for managing image orientation. The README has been updated to document these enhancements, including recent fixes for face orientation issues and improved face extraction logic. Additionally, tests for EXIF orientation handling have been added to ensure functionality and reliability.
This commit refactors the handling of face location data to exclusively use the DeepFace format ({x, y, w, h}) instead of the legacy tuple format (top, right, bottom, left). Key changes include updating method signatures, modifying internal logic for face quality score calculations, and ensuring compatibility in the GUI components. Additionally, configuration settings for face detection have been adjusted to allow for smaller face sizes and lower confidence thresholds, enhancing the system's ability to detect faces in various conditions. All relevant tests have been updated to reflect these changes, ensuring continued functionality and performance.
This commit adds final notes to the migration documentation and quickstart files, confirming readiness for DeepFace implementation across all phases. The updates include completion confirmations in `DEEPFACE_MIGRATION_COMPLETE.md`, `PHASE1_COMPLETE.md`, `PHASE2_COMPLETE.md`, and `PHASE3_COMPLETE.md`, as well as quickstart notes in `.notes/phase1_quickstart.md` and `.notes/phase2_quickstart.md`. These changes ensure clarity on the project's progress and readiness for the next steps in the DeepFace integration.
This commit introduces several new documents summarizing the completion of Phase 6, which focused on testing and validation of the DeepFace integration. Key deliverables include a detailed testing guide, validation checklist, test results report, and a quick reference guide. All automated tests have passed, confirming the functionality and performance of the integration. The documentation provides insights into the testing process, results, and next steps for manual GUI testing and user acceptance validation, ensuring clarity and thoroughness for future development and deployment.
This commit finalizes the migration from face_recognition to DeepFace across all phases. It includes updates to the database schema, core processing, GUI integration, and comprehensive testing. All features are now powered by DeepFace technology, providing superior accuracy and enhanced metadata handling. The README and documentation have been updated to reflect these changes, ensuring clarity on the new capabilities and production readiness of the PunimTag system. All tests are passing, confirming the successful integration.
This commit introduces several new files to enhance project organization and developer onboarding. The `.cursorignore` and `.cursorrules` files provide guidelines for Cursor AI, while `CONTRIBUTING.md` outlines contribution procedures. Additionally, `IMPORT_FIX_SUMMARY.md`, `RESTRUCTURE_SUMMARY.md`, and `STATUS.md` summarize recent changes and project status. The `README.md` has been updated to reflect the new project focus and structure, ensuring clarity for contributors and users. These additions aim to improve maintainability and facilitate collaboration within the PunimTag project.