♻️ refactor(backend-scripts): clean up scripts and fix entrypoints#23
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the backend/scripts directory by removing redundant and unused scripts, fixing entrypoints, and adding documentation to improve maintainability and clarity.
Key Changes
- Removed redundant scripts (
beat-start-unix.sh,fix-imports.ps1,create-dbs.sql.removed) identified in the audit - Improved type safety in
test_runner.pywith proper use ofSequence[str]type hints - Fixed production entrypoint path in Dockerfile to use the correct script location
- Added comprehensive documentation (audit report and README) for the scripts directory
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
backend/test_runner.py |
Improved type hints by using Sequence[str] instead of list[str] for better flexibility and converted sequence to list internally for safe mutation |
backend/test/test_csrf_implementation.py |
Cleaned up docstring formatting to be more concise (single-line start) |
backend/scripts/fix-imports.ps1 |
Removed redundant PowerShell import sorting script (functionality covered by format.ps1) |
backend/scripts/database/create-dbs.sql.removed |
Removed placeholder file that was no longer needed |
backend/scripts/beat-start-unix.sh |
Removed redundant Celery beat startup script (duplicate of beat-start.sh) |
backend/scripts/backend_scripts_audit_report.md |
Added comprehensive audit report documenting script redundancies and cleanup recommendations |
backend/scripts/README.md |
Added documentation explaining the purpose and organization of scripts directory |
backend/Dockerfile |
Fixed entrypoint path to use production-entrypoint.sh instead of generic entrypoint.sh |
.vscode/tasks.json |
Corrected test runner path to use full path from project root (backend/test_runner.py) |
.gitignore |
Added memory_test_db_default to ignore local test database artifacts |
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.
This pull request focuses on cleaning up and improving the backend scripts directory, clarifying script usage, and removing redundancy. It also makes minor improvements to test infrastructure and Docker configuration. The most significant changes include deleting unused or redundant scripts, adding documentation and an audit report for backend scripts, clarifying the purpose of scripts for Docker versus local development, and making minor fixes to test runner code and Dockerfile entrypoints.
Backend scripts cleanup and documentation:
backend_scripts_audit_report.md) detailing the current state of thebackend/scriptsdirectory, identifying redundant/legacy scripts, and providing recommendations for cleanup and documentation.README.mdto thebackend/scriptsdirectory to clarify the purpose and organization of scripts, distinguishing between Docker-specific and local/dev helper scripts.Redundant/unused script removal:
beat-start-unix.shscript, as its functionality is covered bybeat-start.sh.fix-imports.ps1script, which is now redundant due to other formatting scripts.database/create-dbs.sql.removedfile, as it is no longer needed.Script and file reorganization:
test_csrf_implementation.pyscript frombackend/scripts/tobackend/test/, clarifying its purpose as a test/diagnostic script.Infrastructure and configuration improvements:
production-entrypoint.sh) instead of the genericentrypoint.sh.Sequencefor type safety and updating therun_commandfunction to handle command arguments more robustly. [1] [2]Closes #7