Skip to content

Feature: Add CI workflow for linting, testing, and security scanning#25

Merged
duartebarbosadev merged 16 commits intomainfrom
feature-ci/cd
Aug 10, 2025
Merged

Feature: Add CI workflow for linting, testing, and security scanning#25
duartebarbosadev merged 16 commits intomainfrom
feature-ci/cd

Conversation

@duartebarbosadev
Copy link
Copy Markdown
Owner

@duartebarbosadev duartebarbosadev commented Aug 9, 2025

This pull request introduces significant improvements to the project's CI/CD pipeline, test coverage enforcement, and unit testing for the image rotation detection feature. The most important changes are the addition of a comprehensive GitHub Actions workflow for CI, basic security scanning, and PR summaries; enforcement of a minimal coverage threshold; and new, focused unit tests for the rotation detector. These changes collectively enhance code quality, reliability, and maintainability.

CI/CD and Quality Enforcement

  • Added a new .github/workflows/ci.yml GitHub Actions workflow that runs linting, testing (with coverage), basic security scanning, and generates PR summaries. This workflow includes scheduled weekly runs and concurrency control to prevent overlapping CI jobs.
  • Introduced a minimal coverage threshold for tests via pytest.ini, ensuring that builds fail if coverage drops below 8%. This sets a baseline for gradually increasing coverage.
  • Updated requirements-dev.txt to explicitly list testing and linting tools (pytest, pytest-cov, ruff), improving clarity and reproducibility of the development environment.

Testing Enhancements

  • Added a new unit test suite (tests/test_model_rotation_detector_unit.py) for the ModelRotationDetector, covering lazy initialization, prediction logic when the model is missing, stubbed session behavior, and disabled mode handling. This improves the reliability and testability of the image rotation detection feature.

Documentation

  • Updated the developer guide (DEVELOPER_GUIDE.md) to include a new section on adding image feature pipelines, supporting future extensibility and onboarding.

These changes collectively improve the project's CI reliability, code quality enforcement, and test coverage.

This comment was marked as outdated.

@duartebarbosadev duartebarbosadev marked this pull request as ready for review August 10, 2025 14:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a comprehensive CI/CD pipeline with GitHub Actions, enforces basic test coverage requirements, and restructures the test suite for better organization and reliability. The changes include adding automated workflows for linting, testing, and security scanning, while removing problematic GUI-heavy tests in favor of focused unit tests.

  • Adds a complete GitHub Actions CI workflow with linting, testing, coverage enforcement, and basic security scanning
  • Introduces test coverage enforcement with an 8% minimum threshold via pytest configuration
  • Replaces unstable GUI integration tests with focused unit tests for the ModelRotationDetector
  • Removes empty package __init__.py files and improves import handling for optional dependencies

Reviewed Changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
.github/workflows/ci.yml Comprehensive CI workflow with lint, test, security scan, and PR summary jobs
pytest.ini Coverage threshold configuration enforcing 8% minimum
requirements-dev.txt Development dependencies including pytest, pytest-cov, and ruff
tests/test_model_rotation_detector_unit.py New focused unit tests for ModelRotationDetector
tests/test_rotation_accept_unit.py Removed unstable GUI-dependent tests
tests/test_rotation_accept_integration.py Removed integration tests dependent on sample folder
src/core/image_pipeline.py Improved optional import handling for PIL.ImageQt
Various __init__.py files Removed empty package initialization files
DEVELOPER_GUIDE.md Minor formatting addition

duartebarbosadev and others added 3 commits August 10, 2025 15:50
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@duartebarbosadev duartebarbosadev merged commit 342a2c5 into main Aug 10, 2025
3 checks passed
@duartebarbosadev duartebarbosadev deleted the feature-ci/cd branch August 10, 2025 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants