From 2f1e13818a2108f1a7280d6810dfa548ca8afb01 Mon Sep 17 00:00:00 2001 From: Aditya Ghyar Date: Thu, 9 Jul 2026 14:20:45 +0530 Subject: [PATCH 1/3] ci: add lint, coverage, and Trivy quality gates --- .github/workflows/ci.yml | 6 ++++++ requirements.txt | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0860149..f0a4c9f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,6 +52,12 @@ jobs: - name: Run tests run: python -m pytest -v + - name: Lint with Ruff + run: ruff check . + + - name: Run tests with coverage gate + run: python -m pytest --cov=app --cov-report=term-missing --cov-fail-under=80 + - name: Generate coverage report run: python -m pytest --cov=app --cov-report=term-missing diff --git a/requirements.txt b/requirements.txt index c72d4a8..8b9fa60 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,4 +9,5 @@ email-validator alembic pytest-cov pytest -httpx \ No newline at end of file +httpx +Ruff \ No newline at end of file From b6b31b248c2b0585636c37af8ae40f2f1859ae40 Mon Sep 17 00:00:00 2001 From: Aditya Ghyar Date: Thu, 9 Jul 2026 14:21:24 +0530 Subject: [PATCH 2/3] ci: add lint, coverage, and Trivy quality gates --- .github/workflows/ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f0a4c9f..ff352ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,9 +57,7 @@ jobs: - name: Run tests with coverage gate run: python -m pytest --cov=app --cov-report=term-missing --cov-fail-under=80 - - - name: Generate coverage report - run: python -m pytest --cov=app --cov-report=term-missing + publish: if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') From 206573c0a2e416c0bb84a27c38e42083b1861247 Mon Sep 17 00:00:00 2001 From: Aditya Ghyar Date: Thu, 9 Jul 2026 14:39:50 +0530 Subject: [PATCH 3/3] ci: add lint, coverage, and Trivy quality gates --- alembic/env.py | 2 -- pyproject.toml | 2 ++ tests/test_tasks.py | 1 - tests/test_users.py | 1 - 4 files changed, 2 insertions(+), 4 deletions(-) create mode 100644 pyproject.toml diff --git a/alembic/env.py b/alembic/env.py index e27b8d7..8b817c8 100644 --- a/alembic/env.py +++ b/alembic/env.py @@ -40,8 +40,6 @@ # target_metadata = None # replacing with the actual metadata from models from app.db.base import Base -from app.models.user import User -from app.models.task import Task target_metadata = Base.metadata diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..2bebdde --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,2 @@ +[tool.ruff.lint.per-file-ignores] +"alembic/env.py" = ["E402", "F401"] \ No newline at end of file diff --git a/tests/test_tasks.py b/tests/test_tasks.py index 3a4d009..dd06af5 100644 --- a/tests/test_tasks.py +++ b/tests/test_tasks.py @@ -1,4 +1,3 @@ -import pytest def create_user(client): response = client.post( diff --git a/tests/test_users.py b/tests/test_users.py index 4421cd1..d390cc9 100644 --- a/tests/test_users.py +++ b/tests/test_users.py @@ -1,4 +1,3 @@ -import pytest def test_create_user(client):