Project updates#91
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request refactors the database initialization logic to simplify and standardize how the SQLAlchemy database is configured across the Flask application. The main changes streamline the database setup by removing the custom init_db wrapper functions and using direct SQLAlchemy initialization patterns instead.
- Removed custom database initialization wrapper functions and replaced with direct SQLAlchemy patterns
- Updated development environment to use Python-specific dev container with enhanced tooling
- Added Playwright auto-installation to frontend test script
Reviewed Changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| server/utils/seed_database.py | Replaced init_db call with direct SQLAlchemy configuration and initialization |
| server/utils/database.py | Removed init_db function, simplified to expose only get_connection_string |
| server/tests/test_games.py | Updated test setup to use direct db.init_app instead of custom wrapper |
| server/models/init.py | Removed init_db function from models module |
| server/app.py | Replaced init_db call with direct SQLAlchemy configuration in main app |
| client/package.json | Added Playwright installation to e2e test script |
| .vscode/settings.json | Added spelling dictionary entries for new tooling |
| .github/dependabot.yml | Added devcontainers dependency management |
| .devcontainer/devcontainer.json | Switched to Python-specific container with Node.js, Playwright, and TypeScript features |
Files not reviewed (1)
- client/package-lock.json: Language not supported
|
|
||
| # Initialize in-memory database for testing | ||
| init_db(self.app, testing=True) | ||
| db.init_app(self.app) |
There was a problem hiding this comment.
The test setup is missing proper database teardown. According to the testing guidelines, tests should use db.engine.dispose() to properly close the database connection. Consider adding a tearDown method that calls db.engine.dispose() to ensure proper cleanup.
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 makes several improvements to the development environment and refactors the database initialization logic in the Python server codebase. The most significant changes are the switch to a Python-specific dev container with added features, updates to dependency management, and a simplification of how the database is configured and initialized.
Dev container and configuration improvements:
.devcontainer/devcontainer.jsonfrom a universal image to a Python 3.12 image, and added features for Node.js, Playwright, and TypeScript. Also updated port forwarding and removed the .NET feature. [1] [2].github/dependabot.ymlby introducing a weekly update schedule for the devcontainers ecosystem..vscode/settings.jsonto include additional devcontainer-related keywords and extensions for improved development experience.Database initialization refactor:
server/app.pyandserver/utils/seed_database.pyto use a newget_connection_stringhelper and directdb.init_appcalls, removing the custominit_dblogic. Also ensures tables are created on startup. [1] [2]init_dbfunction fromserver/models/__init__.pyandserver/utils/database.py, consolidating connection string logic intoget_connection_string. Adjusted tests inserver/tests/test_games.pyto use the new initialization pattern. [1] [2] [3] [4]Client dependency updates:
devalueandvitedependencies inclient/package-lock.jsonto newer versions for improved stability and security. [1] [2]test:e2escript inclient/package.jsonto ensure Playwright is installed before running tests, improving reliability of end-to-end testing.