Skip to content

Add automated test suite, CI, and dev workflow (+ bug-026 matcher fix)#31

Open
PiratesIRC wants to merge 2 commits into
mainfrom
dev-workflow
Open

Add automated test suite, CI, and dev workflow (+ bug-026 matcher fix)#31
PiratesIRC wants to merge 2 commits into
mainfrom
dev-workflow

Conversation

@PiratesIRC

Copy link
Copy Markdown
Owner

Summary

Adds the project's first automated test suite, CI, and developer tooling — plus a matcher correctness fix surfaced by the new tests. The repo is the Dispatcharr Plugin Hub distribution source, so this establishes a safety net between commits and users pulling code.

Commits

release: v1.26.1511211 + bug-026 matcher path parity fix

  • Commits the previously-uncommitted v1.26.1511211 release (version bumps + the bug-021 numeric-sibling guard for same-prefix numbered channels).
  • bug-026 fix: FuzzyMatcher.calculate_similarity returned different scores depending on whether rapidfuzz was installed — rapidfuzz uses 1 - distance/max(len), the pure-Python fallback used (len1+len2-distance)/(len1+len2). At threshold 95 this flipped the match decision (Fox Sports 1 vs Fox Sports 2: 0.917 vs 0.958). The fallback now matches rapidfuzz exactly. Production runs the rapidfuzz path, so live behavior is unchanged — only the no-rapidfuzz fallback was corrected. fuzzy_matcher bumped to 26.161.2350.

test: add automated test suite, CI, pre-commit gate, and dev docs

  • tests/ (102 passing): fuzzy matching/normalization, plugin.py pure helpers (via a Django-stubbing conftest.py), channel-database schema validation, and version sync. Cases are regression locks derived from the documented bug history.
  • .github/workflows/ci.yml: py_compile + version-sync + database validation + pytest on every push/PR.
  • .githooks/pre-commit: fast local gate (opt in via git config core.hooksPath .githooks).
  • scripts/: standalone version-sync and database validators, shared by CI and the hook.
  • docs/DEVELOPMENT.md: full dev-workflow documentation.
  • .gitignore / .gitattributes: track requirements-dev.txt, ignore per-version doc sprawl + the local docs/history/ archive, force LF on the shell hook.

Test plan

  • pip install -r requirements-dev.txt
  • python -m pytest -q -> 102 passed
  • python scripts/check_version_sync.py and python scripts/validate_databases.py -> pass

🤖 Generated with Claude Code

PiratesIRC and others added 2 commits June 11, 2026 06:19
Commits the previously-uncommitted v1.26.1511211 release (version bump
across plugin.json/plugin.py/fuzzy_matcher.py + the numeric-sibling guard
for same-prefix numbered channels, bug-021) alongside a new matcher fix.

bug-026: FuzzyMatcher.calculate_similarity returned different scores
depending on whether rapidfuzz was installed. The rapidfuzz path uses
1 - distance/max(len); the pure-Python fallback used
(len1+len2-distance)/(len1+len2). At threshold 95 this flipped the match
decision (Fox Sports 1 vs 2: 0.917 vs 0.958). The fallback now matches
rapidfuzz exactly. Production runs the rapidfuzz path, so live behavior is
unchanged; only the no-rapidfuzz fallback was corrected.
fuzzy_matcher bumped to 26.161.2350.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
First automated coverage for the plugin (102 tests). fuzzy_matcher runs
with no Django; tests/conftest.py stubs Django + the Dispatcharr ORM so
plugin.py's pure helpers import in isolation. Cases are regression locks
derived from the documented bug history.

- tests/: fuzzy matching/normalization, plugin helpers, channel-DB schema,
  version sync
- .github/workflows/ci.yml: py_compile + version-sync + DB-validate + pytest
- .githooks/pre-commit: fast local gate (opt in via core.hooksPath)
- scripts/: standalone version-sync and DB validators (shared by CI + hook)
- docs/DEVELOPMENT.md: full dev-workflow documentation
- .gitignore: track requirements-dev.txt; ignore per-version doc sprawl and
  the local docs/history/ archive

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant