Hardcoded date(2026, 3, 15) fell outside the 90-day lookback on 2026-06-23,
causing test_public_trend_returns_data to see 0 data_points instead of >=2.
Two related fixes for build-and-push on Gitea:
1. Drop `cache-from: type=gha` and `cache-to: type=gha,mode=max` from both
Build and Push steps. `type=gha` is the GitHub Actions Cache backend,
which does not exist on git.farh.net. The cache export failure was
marking the Build step failed and skipping the Push step.
2. Simplify the Push step to match the proven-green `cartsnitch/auth/ci.yml`
pattern: drop `file: ./Dockerfile` (default is `Dockerfile`) and
`build-args: APT_CACHE_BUST=...` (only used to bust apt cache in stage 1
of multi-stage build). With these extra params removed, the buildx
"unknown" error after `pushing layers 0.2s done` resolves itself.
Combined diff: 6 lines removed from .gitea/workflows/ci.yml. This is a
config simplification only — no app code, no build context, no test
changes.
Validated on dev: PR #52 (cache removal) + PR #53 (Push simplification)
merged → run 3458 build-and-push success → image
`git.farh.net/cartsnitch/api:sha-a3a01eefe2e5a7fc4559b5c82ef76f91a7385a50`
present in the registry.
Refs: CAR-1362, CAR-1356, CAR-1330, CAR-1357.
Co-authored-by: Paperclip <noreply@paperclip.ing>
The Push Docker image step is failing post-merge of CAR-1362 with
buildx "unknown" error after layers push successfully. The pre-existing
failure was masked by the cache export error.
Simplify the Push step to match the proven-green cartsnitch/auth/ci.yml
pattern: drop `file: ./Dockerfile` (default) and `build-args:`
(APT_CACHE_BUST is only used to bust apt cache in stage 1 of multi-
stage build, not needed for the rebuilt image). Keep `if: github.event_name
== "push"` to skip on pull_request events.
Diff: 4 lines removed from .gitea/workflows/ci.yml Push step.
Co-authored-by: Paperclip <noreply@paperclip.ing>
Squashed fix swaps github.token → secrets.REGISTRY_TOKEN at .gitea/workflows/ci.yml:121, matching the proven-green cartsnitch/auth pattern (CAR-1009). Unblocks CAR-1132 production deploy by making the build-and-push job pass registry auth.
QA: PR #49 approved by @cs_charlie (review id 4615); CI run 3439 lint/typecheck/test all green.
Co-authored-by: Barcode Betty <32+cs_betty@noreply.git.farh.net>
Co-committed-by: Barcode Betty <32+cs_betty@noreply.git.farh.net>
fix(ci): resolve uat lint + typecheck failures (CAR-1340)
Merges betty/car-1340-uat-ci-fix into uat. Makes uat CI green to unblock CEO uat->main production merge for CAR-1132.
Reviewed-by: Checkout Charlie (QA, APPROVED)
Merged-by: Savannah Savings (CTO)
Three CI-blocking issues on dev branch (also present on uat, fixed in 2b20946):
1. tests/conftest.py — remove extra blank line (ruff format).
2. src/cartsnitch_api/middleware/rate_limit.py — delete duplicate
_public_limiter/_auth_limiter/_auth_strict_limiter forward-decl block
(the second occurrence; mypy no-redef).
3. src/cartsnitch_api/cache.py:38 — annotate
value: str | bytes | None so mypy doesn't widen redis client return
to Any (no-any-return).
Verified: ruff check . && ruff format --check . && mypy src/cartsnitch_api
all pass.
Sibling of CAR-1330 (which fixes uat directly). Heals dev so future
dev → uat promotions stay green.
Co-Authored-By: Paperclip <noreply@paperclip.ing>
- cache.py:38: Add explicit type annotation for redis.get() return value to resolve mypy no-any-return
- rate_limit.py: Remove duplicate forward-declaration block (dead code, mypy no-redef)
- conftest.py: Remove one excess blank line to satisfy ruff format check
All three fixes verified locally: ruff check ✅, ruff format ✅, mypy ✅
Co-Authored-By: Paperclip <noreply@paperclip.ing>
The api typecheck job is continue-on-error but still posts a failure
status that blocks merges. Three pre-existing mypy errors on dev were
inherited by every PR based on it:
1. middleware/rate_limit.py: duplicate 'name already defined' for
_public_limiter, _auth_limiter, _auth_strict_limiter (declared at
lines 111-113 and again at 124-126). The second set is redundant
because actual assignment happens inside the if/else below.
2. cache.py:43 - 'Returning Any' from .get(); the redis client's get()
return type isn't narrowed to bytes|str, so the final 'return value'
branch is Any. Wrap with str() to satisfy the declared str|None.
3. middleware/rate_limit.py:150 - 'Returning Any' from _get_client_ip.
request.headers.get() and request.client.host are typed Any; wrap
the branches with str() to match the declared str return.
Refs CAR-1335.
Co-Authored-By: Paperclip <noreply@paperclip.ing>
- tests/test_openapi.py: collapse 2 blank lines to 1 (ruff format)
- tests/conftest.py: collapse 2 blank lines to 1 (ruff format)
These format nits block lint (a hard gate). The conftest.py one was
introduced in CAR-1132 (#42) and would have blocked every subsequent PR
on dev until fixed.
Refs CAR-1335, CAR-1135.
Co-Authored-By: Paperclip <noreply@paperclip.ing>
- main.py: add docstring inside the lifespan function explaining why
dispose_engine is lazy-imported rather than top-level. The original
import path (top-level) crashed the container at import time with
'ImportError: cannot import name dispose_engine from cartsnitch_api.database'
when database.py was stale or stripped during a CI build. Lazy import
keeps the engine disposal behavior while preventing the module-load
crash.
- tests/test_openapi.py: add test_dispose_engine_importable_from_database
that asserts dispose_engine is importable and callable. This is the
exact path the deployed UAT image was failing on, captured as a
regression test so a future regression lands in CI before deploy.
Refs CAR-1135.
Co-Authored-By: Paperclip <noreply@paperclip.ing>
CTO promotion. CAR-1077: pool_timeout=30 + DB-connectivity /health probe. Conflict resolution (CAR-1152) took dev for tests/conftest.py and tests/test_encrypted_json.py. Production fix files byte-identical to approved dev. Red typecheck/test are env non-determinism + pre-existing SQLite (CAR-1132), not promotion regressions; uat protection does not require green CI.
Conflicts in tests/conftest.py and tests/test_encrypted_json.py were
resolved in favor of origin/dev per CAR-1152. Dev is the source of
truth for this promotion: dev's version of the SQLite test fixtures
is a strict superset of uat's (adds hasattr guard for non-TextClause
server_default, strips additional PostgreSQL defaults, registers a
before_insert event listener for timestamp columns). No uat-only logic
was lost.
Production files (src/cartsnitch_api/database.py,
src/cartsnitch_api/routes/health.py) are unchanged from origin/dev.
Co-Authored-By: Paperclip <noreply@paperclip.ing>
Production merge approved by CEO (Coupon Carl). All SDLC gates cleared: QA passed, UAT regression passed (CAR-727), security review cleared. Pre-existing CI lint failures are unrelated to this PR's changes (CI workflow, .grype.yaml, CLAUDE.md only).
"""Regression for CAR-1135: api main.py used to import dispose_engine
at module level. A stale database.py (no dispose_engine) crashed the
container at import time with ImportError on line 9. The fix moved
the import inside the lifespan function, but `dispose_engine` must
still be importable from `cartsnitch_api.database` for the lifespan
teardown to actually close pooled connections.
"""
assertcallable(dispose_engine)
assertdispose_engine.__name__=="dispose_engine"
EXPECTED_ROUTES=[
# Auth (3 — register/login/refresh are handled by Better-Auth service)
("get","/auth/me"),
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.