Skip to content

Strengthen CI and streamline test coverage#1

Merged
Subhransu-De merged 16 commits intomainfrom
feature/tests
Mar 28, 2026
Merged

Strengthen CI and streamline test coverage#1
Subhransu-De merged 16 commits intomainfrom
feature/tests

Conversation

@Subhransu-De
Copy link
Copy Markdown
Owner

Summary

This PR tightens the template's quality gates and reshapes the test strategy around fast, deterministic unit coverage. It adds Ruff and Ty to the CI/CD workflow, expands automated checks around application lifecycle and error handling, fixes startup-time database initialization issues, and removes the Docker-backed integration suite in favor of a leaner unit-only pipeline.

Change log

  • Adds CI/CD jobs for linting, type checking, test execution, and gated image builds.
  • Expands automated coverage for startup behavior, exception handling, logging, database session lifecycle, settings, and entity flows.
  • Fixes unexpected exception logging so fallback error handling records the real exception.
  • Refactors database engine and session initialization to avoid import-time failures during tooling and tests.
  • Standardizes project linting and type-checking with Ruff and Ty.
  • Removes Docker-based integration tests and their related dependencies to keep the pipeline faster and more stable.

Confidence code

0.92

Lazy-initialize the SQLAlchemy engine and session maker so they are not
created at import time, allowing tests to run without a live database.
Add a dummy default for database_url and update tests accordingly.
- Add ruff.toml with 30+ rule families (security, async, FastAPI, pytest, etc.)
- Ban relative imports and __future__ annotations (Python 3.13+)
- Rename BaseException → BaseError, NoEntityFoundException → NoEntityFoundError
- Replace id params with entity_id to avoid shadowing builtins
- Convert to absolute imports, modern type syntax, and Annotated dependencies
- Auto-fix trailing whitespace, import sorting, and deprecated typing imports
- Enable double quote enforcement, annotation checks, import conventions,
  implicit namespace package detection, and logging format rules
- Add missing type annotations across all source files
- Create app/__init__.py to satisfy INP001
- Convert alembic migration quotes to double quotes
- Create ty.toml with promoted rules: division-by-zero, deprecated,
  undefined-reveal, unused-awaitable, redundant-cast,
  redundant-final-classvar, possibly-missing-implicit-call,
  possibly-missing-submodule
- Ban getattr, setattr, hasattr via ruff flake8-tidy-imports
- Fix logger wrappers: remove **kwargs forwarding to match logging API
- Fix entity route: reorder params to avoid default-before-required
- Remove stale ty:ignore comment from settings
- Upgrade all deps (ty 0.0.13->0.0.26, ruff 0.14->0.15, fastapi, etc.)
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a679998372

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Makefile Outdated
uv run pytest tests/unit -m unit

test-integration:
uv run pytest tests/integration -m integration
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Remove stale integration test target

The new test-integration target points to tests/integration, but this commit only adds tests/unit/** and no tests/integration directory exists. As a result, make test-integration fails immediately instead of running any tests, which breaks any local or CI workflow still invoking this documented target.

Useful? React with 👍 / 👎.

@Subhransu-De Subhransu-De merged commit 0c2cf03 into main Mar 28, 2026
4 checks passed
@Subhransu-De Subhransu-De deleted the feature/tests branch March 29, 2026 05:58
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.

1 participant