Compare commits

..
Author SHA1 Message Date
Andrew BeveridgeandClaude Opus 4.5 d81591ca99 Remove deployment tracking to fix PR banner
Remove the `environment` block from the deploy-frontend job to prevent
GitHub from creating deployment entries. This fixes the "This branch
has not been deployed" banner that appears on all PRs.

The deployment to GitHub Pages still works via actions/deploy-pages@v4,
but without tracked environment deployments.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 22:49:44 -05:00
Andrew Beveridge ☄️ 0e66ac84ec Merge pull request #74 from nomadkaraoke/fix/youtube-url-support
Fix YouTube URL support in karaoke-gen CLI
2025-12-27 22:48:12 -05:00
Andrew BeveridgeandClaude Opus 4.5 d8e3542850 Address CodeRabbit lint feedback
- Remove f-string prefix from strings without placeholders (F541)
- Add 'from e' to ImportError handler to preserve stack trace (B904)
- Use raw string for regex pattern in pytest match (RUF043)
- Remove unused result variables (F841)
- Remove redundant KaraokePrep import in fixture (F811)
- Rename unused mock parameters with underscore prefix (ARG002)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 22:36:22 -05:00
Andrew Beveridge ☄️ 8b66e97459 Merge pull request #75 from nomadkaraoke/fix/progress-display-during-parallel-processing
Fix progress display to show step 4 when workers are active during download
2025-12-27 22:34:53 -05:00
Andrew Beveridge 8dc0a96734 Added CI gate check 2025-12-27 22:24:52 -05:00
5 changed files with 46 additions and 16 deletions

No files matched your search

