Repository navigation
4.1.1
A PATCH release: it fixes the entity-tag header parser and two faults of the migration environment, and adds checks to CI. No API change, no new endpoint or setting.
Fixed
app/core/etag.pyparsesIf-MatchandIf-None-Matchin one pass: it finds the quoted tags with a simple pattern and checks only the text between them. CodeQL alert 8 flagged the expression that validated the whole header as polynomial ReDoS; timing showed linear growth, so it was not exploitable, but that expression is gone. Hypothesis tests check that the parser accepts and rejects exactly what it did.migrations/env.pydisposes the database engine it creates, avoiding leaked connections when running Alembic in-process.migrations/env.pyno longer disables the application's loggers.fileConfigdefaulted todisable_existing_loggers=True, so a process that ran migrations itself lost its own logs from then on; random test order exposed it. A caller with its own logging can skipalembic.ini's logging withconfig.attributes["configure_logger"] = False.- Throwaway PostgreSQL databases from migration tests use the session naming convention (
ecom_pgtests_<epoch>_<hex>), allowing the stale database sweep to clean them up.
Added
- Static security analysis CI job
sastrunning Bandit 1.9.4 offline onapp/. - Migration compatibility CI job
migration-compat: the newest tagged release's database tests of orders, payments, checkout, carts, refunds, users and addresses, run against the current migrations on PostgreSQL 15; it ends at once whenmigrations/is unchanged since that tag. Also a PostgreSQL migration round-trip test (tests/integration/test_postgres_migration_roundtrip.py) intest-postgres. - Benchmark CI job
benchmarkcomparing hot path performance against the newest baseline frommain, failing when a median is more than 80% slower. - Dev dependencies
mypy,pytest-socket,pytest-randomly, andpytest-benchmark. - Mutation testing rerun on this release: 3,434 mutants, 98.7% detected. 31 of the 74 first-run survivors were gaps in the tests and are killed by new tests; the other 43 are equivalent.
Changed
- The
lintCI job now includes type checking withmypy(0 errors across 80 files);app/was annotated for it without a behaviour change. - The one Bandit finding,
HOST = "0.0.0.0"inapp/core/config.py, is marked# nosec B104with the reason: inside a container the port mapping decides what is exposed. - Test suite execution runs in randomized order by default via
pytest-randomly, printing the seed used for reproducibility. - Network access in the test suite is blocked by default via
pytest-socket, allowing only local and loopback connections.
Full list: CHANGELOG.md, compare: v4.1.0...v4.1.1