Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ jobs:
run: uv run ruff check .
- name: ruff format
run: uv run ruff format --check .
- name: pyright
run: uv run pyright
- name: basedpyright
run: uv run basedpyright

test:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -64,4 +64,3 @@ jobs:
name: coverage-xml
path: coverage.xml
if-no-files-found: ignore

6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ repos:
args: [--fix]
- id: ruff-format

- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.391
- repo: https://github.com/DetachHead/basedpyright-prek-mirror
rev: v1.39.6
hooks:
- id: pyright
- id: basedpyright

- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.5.13
Expand Down
6 changes: 3 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ uv run pytest tests/test_parsers.py # one file
uv run pytest -k test_revert # one test by keyword
uv run ruff check . && uv run ruff format --check . # lint + format check
uv run ruff format . # auto-format
uv run pyright # type-check (strict mode for src/)
uv run basedpyright # type-check (strict mode for src/)
RIPTIDE_DB_URL=... uv run alembic upgrade head # apply migrations
RIPTIDE_DB_URL=... uv run alembic downgrade base # tear down
podman-compose up # local dev: Postgres + migrations + app on :8000
Expand Down Expand Up @@ -44,9 +44,9 @@ If `docker ps` fails, ask the user to start OrbStack.
- Single Python package, `riptide_collector` (flat top-level, not a namespace package). Future suite components (e.g. `riptide-api`, `riptide-dashboard`) get their own top-level package, e.g. `riptide_dashboard` — leave architectural room for them.
- Webhook routers are factories that return an `APIRouter`. Bitbucket needs the config for automation detection (`make_router(config, session_factory, auth_dep)`); Pipeline, ArgoCD, and Noergler don't, so they take just `(session_factory, auth_dep)`. They're wired up in `src/riptide_collector/main.py::create_app`. Add the config only when a router actually needs `automation` rules or team metadata.
- Pydantic schemas: **strict** for `/webhooks/pipeline` and `/webhooks/argocd` (we own the contract — invalid payloads must 422); **permissive raw-dict parsing** for Bitbucket (its payload shapes vary; we best-effort extract).
- Use `_as_dict()` / `_as_list()` helpers in `routers/bitbucket.py` to coerce arbitrary JSON shapes — pyright strict won't accept chained `.get()` on `Optional[dict]`.
- Use `_as_dict()` / `_as_list()` helpers in `routers/bitbucket.py` to coerce arbitrary JSON shapes — basedpyright strict won't accept chained `.get()` on `Optional[dict]`.
- Tests use real Postgres via testcontainers, never SQLite. The `client` fixture in `tests/conftest.py` depends on `session_factory` which truncates tables per test.
- `.pre-commit-config.yaml` runs ruff + pyright + uv-lock-check; expect CI to enforce the same.
- `.pre-commit-config.yaml` runs ruff + basedpyright + uv-lock-check; expect CI to enforce the same.

## Logging & Splunk

Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dev = [
"testcontainers[postgres]>=4.9",
"httpx>=0.28",
"ruff>=0.8",
"pyright>=1.1.391",
"basedpyright>=1.39.6",
"pre-commit>=4.0",
]

Expand All @@ -49,7 +49,7 @@ ignore = ["E501"]
"migrations/**" = ["E", "F", "I", "B", "UP", "SIM", "RUF"]
"tests/**" = ["B"]

[tool.pyright]
[tool.basedpyright]
pythonVersion = "3.13"
include = ["src", "tests", "migrations"]
exclude = ["**/__pycache__", "**/.venv"]
Expand All @@ -61,12 +61,12 @@ reportUnknownMemberType = false
reportUnknownVariableType = false
reportUnknownArgumentType = false

[[tool.pyright.executionEnvironments]]
[[tool.basedpyright.executionEnvironments]]
root = "tests"
reportPrivateUsage = false
reportUnknownLambdaType = false

[[tool.pyright.executionEnvironments]]
[[tool.basedpyright.executionEnvironments]]
root = "migrations"
reportPrivateUsage = false

Expand Down
45 changes: 30 additions & 15 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.