CI: make the pipeline green (lint/format/mypy debt, respx dev dep, cwd-dependent test, Alembic drift, ESLint) #41

Closed
opened 2026-07-15 15:33:05 +00:00 by claude-bot · 2 comments
Contributor

Split from #40. CI has failed on all 52 runs; every cause was reproduced locally and is a real code issue. Fixing this unblocks #5, #10, and the 5 open Renovate PRs (#35–#39).

Tasks

  • ruff check clean: 159 violations (60 auto-fixable via ruff check --fix)
  • ruff format: 56 of 83 files need reformatting
  • mypy app/: 75 errors in 17 files (callable used as a type in services/recurrence.py:133, missing generic args, untyped defs, app/main.py attr-defined errors)
  • Add respx to the dev dependency group in backend/pyproject.toml (tests import it directly; pytest-httpx is listed but unused by those tests) — without it pytest fails at collection
  • Fix tests/test_import_export.py::test_builtin_yaml_covers_bundled_events: opens config/events.yaml relative to cwd; CI runs from backend/. Resolve the path from the repo root (e.g. anchor on __file__)
  • Alembic drift: models no longer declare ix_sessions_expires_at, ix_sessions_subject, ix_webhook_configs_enabled but no migration drops them — add migration 0008 (or restore the indexes) so alembic check passes
  • Fix @typescript-eslint/no-empty-object-type in frontend/src/components/ui/input.tsx:4
  • Consider committing backend/uv.lock (already generated, untracked) for reproducible CI
  • While in there: datetime.utcnow() is deprecated everywhere (13k+ warnings) — mechanical swap to datetime.now(UTC)

Acceptance

  • All CI jobs green on main
  • Renovate PRs re-run and mergeable
Split from #40. CI has failed on all 52 runs; every cause was reproduced locally and is a real code issue. Fixing this unblocks #5, #10, and the 5 open Renovate PRs (#35–#39). ## Tasks - [ ] `ruff check` clean: 159 violations (60 auto-fixable via `ruff check --fix`) - [ ] `ruff format`: 56 of 83 files need reformatting - [ ] `mypy app/`: 75 errors in 17 files (`callable` used as a type in `services/recurrence.py:133`, missing generic args, untyped defs, `app/main.py` attr-defined errors) - [ ] Add `respx` to the `dev` dependency group in `backend/pyproject.toml` (tests import it directly; `pytest-httpx` is listed but unused by those tests) — without it pytest fails at collection - [ ] Fix `tests/test_import_export.py::test_builtin_yaml_covers_bundled_events`: opens `config/events.yaml` relative to cwd; CI runs from `backend/`. Resolve the path from the repo root (e.g. anchor on `__file__`) - [ ] Alembic drift: models no longer declare `ix_sessions_expires_at`, `ix_sessions_subject`, `ix_webhook_configs_enabled` but no migration drops them — add migration 0008 (or restore the indexes) so `alembic check` passes - [ ] Fix `@typescript-eslint/no-empty-object-type` in `frontend/src/components/ui/input.tsx:4` - [ ] Consider committing `backend/uv.lock` (already generated, untracked) for reproducible CI - [ ] While in there: `datetime.utcnow()` is deprecated everywhere (13k+ warnings) — mechanical swap to `datetime.now(UTC)` ## Acceptance - [ ] All CI jobs green on main - [ ] Renovate PRs re-run and mergeable
claude-bot added this to the v1.0.0 milestone 2026-07-15 15:33:05 +00:00
Author
Contributor

Picking this up as the keystone of the v1.0.0 milestone — it blocks #5, #10, #56, #58, #64 and the Renovate PRs. Working it first, in isolation, so the rest of the milestone rebases on a green pipeline. Will report the fixes per task on completion.

Picking this up as the keystone of the v1.0.0 milestone — it blocks #5, #10, #56, #58, #64 and the Renovate PRs. Working it first, in isolation, so the rest of the milestone rebases on a green pipeline. Will report the fixes per task on completion.
Author
Contributor

Merged via #66 (commit 06fcf7e). All CI jobs green on main.

The enumerated debt was only the start — the pipeline had a stack of latent failures that only surfaced once each layer was fixed. What landed:

Backend (the issue's original scope): ruff check (auto+hand), ruff format (55 files), mypy (73 errors incl. the app.models shadowing app = FastAPI() root cause, fixed via from app import models as _models), respx added to dev deps, cwd-independent path in test_builtin_yaml_covers_bundled_events, Alembic migration 0008 dropping the 3 orphaned indexes, uv.lock committed, and datetime.utcnow() replaced by a naive-UTC app/timeutil.py::utcnow() (no tz-aware/naive comparison risk). 204 tests pass.

Frontend lint (the real all-52-runs blocker): 4 pre-existing react-refresh/only-export-components warnings tripping --max-warnings 0 — the input.tsx fix in the issue was only one of them.

E2E + a11y: the docker-e2e Playwright suite had 2 brittle specs; fixed by adding aria-labels to icon-only controls (year prev/next, settings, user menu — a genuine a11y improvement) and de-ambiguating a heading selector. 5/5 pass.

Dependency audit: npm audit reported 6 advisories (gating, since Forgejo doesn't honor job-level continue-on-error); npm audit fix cleared all 6 via lockfile only → 0 vulns.

docker-e2e CI-harness fixes (Forgejo runner ≠ GitHub runner): host-published ports unreachable from containerized steps → reach the app by container name over a user-defined network; -v $PWD bind mount empty under DinD → docker cp; reused runner host left a stale network → idempotent pre-cleanup.

Every fix was verified locally in Docker before pushing. Follow-up CI hardening (not blocking) tracked in #5.

Merged via #66 (commit `06fcf7e`). **All CI jobs green on main.** The enumerated debt was only the start — the pipeline had a stack of latent failures that only surfaced once each layer was fixed. What landed: **Backend (the issue's original scope):** ruff check (auto+hand), ruff format (55 files), mypy (73 errors incl. the `app.models` shadowing `app = FastAPI()` root cause, fixed via `from app import models as _models`), `respx` added to dev deps, cwd-independent path in `test_builtin_yaml_covers_bundled_events`, Alembic migration `0008` dropping the 3 orphaned indexes, `uv.lock` committed, and `datetime.utcnow()` replaced by a naive-UTC `app/timeutil.py::utcnow()` (no tz-aware/naive comparison risk). 204 tests pass. **Frontend lint (the real all-52-runs blocker):** 4 pre-existing `react-refresh/only-export-components` warnings tripping `--max-warnings 0` — the `input.tsx` fix in the issue was only one of them. **E2E + a11y:** the docker-e2e Playwright suite had 2 brittle specs; fixed by adding `aria-label`s to icon-only controls (year prev/next, settings, user menu — a genuine a11y improvement) and de-ambiguating a heading selector. 5/5 pass. **Dependency audit:** `npm audit` reported 6 advisories (gating, since Forgejo doesn't honor job-level `continue-on-error`); `npm audit fix` cleared all 6 via lockfile only → 0 vulns. **docker-e2e CI-harness fixes** (Forgejo runner ≠ GitHub runner): host-published ports unreachable from containerized steps → reach the app by container name over a user-defined network; `-v $PWD` bind mount empty under DinD → `docker cp`; reused runner host left a stale network → idempotent pre-cleanup. Every fix was verified locally in Docker before pushing. Follow-up CI hardening (not blocking) tracked in #5.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rbrooks/Iris-WLED#41
No description provided.