Skip to content

chore: remove demo mode#16

Merged
jdwit merged 2 commits into
mainfrom
chore/strip-demo-mode
May 28, 2026
Merged

chore: remove demo mode#16
jdwit merged 2 commits into
mainfrom
chore/strip-demo-mode

Conversation

@jdwit

@jdwit jdwit commented May 28, 2026

Copy link
Copy Markdown
Owner

Summary

Demo mode (YTSTUDIO_DEMO=1) was a parallel codepath that intercepted get_data_service / get_analytics_service and substituted hand-rolled fakes backed by bundled JSON fixtures. It was useful early on for showing the CLI without OAuth, but it has stopped earning its keep:

  • the fixtures drift from the real YouTube Data / Analytics API shape, so demo runs are only loosely representative of the real surface;
  • new commands (the videos upload pipeline) silently bypass the demo service entirely, so partial coverage is itself misleading;
  • users get confused about whether a successful demo run means anything for their real channel.

Rip it out wholesale.

What changes

  • src/ytstudio/demo.py and src/ytstudio/demo_data/ deleted.
  • src/ytstudio/services.py drops the is_demo_mode branches; both factories always build the authenticated client.
  • tests/test_analytics.py drops the demo-only TestQueryDemoMode class and the demo-patched test_overview; remaining coverage exercises every command path against mocks.
  • docs/videos.md and docs/livestreams.md drop their "Demo mode" sections.
  • Incidental demo labels in test fixtures (MOCK_VIDEO tags, sidecar filenames and descriptions) renamed to sample so no test reads like it is testing the (now nonexistent) demo path.

Test plan

  • uv run pytest -q -> 195 passed, 80% coverage
  • uv run ruff check . -> clean
  • uv run mkdocs build --strict -> clean
  • grep -rni demo docs/ src/ tests/ README.md mkdocs.yml -> no hits

jdwit added 2 commits May 28, 2026 18:41
Demo mode (YTSTUDIO_DEMO=1) was a parallel codepath that intercepted
get_data_service / get_analytics_service and replaced them with hand-rolled
fakes backed by bundled JSON fixtures. It was useful early on for showing
the CLI without OAuth, but it has stopped paying for itself: the fixtures
drift from the real API shape, new commands silently bypass the demo
service (the upload pipeline ignores it entirely), and users get confused
about whether a "successful" demo run means anything for their real
channel.

Delete the whole path:

- src/ytstudio/demo.py and src/ytstudio/demo_data/ removed.
- services.py drops the is_demo_mode branches; both factories always return
  the authenticated client.
- tests/test_analytics.py drops the demo-only TestQueryDemoMode class and
  the demo-patched test_overview; the remaining coverage exercises every
  command path against mocks.
- docs/videos.md and docs/livestreams.md drop their "Demo mode" sections.
- Incidental "demo" labels in test fixtures (MOCK_VIDEO tags, sidecar
  filenames and descriptions) renamed to "sample" so no test reads like it
  is testing the (now nonexistent) demo path.

195 tests pass, ruff clean, mkdocs --strict clean. No `demo` substring left
anywhere under docs/, src/, tests/, README.md, or mkdocs.yml.
- Add mocked overview tests (table, json, no-data) to close the coverage
  gap left after the demo-patched test_overview was removed.
- Delete the orphaned demo.gif from the repo root; nothing referenced it.
- Drop the now-meaningless `demo/` line from .gitignore.
@jdwit jdwit force-pushed the chore/strip-demo-mode branch from d6e2f52 to 1541983 Compare May 28, 2026 16:41
@jdwit jdwit merged commit 9552fd2 into main May 28, 2026
7 checks passed
@jdwit jdwit deleted the chore/strip-demo-mode branch May 28, 2026 16:45
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