Repository navigation
docs: delete reset_app_state.sh, inline the reset into the Tests section - #201
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
scripts/reset_app_state.shwas added in0d1a22b(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.pyhas no schema setup and no teardown — thedbfixture opensSessionLocal()against whateverDATABASE_URLnames 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 0d1a22brecovers the file if it is ever wanted.Why the inlined commands stay hardcoded
They keep
localhost:5432and a literalchafan_devrather than deriving fromDATABASE_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: adrop 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
scripts/reset_app_state.sh.redis-cli flushall, the drop/create pair,alembic upgrade head,initial_data.py,pytest, plus a note on the hardcoding.No references to
reset_app_stateremain in the tree.🤖 Generated with Claude Code