+28 -3
View File
@@ -418,6 +418,34 @@ jobs:
poetry run python -m py_compile backend/main.py backend/config.py
echo "✅ Basic syntax validation passed"
# ============================================
# CI GATE - Required status check for PRs
# ============================================
ci-gate:
name: "CI Gate"
runs-on: ubuntu-latest
needs: [frontend-unit-tests, package-unit-tests, package-integration-tests, backend-unit-tests, backend-emulator-tests, backend-lint]
if: always()
steps:
- name: Check results
run: |
results=(
"${{ needs.frontend-unit-tests.result }}"
"${{ needs.package-unit-tests.result }}"
"${{ needs.package-integration-tests.result }}"
"${{ needs.backend-unit-tests.result }}"
"${{ needs.backend-emulator-tests.result }}"
"${{ needs.backend-lint.result }}"
)
for result in "${results[@]}"; do
if [[ "$result" == "failure" || "$result" == "cancelled" ]]; then
echo "❌ CI failed"
exit 1
fi
done
echo "✅ CI passed"
# ============================================
# DEPLOYMENTS (main branch only)
# ============================================
@@ -514,9 +542,6 @@ jobs:
runs-on: ubuntu-latest
needs: [frontend-unit-tests]
if: ${{ always() && github.ref == 'refs/heads/main' && github.event_name == 'push' && (needs.frontend-unit-tests.result == 'success' || needs.frontend-unit-tests.result == 'skipped') }}
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v4
+2 -2
View File
@@ -1696,7 +1696,7 @@ class RemoteFlacFetchAudioFetcher(AudioFetcher):
import re
self.logger.info(f"[RemoteFlacFetcher] Downloading from URL: {url}")
self.logger.info(f"[RemoteFlacFetcher] Using local flacfetch for YouTube download (no remote API needed)")
self.logger.info("[RemoteFlacFetcher] Using local flacfetch for YouTube download (no remote API needed)")
try:
# Use local flacfetch for YouTube downloads - no need for remote API
@@ -1762,7 +1762,7 @@ class RemoteFlacFetchAudioFetcher(AudioFetcher):
except ImportError as e:
raise DownloadError(
f"flacfetch is required for URL downloads but import failed: {e}"
)
) from e
except Exception as e:
raise DownloadError(f"Failed to download from URL {url}: {e}") from e
+1 -1
View File
@@ -503,7 +503,7 @@ class KaraokePrep:
)
# Update extractor to reflect the source
self.extractor = f"youtube"
self.extractor = "youtube"
else:
# Use flacfetch to search and download audio
self.logger.info(f"Using flacfetch to search and download: {self.artist} - {self.title}")
+9 -4
View File
@@ -568,7 +568,7 @@ class TestAsync:
basic_karaoke_gen.title = None # Missing title
# Test that ValueError is raised
with pytest.raises(ValueError, match="Either a local file path.*or both artist and title must be provided"):
with pytest.raises(ValueError, match=r"Either a local file path.*or both artist and title must be provided"):
await basic_karaoke_gen.process()
@pytest.mark.asyncio
@@ -610,7 +610,10 @@ class TestAsync:
with patch.object(basic_karaoke_gen, 'prep_single_track', new_callable=AsyncMock) as mock_prep_single_track:
mock_prep_single_track.return_value = {"track": "result"}
result = await basic_karaoke_gen.process()
await basic_karaoke_gen.process()
# Verify prep_single_track was called
mock_prep_single_track.assert_called_once()
# Verify URL mode was enabled
assert basic_karaoke_gen._use_audio_fetcher is True
@@ -631,7 +634,10 @@ class TestAsync:
with patch.object(basic_karaoke_gen, 'prep_single_track', new_callable=AsyncMock) as mock_prep_single_track:
mock_prep_single_track.return_value = {"track": "result"}
result = await basic_karaoke_gen.process()
await basic_karaoke_gen.process()
# Verify prep_single_track was called
mock_prep_single_track.assert_called_once()
# Verify URL mode was enabled
assert basic_karaoke_gen._use_audio_fetcher is True
@@ -645,7 +651,6 @@ class TestKaraokePrepIsUrlHelper:
@pytest.fixture
def karaoke_prep(self, tmp_path):
"""Create a KaraokePrep instance for testing."""
from karaoke_gen.karaoke_gen import KaraokePrep
return KaraokePrep(
artist="Test",
title="Test",
+6 -6
View File
@@ -2452,7 +2452,7 @@ class TestFlacFetchAudioFetcherDownloadFromUrl:
mock_manager.download_by_id.return_value = downloaded_path
mock_get_manager.return_value = mock_manager
result = fetcher.download_from_url(
fetcher.download_from_url(
url="https://www.youtube.com/embed/dQw4w9WgXcQ",
output_dir=str(tmp_path),
)
@@ -2468,7 +2468,7 @@ class TestFlacFetchAudioFetcherDownloadFromUrl:
mock_manager.download_by_id.return_value = downloaded_path
mock_get_manager.return_value = mock_manager
result = fetcher.download_from_url(
fetcher.download_from_url(
url="https://www.youtube.com/watch?v=test123test",
output_dir=str(tmp_path),
artist="Test Artist",
@@ -2486,7 +2486,7 @@ class TestFlacFetchAudioFetcherDownloadFromUrl:
mock_manager.download_by_id.return_value = downloaded_path
mock_get_manager.return_value = mock_manager
result = fetcher.download_from_url(
fetcher.download_from_url(
url="https://www.youtube.com/watch?v=dQw4w9WgXcQ",
output_dir=str(tmp_path),
)
@@ -2563,7 +2563,7 @@ class TestRemoteFlacFetchAudioFetcherDownloadFromUrl:
@patch('flacfetch.providers.youtube.YoutubeProvider')
@patch('flacfetch.downloaders.youtube.YoutubeDownloader')
def test_download_from_url_uses_local_flacfetch(
self, mock_yt_downloader, mock_yt_provider, mock_fetch_manager, fetcher, tmp_path
self, mock_yt_downloader, _mock_yt_provider, mock_fetch_manager, fetcher, tmp_path
):
"""Test that download_from_url uses local flacfetch (not remote API)."""
mock_manager_instance = MagicMock()
@@ -2593,7 +2593,7 @@ class TestRemoteFlacFetchAudioFetcherDownloadFromUrl:
@patch('flacfetch.providers.youtube.YoutubeProvider')
@patch('flacfetch.downloaders.youtube.YoutubeDownloader')
def test_download_from_url_extracts_video_id(
self, mock_yt_downloader, mock_yt_provider, mock_fetch_manager, fetcher, tmp_path
self, _mock_yt_downloader, _mock_yt_provider, mock_fetch_manager, fetcher, tmp_path
):
"""Test that video ID is extracted from URL correctly."""
mock_manager_instance = MagicMock()
@@ -2612,7 +2612,7 @@ class TestRemoteFlacFetchAudioFetcherDownloadFromUrl:
@patch('flacfetch.providers.youtube.YoutubeProvider')
@patch('flacfetch.downloaders.youtube.YoutubeDownloader')
def test_download_from_url_raises_on_failure(
self, mock_yt_downloader, mock_yt_provider, mock_fetch_manager, fetcher, tmp_path
self, _mock_yt_downloader, _mock_yt_provider, mock_fetch_manager, fetcher, tmp_path
):
"""Test that DownloadError is raised on failure."""
mock_manager_instance = MagicMock()