Skip to content

docs: delete reset_app_state.sh, inline the reset into the Tests section - #201

Merged
chai-inu merged 1 commit into
mainfrom
docs/drop-reset-app-state
Aug 15, 2026
Merged

chai-inu merged 1 commit into
mainfrom
docs/drop-reset-app-state

Conversation

@chai-inu

Copy link
Copy Markdown
Member

scripts/reset_app_state.sh was added in 0d1a22b (2022-07-16) and never touched again. Nothing referenced it except three lines of README — which spent more prose describing the script than the script had lines. It is deleted here and its steps inlined into the Tests section, where they are now visible at the point of use.

The capability is not dropped, only the wrapper. chafan_core/tests/conftest.py has no schema setup and no teardown — the db fixture opens SessionLocal() against whatever DATABASE_URL names and assumes migrations are already applied — so "reset, then pytest" stays the documented workflow.

Why not deprecate it instead

Deprecation markers protect callers you cannot reach. There are none: no CI job, no other script, no import. git show 0d1a22b recovers the file if it is ever wanted.

Why the inlined commands stay hardcoded

They keep localhost:5432 and a literal chafan_dev rather than deriving from DATABASE_URL, which is the opposite of the create-database step fixed in 8487643. The asymmetry is deliberate and now stated in the README so it does not read as an oversight: a drop database ... WITH (FORCE) that follows the environment destroys whatever the environment points at. With a deployment env file sourced, an env-honouring version of this script would drop the live database; pinned, a misfire connects to nothing. Creating a database is safe to derive because it only ever adds.

Changes

  • Delete scripts/reset_app_state.sh.
  • Tests section: inline redis-cli flushall, the drop/create pair, alembic upgrade head, initial_data.py, pytest, plus a note on the hardcoding.
  • Drop the two stale mentions at README lines 39 and 48.

No references to reset_app_state remain in the tree.

🤖 Generated with Claude Code

The script had one commit (0d1a22b, July 2022) and no callers outside the
three README lines describing it — more prose than the five lines it held.
Its steps are now spelled out where they are used, so the reset is visible
rather than hidden behind a wrapper.

The connection details stay pinned to localhost:5432 and chafan_dev instead
of following DATABASE_URL like the create-database step above: a drop that
honours the environment destroys whatever the environment points at, which
for a deployment is the live database.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@chai-inu
chai-inu merged commit 384c35b into main Aug 15, 2026
11 checks passed
@chai-inu
chai-inu deleted the docs/drop-reset-app-state branch August 15, 2026 23:58
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