crate / crate/sqlalchemy-cratedb
CI: Test against real CrateDB versions, and drop SQLAlchemy 1.3/1.4
- Dominant language
- Python
- Stars
- 9
- Forks
- 4
- Avg merge
- 6d 12h
- Merged PRs (30d)
- 3
Description
## Problem 1: the CrateDB version matrix has no effect on `pytest`
- Every pytest run uses `crate/crate:nightly` regardless of the matrix.
- Every CI job starts **two** CrateDB containers: the compose one on `:4200` and a testcontainer on a random port.
- `bootstrap.sh` defaults to `CRATEDB_VERSION=5.5.1`, which now implies a coverage level that doesn't exist.
This came up in #12: `sa.DATE` is storable on CrateDB 6.5 but rejected on 6.4 with `Type 'date' does not support storage`. We can't currently express that in CI.
## Problem 2: the SQLAlchemy 1.3/1.4 slots cost jobs and cover little
The matrix is 5 Python versions × 4 SQLAlchemy pins: 3 excludes + 1 prerelease = **18 jobs**.
Measured locally on the same test suite:
| SQLAlchemy | passed | skipped |
|---|---|---|
| 1.3.24 | 139 | 64 |
| 2.0.50 | 216 | 4 |
SQLAlchemy 1.3's last release was 1.3.24 in March 2021 and it is unmaintained; 1.4 is in maintenance only.
## Proposal
1. **Python × SQLAlchemy**, on one CrateDB version (nightly).
2. **CrateDB versions**, on one representative Python + SQLAlchemy combo, server compatibility.
3. Pass the version through in `conftest.py`
4. Drop `sqla-version: '<1.4'`, and decide on `'<1.5'`. Dropping both takes the main matrix from 18 → 11 jobs, and frees us to delete `compat/api13.py` and ~50 version guards.
5. Add a small CrateDB axis: oldest supported release / current stable / nightly.
6. Decide whether the compose instance is still needed, or whether `tests/integration.py` should move onto the same fixture and drop the hardcoded `:4200`.
Contributor guide
Research direction
Start by tracing the CI matrix and bootstrap.sh into conftest.py to see how the CrateDB version reaches pytest, then inspect tests/integration.py and the compose setup for the hardcoded :4200 instance. Done means the matrix selects the tested CrateDB versions, redundant containers and obsolete SQLAlchemy slots are resolved, and the resulting compatibility coverage is represented by passing CI jobs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, python, sqlalchemy
- Domain
- ci-cd, databases
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100