Небольшое FastAPI-приложение, которое используется как песочница для тестирования бота-ревьюера: к репозиторию открываются "хорошие" и "плохие" pull request-ы, а бот их комментирует.
- Python 3.11+
- FastAPI / Uvicorn
- Pydantic v2
- Pytest + httpx (тесты через
TestClient) - Ruff (линт + формат)
Хранилище — in-memory, БД нет.
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"uvicorn app.main:app --reload- Swagger UI: http://localhost:8000/docs
- Healthcheck: http://localhost:8000/health
| Метод | Путь | Назначение |
|---|---|---|
| GET | /health |
Healthcheck |
| GET | /tasks |
Список всех задач |
| POST | /tasks |
Создать задачу |
| GET | /tasks/{id} |
Получить по id |
| PUT | /tasks/{id} |
Полное обновление |
| PATCH | /tasks/{id} |
Частичное обновление |
| DELETE | /tasks/{id} |
Удалить |
Пример:
curl -X POST http://localhost:8000/tasks \
-H 'Content-Type: application/json' \
-d '{"title": "buy milk"}'pytest
ruff check .
ruff format --check .GitHub Actions (.github/workflows/ci.yml) на каждый push в main и каждый pull request гоняет:
ruff check .ruff format --check .pytest -q