Fix SQLite CI test failures: UUID binding, func.now() defaults, F402 lint (CAR-1012) #40
Closed
Barcode Betty
wants to merge 2 commits from
betty/fix-ci-test-failures-v2 into dev
pull from: betty/fix-ci-test-failures-v2
merge into: cartsnitch:dev
cartsnitch:main
cartsnitch:dev
cartsnitch:uat
cartsnitch:betty/car-1362-cache-remove-uat
cartsnitch:betty/car-1362-push-unknown-fix
cartsnitch:betty/car-1362-remove-gha-cache-dev
cartsnitch:betty/car-1330-buildpush-registry-token-dev
cartsnitch:betty/car-1330-buildpush-registry-token-uat
cartsnitch:betty/car-1330-dev-ci-fix
cartsnitch:betty/car-1340-uat-ci-fix
cartsnitch:barcode-betty/fix-car-1135-dispose-engine
cartsnitch:betty/car-1132-comprehensive-fix
cartsnitch:promote/car1077-dev-uat
cartsnitch:betty/fix-postgres-pool
cartsnitch:betty/fix-sqlite-uuid-server-default
cartsnitch:remove-deploy-dev-uat-jobs
cartsnitch:betty/fix-ci-test-failures
cartsnitch:barcode-betty/fix-lint-f402
cartsnitch:betty/fix-email-inbound-token-tests
cartsnitch:barcode-betty/car-1004-fix-ruff-lint
cartsnitch:betty/fix-lint-errors
cartsnitch:fix/cart-995-gitea-registry-migration
cartsnitch:fix-gitea-registry-migration
cartsnitch:betty/car-995-gitea-registry
cartsnitch:betty/car-932-dispose-import-v3
cartsnitch:barcode-betty/car-995-gitea-registry
cartsnitch:betty/car-932-fix-dispose-engine
cartsnitch:betty/car-964-gitea-registry-v2
cartsnitch:barcode-betty/gitea-registry
cartsnitch:barcode-betty/fix-dispose-engine-import
cartsnitch:savannah/fix-ci-uat-trigger
cartsnitch:barcode-betty/fix-ci-uat-trigger
cartsnitch:betty/car-869-gitea-actions-api
cartsnitch:betty/car-723-final-review
cartsnitch:betty/car-723-ci-workflow
cartsnitch:feat/car-723-migrate-api-to-new-repo
No Reviewers
Dismiss Review
Are you sure you want to dismiss this review?
Labels
Clear labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
Something isn't working
Improvements or additions to documentation
This issue or pull request already exists
New feature or request
Good for newcomers
Extra attention is needed
This doesn't seem right
Further information is requested
This will not be worked on
No Label
Milestone
No items
No Milestone
Projects
Clear projects
No project
Assignees
ai-review (AI Review)
cs_betty (Barcode Betty)
cs_charlie (Checkout Charlie)
cpfarhood (Chris Farhood)
ci (Continuous Integration [bot])
cs_carl (Coupon Carl)
cs_dottie (Deal Dottie)
flux (Flux CD)
admin (Gitea Admin)
cs_martha (Markdown Martha)
renovate (Mend Renovate)
cs_savannah (Savannah Savings)
cs_steve (Stockboy Steve)
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cartsnitch/api#40
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "betty/fix-ci-test-failures-v2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes three remaining CI test failures from PR #35 review:
tableshadowed importedtableintest_encrypted_json.pyTimestampMixinandPurchase.ingested_atused PostgreSQL-onlyserver_default=func.now()— stripped in fixtures AND given Python-sidedefault=_utcnowuuid.UUIDobjects — addedaiosqlite.register_adapter()for async engine andGuidTypeTypeDecorator for cross-DB UUID handlingFiles changed
src/cartsnitch_api/types.py— newGuidTypeTypeDecorator (UUID to String)src/cartsnitch_api/models/base.py—TimestampMixinaddsdefault=_utcnow,UUIDPrimaryKeyMixinusesGuidTypesrc/cartsnitch_api/models/user.py—User.idusesGuidType()plusMapped[uuid.UUID],email_verifiedaddsdefault=Falsesrc/cartsnitch_api/models/purchase.py—ingested_ataddsdefault=_utcnowtests/conftest.py— stripsfunc.now()from server_defaults, addsaiosqlite.register_adapter(uuid.UUID, ...)tests/test_encrypted_json.py— fixes F402, stripsfunc.now()Test results
test_encrypted_json.pytests passtest_models.pytests pass/api/v1but tests hit/storeswithout prefix — unrelated to this fix)cc @cpfarhood
QA Review — CAR-1012
Reviewed PR #40 against https://cartsnitch.dev.farh.net. The UUID/SQLite fix itself is solid — the model-layer tests pass. But CI is failing in three ways, all unrelated to the SQLite/UUID fix:
CI Failures
config.py,cache.py,rate_limit.py— all pre-existing, existed before this PR404 Not Foundbecause routes are mounted at/api/v1but tests hit/stores,/products, etc. without the prefix. Pre-existing routing configuration issue, not caused by this PRWhat IS working
test_encrypted_json.py: all 6 tests pass (UUID binding works)test_models.py: all 17 tests pass (server_default stripping works)GuidType) andfunc.now()Python-side defaults are correctly implementedAction Required
Request changes — the lint failure must be fixed before merge. Format the code with
ruff formatand ensure it passes.The typecheck and test failures are pre-existing and should be tracked in separate issues; they should not block this PR from merging once lint is fixed.
Screenshot: test job showing 116× 404 failures (pre-existing routing mismatch)
Pull request closed