Repository navigation
refactor: move regex_chans table to orm class - #1097
linuxdaemon wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1097 +/- ##
=======================================
Coverage 87.78% 87.78%
=======================================
Files 299 299
Lines 22298 22305 +7
Branches 1846 1846
=======================================
+ Hits 19574 19581 +7
Misses 2321 2321
Partials 403 403 ☔ View full report in Codecov by Harness. |
There was a problem hiding this comment.
🟡 Changes recommended
The migration still declares the existing string-valued status column as Boolean in both affected locations, which can rewrite ENABLED/DISABLED values incorrectly and break cache status handling.
1 open issue
What changed in this PR
Refactors the regex_chans persistence layer from a standalone SQLAlchemy table to an ORM model, with a migration that updates the existing schema and corresponding test and type-checking updates.
Changes:
- Introduces the
RegexChansORM model with composite primary keys and updates database operations. - Adds a migration to rebuild the legacy table without the redundant unique constraint.
- Updates regex channel tests and removes obsolete basedpyright diagnostics.
| File | Description |
|---|---|
| tests/plugin_tests/test_regex_chans.py | Updates fixtures, database setup, assertions, and logging expectations to use the RegexChans ORM model. |
| plugins/core/regex_chans.py | Replaces the standalone table with the RegexChans ORM class and updates cache and database operations. |
| alembic/versions/d3c591b463b1_remove_extraneous_regex_chans_constraint.py | Rebuilds the legacy regex_chans table with composite primary-key columns and supports downgrade. |
| .basedpyright/baseline.json | Removes obsolete type-checking baseline entries resolved by the ORM refactor. |
Review effort: Lite
47da7c2 to
4d7d77b
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The migration can silently delete existing settings with empty connection or channel values, so its filtering must be corrected to preserve data or explicitly report discarded rows.
1 open issue
1 resolved since last review
Review effort: Lite
| [ | ||
| dict(row) | ||
| for row in old_ignores | ||
| if row["connection"] and row["channel"] |
4d7d77b to
380e84f
Compare
380e84f to
96b05a8
Compare


No description provided.