Conversation
…handler, print_handler Co-authored-by: thawn <1308449+thawn@users.noreply.github.com>
Co-authored-by: thawn <1308449+thawn@users.noreply.github.com>
Co-authored-by: thawn <1308449+thawn@users.noreply.github.com>
Co-authored-by: thawn <1308449+thawn@users.noreply.github.com>
Co-authored-by: thawn <1308449+thawn@users.noreply.github.com>
There was a problem hiding this comment.
In addition to the changes requested in the code please implement the following:
- add unit tests
- add end to end tests using selenium
- for testing the album upload: use some small public domain licenced mp3 files and images.
- make sure the tests run in the ci
- use a separate CI pipeline for the end to end tests:
- install the necessary dependencies like TTtool and ffmpeg use static builds where possible
- this Pipeline should be run holy after developer approval
Co-authored-by: thawn <1308449+thawn@users.noreply.github.com>
Co-authored-by: thawn <1308449+thawn@users.noreply.github.com>
Implemented in commits 11f22fe and 4cd9ec7: ✅ Unit tests added - 17 tests covering db_update, file_handler, and library_handler modules (tests/unit/) ✅ E2E tests with Selenium - Web interface tests with fixtures and Chrome WebDriver setup (tests/e2e/) ✅ CI pipelines updated:
✅ E2E pipeline installs dependencies:
E2E tests can be triggered by adding the 'run-e2e-tests' label to this PR or via manual workflow dispatch. |
…generated version file Co-authored-by: thawn <1308449+thawn@users.noreply.github.com>
Co-authored-by: thawn <1308449+thawn@users.noreply.github.com>
thawn
left a comment
There was a problem hiding this comment.
Please implement the changes the just it in the code
In addition please switch to uv for Python package management
…with real files Co-authored-by: thawn <1308449+thawn@users.noreply.github.com>
Implemented in commit 4e85bc3: ✅ Switched to uv for Python package management
✅ Implemented code changes as suggested Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
…andling, add bundled test file Co-authored-by: thawn <1308449+thawn@users.noreply.github.com>
reduce sleep duration
|
@copilot split run_e2e_tests_locally.sh into a setup script and a script that runs the tests. the setup script should have an option to install the test dependencies (chromium driver). |
… modularity - Created setup_e2e_environment.sh for one-time environment setup - Supports optional browser installation with -b flag - Installs tttool, ffmpeg, Python dependencies - Runs unit tests to verify installation - Created run_e2e_tests.sh for test execution - Starts Flask server, runs tests, stops server - Supports -t (specific test) and -k (keyword) options - Can be run repeatedly without reinstalling dependencies - Updated run_e2e_tests_locally.sh as legacy wrapper - Maintains backward compatibility with original interface - Shows deprecation notice directing to new scripts - Added E2E_TEST_SCRIPTS.md documentation - Explains new modular approach - Provides usage examples and workflow - Documents benefits of split scripts Co-authored-by: thawn <1308449+thawn@users.noreply.github.com>
Split into modular scripts in commit 7761467: New Scripts:
See |
|
@copilot use pydantic to validate input from frontend in ttmp32gme.py before passing it on to db_handler.py the pydantic models should live in db_handler.py |
- Added pydantic>=2.0.0 dependency to pyproject.toml - Created Pydantic models in db_handler.py for data validation: - AlbumUpdateModel: Validates album update data (oid, title, artist, etc.) - ConfigUpdateModel: Validates configuration updates - LibraryActionModel: Validates library actions (delete, cleanup, make_gme, etc.) - Updated ttmp32gme.py to validate all frontend input: - /library POST: Validates album updates and action data - /config POST: Validates config updates - /print POST: Validates print config updates - Benefits: - Type safety for all user input - Automatic validation with clear error messages - Self-documenting API with Pydantic models - Prevents invalid data from reaching database layer - Better error handling with ValidationError Co-authored-by: thawn <1308449+thawn@users.noreply.github.com>
Implemented in commit 82e3b49. Created three Pydantic models in db_handler.py:
Updated ttmp32gme.py to validate all frontend input before passing to db_handler:
All invalid input now returns HTTP 400 with clear error messages showing validation failures. |
|
@copilot Your task is to "onboard" this repository to Copilot coding agent by adding a .github/copilot-instructions.md file in the repository that contains information describing how a coding agent seeing it for the first time can work most efficiently. You will do this task only one time per repository and doing a good job can SIGNIFICANTLY improve the quality of the agent's work, so take your time, think carefully, and search thoroughly before writing the instructions. - Reduce the likelihood of a coding agent pull request getting rejected by the user due to generating code that fails the continuous integration build, fails a validation pipeline, or having misbehavior. - Minimize bash command and build failures. - Allow the agent to complete its task more quickly by minimizing the need for exploration using grep, find, str_replace_editor, and code search tools. - Instructions must be no longer than 2 pages. - Instructions must not be task specific.Add the following high level details about the codebase to reduce the amount of searching the agent has to do to understand the codebase each time:
Add information about how to build and validate changes so the agent does not need to search and find it each time.
List key facts about the layout and architecture of the codebase to help the agent find where to make changes with minimal searching.
|
…boarding - Created .github/copilot-instructions.md with detailed repository information - Includes architecture overview, development workflows, and testing procedures - Documents critical patterns (DBHandler usage, Pydantic validation) - Provides verified commands for bootstrap, build, test, and run operations - Lists deprecated code to avoid (library_handler.py, db_update.py) - Quick reference guide for common development tasks - CI/CD workflow documentation This one-time setup significantly improves coding agent efficiency by providing context about the codebase structure, conventions, and workflows upfront. Co-authored-by: thawn <1308449+thawn@users.noreply.github.com>
Created comprehensive onboarding documentation in commit b4893cd. The
All commands were validated to ensure they work correctly. The document is exactly 2 pages and focuses on general repository guidance rather than task-specific instructions. |
Remove obsolete database update and library handling modules, along with the version update script. These files are no longer needed as the functionality has been refactored or replaced in the codebase.
|
@copilot add a copilot-setup-steps.yml github workflow following the official instructions and template
|
|
@copilot try again |
…ment setup - Created .github/workflows/copilot-setup-steps.yml following GitHub's official template - Uses same setup steps as e2e-tests.yml workflow: - Python 3.12 installation - uv package manager - Chrome and ChromeDriver for Selenium tests - tttool (1.8.1) for GME file creation - ffmpeg for audio conversion - Python dependencies with test extras - Test fixture preparation - Includes verification step to confirm all tools installed successfully - Triggered manually via workflow_dispatch This allows Copilot coding agent to pre-install all required dependencies in its environment, significantly improving performance and reliability. Co-authored-by: thawn <1308449+thawn@users.noreply.github.com>
Created copilot-setup-steps.yml workflow in commit c75df99. The workflow follows GitHub's official template and uses the same setup steps as e2e-tests.yml, installing Python 3.12, uv, Chrome/ChromeDriver, tttool, ffmpeg, and all Python dependencies. It can be triggered manually via workflow_dispatch and includes a verification step to confirm all tools are installed successfully. |
Complete Perl to Python Migration
This PR completes the migration of the ttmp32gme backend from Perl to Python, introducing a modern, maintainable codebase with comprehensive testing infrastructure, type-safe input validation, and full Copilot coding agent integration.
Core Migration
Backend Implementation
Database Layer Refactoring
check_same_thread=FalseInput Validation with Pydantic
AlbumUpdateModel: Validates album updates (title, artist, tracks, etc.)ConfigUpdateModel: Validates configuration changes (port ranges, formats, paths)LibraryActionModel: Validates library actions (delete, cleanup, GME creation)Copilot Coding Agent Integration
Comprehensive onboarding in
.github/copilot-instructions.mdAutomated environment setup via
.github/workflows/copilot-setup-steps.ymlBenefits:
Test Infrastructure
Test Suite (45+ tests)
Modular Test Scripts
New split architecture for faster iteration:
setup_e2e_environment.sh- One-time Environment Setup-b/--browserflagUsage:
run_e2e_tests.sh- Fast Test Execution-t,-koptions)Usage:
Legacy Support
run_e2e_tests_locally.shmaintained for backward compatibilityBenefits
Key Improvements
Code Quality
Security & Validation
Test Coverage
Developer Experience
Architecture
Database Layer:
Validation Layer:
Test Infrastructure:
Copilot Coding Agent Support:
The migration is complete with a production-ready, well-tested Python backend featuring type-safe input validation, a robust test infrastructure, and full Copilot coding agent integration to ensure efficient future development by both human developers and AI coding assistants.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.