Commit Graph

118 Commits

Author SHA1 Message Date
tliu93 0d898e09f2 M1-T04: converge startup chain onto the single app DB
run_all_migrations() now adopts/initializes only the app DB and returns
{'app': ...}. app/main.py drops the location/poo readiness checks
(ensure_location_db_ready / ensure_poo_db_ready) and their imports;
ensure_runtime_dirs only provisions the app DB path; lifespan still
fail-closes on a missing/unmanaged app DB. Delete the retired
location/poo adopt scripts and the alembic_location / alembic_poo
chains. Update tests to single-DB expectations and drop the obsolete
location/poo adoption + readiness tests.

pytest 95 passed; ruff clean (pre-existing only); a fresh app DB
initialized via scripts.run_migrations contains location + poo_records.
2026-06-12 16:50:05 +02:00
tliu93 3d3c2bcc57 M1-T03: unify data layer, models, deps and routes onto single app DB
Collapse the three data layers into one. app/db.py now exposes a single
Base, a cached engine bound to app_database_url with SQLite WAL enabled, and
get_engine/get_session_local/reset_db_caches/get_db_session. Delete
app/auth_db.py, app/poo_db.py and app/models/base.py. All models (auth,
config, public_ip, location, poo) inherit the one Base and register on a
single metadata. Dependencies converge to a single get_db; all routes use it.

Also update the alembic env.py files (app/location/poo) and tests that
imported the removed modules so the suite stays green, and drop the obsolete
test_legacy_style_location_db test whose flow (app reading a separate location
DB) no longer exists. Location/poo Alembic chains, adopt scripts and adoption
tests remain for M1-T04; config fields remain for M1-T05.

pytest 109 passed; ruff clean (pre-existing only); WAL verified; single
Base.metadata holds all seven tables.
2026-06-12 16:35:07 +02:00
tliu93 bc8dd062d5 M1-T02: add idempotent legacy data migration script
scripts/migrate_legacy_data.py copies rows from the legacy locationRecorder.db
/ pooRecorder.db into the unified app DB's location / poo_records tables using
ATTACH + INSERT OR IGNORE (idempotent via PK-conflict skip; explicit columns,
never SELECT *). After copy it reconciles every source row against the target
and raises / exits non-zero on any shortfall. Missing legacy files are a safe
no-op (skipped); --dry-run writes nothing. Not part of the Alembic chain; run
manually once at cut-over. Never deletes or overwrites any file.

Validated end-to-end on copies of the real production DBs: dry-run reported
75103 location + 874 poo rows and wrote nothing; the real run copied all rows
with reconciliation passing; a second run copied 0 (idempotent).
2026-06-12 16:13:55 +02:00
tliu93 427a491380 M1-T01: add app-chain revision creating location + poo_records tables
Add alembic_app revision 20260611_06_merge_location_poo_tables that builds
empty location and poo_records tables (REAL float columns, matching the
production schema and the adopt scripts' EXPECTED_*_TABLE_INFO constants).
Update APP_BASELINE_REVISION to the new head. Schema-only; data migration
is handled separately by scripts/migrate_legacy_data.py (M1-T02).
2026-06-12 16:02:46 +02:00
tliu93 b359bbe3bf docs: add next-phase roadmap, milestone design docs, and CLAUDE.md
pytest / test (push) Successful in 54s
- roadmap.md: M1 (DB consolidation) -> M2 (React SPA) -> M3 (token/mobile)
- docs/design/: agent-pipeline design docs with atomic tasks for M1-M3
- CLAUDE.md: workflow, doc map, commit conventions, review-notes briefing flow
- .gitignore: ignore local review-notes/
2026-06-12 15:37:17 +02:00
tliu93 636bb2b80b Merge pull request 'add get public and storage feature' (#6) from feature/public_ip into main
pytest / test (push) Successful in 53s
docker-image / build-and-push (push) Successful in 3m59s
Reviewed-on: #6
v1.0.3
2026-04-29 13:16:58 +02:00
tliu93 eda49489e0 update reademe and docs
pytest / test (push) Successful in 56s
pytest / test (pull_request) Successful in 59s
2026-04-29 13:07:59 +02:00
tliu93 779e160b95 add ip change notification and refine sender display
pytest / test (push) Successful in 57s
pytest / test (pull_request) Successful in 54s
2026-04-29 13:03:12 +02:00
tliu93 3ea3498e58 add smtp module and testing 2026-04-29 12:11:10 +02:00
tliu93 5a420bd37b add get public and storage feature 2026-04-29 11:45:49 +02:00
tliu93 a24e402d47 add grafana provisioning
pytest / test (push) Successful in 46s
2026-04-23 00:12:51 +02:00
tliu93 8565534b73 Merge pull request 'fix ci test' (#5) from feature/add_separate_migration_container into main
pytest / test (push) Successful in 45s
docker-image / build-and-push (push) Successful in 3m40s
Reviewed-on: #5
v1.0.2
2026-04-22 13:35:40 +02:00
tliu93 4acdd2dc60 fix ci test
pytest / test (push) Successful in 45s
pytest / test (pull_request) Successful in 44s
2026-04-22 13:31:26 +02:00
tliu93 c9af7530e5 Merge pull request 'change adoption to separate step' (#4) from feature/add_separate_migration_container into main
pytest / test (push) Failing after 44s
docker-image / build-and-push (push) Successful in 3m40s
Reviewed-on: #4
v1.0.1
2026-04-22 13:28:30 +02:00
tliu93 a76d6bfb71 change adoption to separate step
pytest / test (push) Failing after 46s
pytest / test (pull_request) Failing after 45s
2026-04-22 13:28:00 +02:00
tliu93 35aee79d93 Restore legacy poo inbound dispatch
pytest / test (push) Successful in 43s
docker-image / build-and-push (push) Successful in 3m38s
v1.0.0
2026-04-20 23:33:57 +02:00
tliu93 b9e7f51d51 Split compose dev build from registry deploy
pytest / test (push) Successful in 44s
2026-04-20 23:16:13 +02:00
tliu93 94747c75dd Align image publishing with repository path
pytest / test (push) Successful in 43s
docker-image / build-and-push (push) Successful in 3m37s
0.9.1 v0.9.1
2026-04-20 23:05:27 +02:00
tliu93 7978a7e1e1 Add release Docker image workflow
pytest / test (push) Successful in 42s
docker-image / build-and-push (push) Successful in 3m42s
v0.9.0
2026-04-20 22:18:54 +02:00
tliu93 e9e2034d30 Add Grafana to deployment compose
pytest / test (push) Successful in 40s
2026-04-20 20:50:46 +02:00
tliu93 aae8ca3b87 Merge pull request 'refactoring/new_python' (#3) from refactoring/new_python into main
pytest / test (push) Successful in 41s
Reviewed-on: #3
2026-04-20 20:41:01 +02:00
tliu93 1805d5d8ea Finalize first Python release
pytest / test (push) Successful in 40s
pytest / test (pull_request) Successful in 41s
2026-04-20 20:40:04 +02:00
tliu93 795c84f177 Stabilize auth tests in CI
pytest / test (push) Successful in 43s
2026-04-20 17:43:24 +02:00
tliu93 1ff426d2e9 Add pytest workflow
pytest / test (push) Failing after 2m18s
2026-04-20 17:38:32 +02:00
tliu93 fe0409dafe Refine runtime config and redirect settings 2026-04-20 17:36:05 +02:00
tliu93 982af62f4f Migrate TickTick OAuth and action tasks 2026-04-20 17:06:03 +02:00
tliu93 179aae264e Persist runtime config in app db and seed from env 2026-04-20 15:56:10 +02:00
tliu93 3f7c9e43d9 Switch auth password hashing to Argon2 2026-04-20 15:26:36 +02:00
tliu93 e1aad408ab Add auth foundation and app DB management 2026-04-20 15:16:47 +02:00
tliu93 044b47c573 Migrate poo recorder and align Alembic naming 2026-04-20 11:48:48 +02:00
tliu93 e334df992f Add Home Assistant inbound gateway 2026-04-20 10:42:35 +02:00
tliu93 151ad46275 Add Home Assistant outbound adapter 2026-04-20 10:11:02 +02:00
tliu93 eb487ccb46 Track exported OpenAPI schema 2026-04-19 23:25:13 +02:00
tliu93 d0dc8e893a Tighten location request validation 2026-04-19 23:18:20 +02:00
tliu93 1a2f9c75d9 Harden location db startup validation 2026-04-19 23:02:43 +02:00
tliu93 8aeb0723c1 Add location db adoption runbook 2026-04-19 21:57:31 +02:00
tliu93 32cc6847fd Migrate location recorder and refine db config 2026-04-19 21:39:23 +02:00
tliu93 31390882ef Bootstrap Python rewrite skeleton 2026-04-19 20:19:58 +02:00
tliu93 7818a3fb44 Revert coverage
Run short tests / run-tests (push) Failing after 44s
Run nightly tests / nightly-tests (push) Has been cancelled
2025-07-15 22:32:24 +02:00
tliu93 295c8f1589 see svg
Run short tests / run-tests (push) Failing after 1m9s
Run nightly tests / nightly-tests (push) Successful in 1m24s
2025-07-15 17:48:35 +02:00
tliu93 739497a853 try skip ci [skip ci] 2025-07-15 17:47:15 +02:00
tliu93 8da79514b8 Add badge readme
Run short tests / run-tests (push) Successful in 1m5s
Run nightly tests / nightly-tests (push) Successful in 1m23s
2025-07-15 17:44:39 +02:00
tliu93 872c7b356f Merge pull request 'feature/improve_test_automation' (#2) from feature/improve_test_automation into main
Run short tests / run-tests (push) Successful in 1m5s
Run nightly tests / nightly-tests (push) Successful in 1m37s
Reviewed-on: tliu93/home-automation-backend#2
2025-07-15 17:42:21 +02:00
tliu93 6fab12e7bd upload artifacts v3
Run short tests / run-tests (push) Successful in 1m38s
Run short tests / run-tests (pull_request) Successful in 1m6s
2025-07-15 17:39:36 +02:00
tliu93 cbdc1295f2 Modify coverage upload
Run short tests / run-tests (push) Failing after 1m11s
2025-07-15 17:37:47 +02:00
tliu93 a7ae5d465c try to upload coverage out
Run short tests / run-tests (push) Failing after 2m18s
2025-07-15 17:33:27 +02:00
tliu93 8df89d3478 schedule looks good now, run at 20 utc, so 21 cest.
Run short tests / run-tests (push) Successful in 1m15s
Run nightly tests / nightly-tests (push) Successful in 1m50s
2025-05-21 14:51:24 +02:00
tliu93 f97841b079 print working see with checkout
Run short tests / run-tests (push) Successful in 1m14s
Run nightly tests / nightly-tests (push) Successful in 1m40s
2025-05-21 14:41:44 +02:00
tliu93 17d2f4d1f5 test cron
Run short tests / run-tests (push) Successful in 1m15s
Run nightly tests / test-cron-job (push) Successful in 30s
2025-05-21 14:38:05 +02:00
tliu93 1aa6c7dac4 test cron at 1430
Run short tests / run-tests (push) Successful in 1m14s
Run nightly tests / run-tests (push) Successful in 1m41s
2025-05-21 14:24:22 +02:00