Skip to content

VoucherBot v1.1.0

Choose a tag to compare

@Devathmaj Devathmaj released this 14 Aug 11:10
· 19 commits to main since this release

v1.1.0 — Migration-Led Schema, Weighted AI Routing, Reddit RSS-by-Default & Content Retention

Minor release: Alembic migrations are now the single source of truth for the database schema (applied automatically at startup), Groq calls are routed 40/40/20 across the gpt-oss model family with quota-aware fallbacks, Reddit collection defaults to public RSS only (no OAuth calls), the Reddit source catalog is curated, and the scheduler now nulls out the content column of posts older than the retention window.


What changed since v1.0.4

Two pull requests landed since v1.0.4:


New Features

  • Alembic migrations are now authoritative (PR #15) — alembic upgrade head runs automatically at startup when IS_PROD=false, so a brand-new system boots end-to-end (schema + seed data) with zero manual steps. The migration chain fully reproduces the schema the running models define, including tables, enums, indexes, and the voucher_posts view.
  • Weighted Groq model routing (PR #15) — replaced the fixed round-robin batch with weighted 40/40/20 distribution across openai/gpt-oss-20b / openai/gpt-oss-120b / llama-3.3-70b-versatile, each respecting its TPM/TPD/RPD quota. Exhausted models are skipped, failures fall back to remaining models, and Gemini remains the final fallback.
  • Reddit RSS-by-default (PR #15) — REDDIT_INGESTION_ENABLED=false (the default) now collects Reddit purely via public RSS feeds and never calls the OAuth API, regardless of whether credentials are configured. Reddit sources are no longer filtered out of the scheduler when ingestion is disabled.
  • Curated Reddit source catalog (PR #15) — refreshed the default subreddit list (added O365Certification, mcsa, ccnp, linuxadmin, salesforce, vmware; removed MicrosoftLearn, LinuxCertifications, eFreebies, FREE). Stale subreddits no longer in the catalog are auto-disabled.
  • Post content retention (PR #16) — the scheduler now nulls out posts.content for every post older than content_retention_days (default 7), keeping the column bounded. A raw UPDATE ... SET content = NULL is used so only the content column is touched (no accidental updated_at writes).

Reliability / Schema

  • Migration chain rebuilt (PR #15) — the schema-freeze keyword migration now creates its table unconditionally, the redundant vendor-mappings freeze was removed, and two new migrations add the PEARSONVUE/TRAINING_PROVIDER source types and reconcile create_all-built DBs (creates the voucher_posts view, makes vendor_mappings timestamps timezone-aware). alembic check is clean after applying.
  • migrations/env.py hardening (PR #15) — % in the DB URL is escaped (fixes a configparser interpolation crash on percent-encoded passwords), all models are registered in Base.metadata, and view-backed models are excluded from autogenerate.
  • Model/migration alignment (PR #15) — vendor_mappings.url_pattern unique index, keyword server defaults, timezone-aware vendor_mapping timestamps.
  • Retention is configurable (PR #16) — new CONTENT_RETENTION_DAYS setting (default 7); the sweep is idempotent (content IS NOT NULL guard) and runs once per scheduler loop iteration.

Housekeeping

  • Dropped author capture on Reddit (PR #15) — keeps [deleted]-style noise out of the pipeline.
  • Docs & source catalog sync (PR #15) — Reddit RSS behavior, OAuth settings, setup instructions, and contributor checklists clarified; Sources/Subreddit.txt refreshed.

Testing

  • New unit tests for the migration graph, startup lifespan wiring, Reddit source disabling, collectors, and the analyzer (PR #15).
  • New tests/test_retention.py covers the retention SQL shape (SET clause contains exactly content, never updated_at/summary), NULL-skipping, rowcount, and error swallowing (PR #16).
  • Full suite: 359 passed, 15 skipped. All CI quality gates pass: ruff format --check, ruff check, mypy voucherbot tests, and the full pytest suite.

Upgrade notes

On a brand-new empty DB, alembic upgrade head at startup builds the complete schema automatically. For existing create_all-built DBs, apply the new m6n7o8p9q0r1 reconciliation migration (alembic upgrade head) — alembic check passes cleanly afterwards.

Full Changelog: v1.0.4...v1.1.0