-
Notifications
You must be signed in to change notification settings - Fork 33
Migrate Perl backend to Python with comprehensive test suite, modern tooling, modular test infrastructure, unified database layer, Pydantic input validation, and full Copilot agent integration #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
122 commits
Select commit
Hold shift + click to select a range
c1ac41c
Initial plan
Copilot ace4171
Add Python modules: db_update, file_handler, library_handler, tttool_…
Copilot 6bdc2c5
Add Flask-based main application (ttmp32gme.py)
Copilot 5517efa
Fix global variable declarations in Flask routes
Copilot 8e0ecaa
Update README with Python backend installation and usage instructions
Copilot 6060cb7
Fix typo and tool name in comments per code review
Copilot 11f22fe
Implement TODOs: dynamic file serving, versioning, and code cleanup
Copilot 4cd9ec7
Add comprehensive test suite: unit tests, E2E tests, and CI workflows
Copilot 4919dd6
Fix code review issues: update ChromeDriver installation and exclude …
Copilot bf6fdcc
Add explicit permissions to GitHub Actions workflows for security
Copilot 4e85bc3
Add uv support, fix tttool installation, and comprehensive E2E tests …
Copilot 7a34f63
Address code review: fix imports, remove duplication, improve error h…
Copilot e1e17ca
Fix tttool installation URL, argparse -h conflict, and remove obsolet…
Copilot 5ad6a37
Code review fixes: remove redundant type=str and fix shell exit syntax
Copilot b0234e2
Fix CI failures: extract tttool to subdirectory and include config.sq…
Copilot 576e4cf
Remove trailing blank lines from MANIFEST.in
Copilot 112ca9c
Fix integration tests: update URLs to match Python Flask routes
Copilot 7b0865b
Fix tttool cleanup: use mktemp and chmod before removal
Copilot 02e3e31
Fix E2E tests: convert templates to Jinja2 and update test selectors
Copilot d5b8f57
Fix bare except clauses in E2E tests per code review
Copilot 45f5385
Comprehensive E2E test improvements: consolidate fixtures, add tttool…
Copilot 4aadb3e
Add local E2E test script and fix tttool tests location and imports
Copilot a6c9e5b
Fix E2E test script: ensure jq is installed for ChromeDriver detection
Copilot 7f6767f
Fix E2E test script: use system ChromeDriver and add robust uv/pip fa…
Copilot bb10e44
Redirect pip install output to file to keep script output concise
Copilot 168f8b2
Add test selection arguments to E2E script for targeted test execution
Copilot a704420
Fix E2E upload test: add upload button click and comprehensive debugging
Copilot 8bc940c
Enhance script: redirect all install output to log, kill existing ser…
Copilot d67106a
Fix test fixture: improve error handling for MP3 tag creation
Copilot 87134a1
Fix server port conflict: E2E tests now use script-started server on …
Copilot 96cbb8a
Convert test_audio_files to context manager with proper cleanup and r…
Copilot a0e60a0
Fix upload handler: ensure album_list has enough elements before inde…
Copilot 81f9953
Fix test fixture: use EasyMP3 for ID3 tags compatible with library_ha…
Copilot 74f5911
Fix EasyID3 import: use MP3(file, ID3=EasyID3) instead of EasyMP3
Copilot 58bcaa3
Fix library_handler: use EasyID3 for MP3 metadata extraction
Copilot bbd3454
Add comprehensive debug logging to trace album creation process
Copilot 15fbe42
Fix E2E test: wait for AJAX-loaded albums to appear in library
Copilot 531d344
Fix upload test: manually navigate to library if automatic redirect d…
Copilot a426d72
Fix E2E tests: use correct database filename config.sqlite instead of…
Copilot 3fa1efb
Update run_e2e_tests_locally.sh
thawn 47fcfab
fix selenium issue in e2e tests
thawn 9e3df7c
add uv lock file
thawn bb5f18b
adapt javascript to jinja template library used by flask
thawn 212f682
fix conflict between static assets/ and dynamic oid and album image p…
thawn 515dd2e
adapt tests to new image path
thawn e41db53
changed html templates to use Jinja2 syntax for variable replacement
thawn e6a36f7
apply Jinja2 safe filter to template variables for proper HTML rendering
thawn 5105100
remove any non letter or number character to clean up filenames.
thawn 869ff76
convert configuration strings to numeric types
thawn 64b6b0b
refactor print layout generation to use Jinja2 template for album ren…
thawn f38d21f
make sure albums are always formatted the same
thawn 4aff0b2
removed obsolete check code
thawn 85654cb
fix album cover images are 'null'
thawn 8da4330
improve code generation tests
thawn f7b94d8
fix: move audio files to the album after upload
thawn 2e81a0e
fix: when moving the library, also change library path in the database
thawn 66239a9
fix: fix mp3 to ogg track conversion and last used code default value
thawn 3fcaf81
fix: allow periods in filenames to avoid messing up file extensions
thawn 992ce82
copy then deltete library instead of moving it to allow rollback in c…
thawn 2af010b
improve tests
thawn 2fdb123
add todos
thawn 44a31a3
apply black formatter
thawn 85ce6cc
revert to using Google Chrome in CI e2e test setup
thawn bb40f34
Add command to start web service in E2E tests
thawn 088d31f
start ttmp23gme service in background
thawn 27090c6
Implement function to open library element for editing
thawn 4d33363
fix GME creation in comprehensive test
thawn 1902ce2
fix syntax error
thawn e1981ee
Update E2E tests workflow to fail on errors
thawn 9eef090
Implement TransientConfigChange for audio format
thawn 3cd87f4
Refactor audio format config change handling
thawn 8b1f0a5
Fix syntax error in _change_config method
thawn 21763ba
Fix syntax error in audio format toggle logic
thawn a7aca99
Fix constructor method in TransientConfigChange class
thawn 7bd548a
Fix SQL query parameter in test_comprehensive.py
thawn b998724
Fix method definitions to include 'self' parameter
thawn 59796a1
Fix SQL query parameter in TestWebInterface class
thawn 9a8f3e7
always triggers E2E tests workflow
thawn d335059
fix e2e test test_edit_album_info
thawn 1028ff3
fix: make update_album function use old_oid for database updates
thawn 988310a
fix: update album entry using old_oid for database updates
thawn 0a722e4
refactor: remove get_album_online function and update references to g…
thawn 4c988e6
refactor: rename update method to update_db for clarity
thawn 9d59b94
refactor: remove get_album_online function and update references to g…
thawn 649f982
fix: get select/deselect all checkbox test to work
thawn 2de38d8
fix: handle missing uid gracefully in album update
thawn 2582705
feat: implement track update and extraction functions in DB and libra…
thawn ddcc042
refactor: prevent misidentification of fixture test_audio_files_conte…
thawn 7986fcf
fix: update select/deselect all checkbox handling to use find_element…
thawn 8a318f1
test: skip print album test until test functionality is properly impl…
thawn 9961a8f
update todo in readme
thawn 02a4f0e
removed obsolete todo item in README
thawn 6f8339b
update todo in readme
thawn 5b88605
Implement test_print_album: select albums, navigate to print page, an…
Copilot 17ba15f
Refactor: Migrate to DBHandler in ttmp32gme.py, print_handler.py, and…
Copilot b1cb8cf
Complete migration: Update tttool_handler.py to use DBHandler and rem…
Copilot 69f1e67
Refactor: Integrate db_update.py functionality into DBHandler.update_…
Copilot f55d559
Fix: Use existing DBHandler.update_db() method without parameters as …
Copilot 0a6d256
Fix SQLite threading issue: use check_same_thread=False for Flask mul…
Copilot c5870ed
Refactor: Replace db.cursor() pattern with DBHandler.execute() method…
Copilot 03f9949
fix: Use standalone extract_tracks_from_album function instead of met…
thawn 5047db6
fix: Update serve_dynamic_image to fetch row with improved syntax
thawn 4bdfa5f
fixed db_handler migration issues in tttool_handler
thawn 59f3e16
fix: properly move audio files to library
thawn aa39239
fix test_tttool_handler
thawn ab7695c
fix: update file path handling in convert_tracks and make_gme functions
thawn cc0bb21
feat: make e2e tests fail faster by lowering timeouts
thawn cd902b9
fix: improve layout verification in e2e test_print_album
thawn f591129
remove done items in ToDo list in README
thawn 7761467
Refactor: Split E2E test script into setup and run scripts for better…
Copilot 82e3b49
Add Pydantic validation for frontend input with models in db_handler.py
Copilot 48fffdb
updated uv.lock with added pydantic dependency
thawn 6999b3b
fix: player mode validation
thawn 78852d9
apply black formatter with standard options
thawn 291b46f
updated todos in readme
thawn b4893cd
Add comprehensive Copilot coding agent instructions for repository on…
Copilot 7fc8d0c
remove deprecated code
thawn 26e4e78
verified and updated copilot instructions
thawn 5f506a5
deleted obsolete tests
thawn c75df99
Add copilot-setup-steps.yml workflow for Copilot coding agent environ…
Copilot 795f3f0
fix: updated copilot setup steps to match template
thawn df4c09b
updated copilot-instructions to take into account that environment is…
thawn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,128 @@ | ||
| name: End-to-End Tests | ||
|
|
||
| # This workflow requires manual approval to run | ||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| reason: | ||
| description: 'Reason for running E2E tests' | ||
| required: false | ||
| default: 'Manual E2E test run' | ||
| pull_request: | ||
| types: [labeled] | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write # Needed for posting comments on PRs | ||
thawn marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| # Only run when 'run-e2e-tests' label is added or workflow is manually dispatched | ||
| jobs: | ||
| check-label: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| outputs: | ||
| should-run: ${{ steps.check.outputs.result }} | ||
| steps: | ||
| - id: check | ||
| run: | | ||
| if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then | ||
| echo "result=true" >> $GITHUB_OUTPUT | ||
| elif [[ "${{ github.event.label.name }}" == "run-e2e-tests" ]]; then | ||
| echo "result=true" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "result=false" >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| e2e-tests: | ||
| name: End-to-End Tests with Selenium | ||
| runs-on: ubuntu-latest | ||
| needs: check-label | ||
| if: needs.check-label.outputs.should-run == 'true' | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write # Needed for posting comments | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 # Needed for setuptools-scm | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.12' | ||
|
|
||
| - name: Install system dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y wget unzip | ||
|
|
||
| - name: Install Chrome and ChromeDriver | ||
| run: | | ||
| # Install Chrome | ||
| wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | ||
| sudo dpkg -i google-chrome-stable_current_amd64.deb || sudo apt-get -f install -y | ||
|
|
||
| # Install ChromeDriver using Chrome for Testing | ||
| CHROME_VERSION=$(google-chrome --version | awk '{print $3}' | cut -d '.' -f 1) | ||
| CHROMEDRIVER_URL=$(curl -s "https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json" | \ | ||
| grep -o '"chromedriver".*"linux64".*"url":"[^"]*' | \ | ||
| grep -o 'https://[^"]*' | head -1) | ||
| wget -q "$CHROMEDRIVER_URL" -O chromedriver-linux64.zip | ||
| unzip chromedriver-linux64.zip | ||
| sudo mv chromedriver-linux64/chromedriver /usr/local/bin/ | ||
| sudo chmod +x /usr/local/bin/chromedriver | ||
| rm -rf chromedriver-linux64* | ||
|
|
||
| - name: Install tttool (static build) | ||
| run: | | ||
| wget -q https://github.com/entropia/tip-toi-reveng/releases/download/latest/tttool-Linux | ||
| chmod +x tttool-Linux | ||
| sudo mv tttool-Linux /usr/local/bin/tttool | ||
|
|
||
| - name: Install ffmpeg (static build) | ||
| run: | | ||
| wget -q https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz | ||
| tar -xf ffmpeg-release-amd64-static.tar.xz | ||
| sudo mv ffmpeg-*-amd64-static/ffmpeg /usr/local/bin/ | ||
| sudo mv ffmpeg-*-amd64-static/ffprobe /usr/local/bin/ | ||
| rm -rf ffmpeg-*-amd64-static* | ||
|
|
||
| - name: Install Python dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -e ".[test]" | ||
|
|
||
| - name: Download test audio files (public domain) | ||
| run: | | ||
| mkdir -p tests/fixtures | ||
| # Download small public domain audio files for testing | ||
| # Using a very short silent MP3 file (can be replaced with actual test files) | ||
| wget -q -O tests/fixtures/test1.mp3 "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3" || echo "Warning: Could not download test file" | ||
|
|
||
| - name: Run E2E tests with pytest | ||
| run: | | ||
| pytest tests/e2e/ -v --tb=short -m "e2e" --html=e2e-report.html --self-contained-html | ||
| continue-on-error: true | ||
|
|
||
| - name: Upload test report | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: e2e-test-report | ||
| path: e2e-report.html | ||
| if: always() | ||
|
|
||
| - name: Comment PR with results | ||
|
||
| if: github.event_name == 'pull_request' | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| const fs = require('fs'); | ||
| github.rest.issues.createComment({ | ||
| issue_number: context.issue.number, | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| body: '✅ End-to-end tests completed! Check the artifacts for the detailed report.' | ||
| }); | ||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,3 +44,4 @@ __pycache__/ | |
| *.egg-info/ | ||
| report.html | ||
| assets/ | ||
| src/ttmp32gme/_version.py | ||
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
thawn marked this conversation as resolved.
Show resolved
Hide resolved
|
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,6 @@ | ||
| """ttmp32gme - TipToi MP3 to GME converter.""" | ||
|
|
||
| __version__ = "1.0.1" | ||
| try: | ||
| from ._version import version as __version__ | ||
| except ImportError: | ||
| __version__ = "0.0.0+unknown" |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.