Compare commits

...
Author SHA1 Message Date
Andrew BeveridgeandClaude Opus 4.5 8a28c95786 Simplify flacfetch workflow: no PR required
flacfetch changes can be committed directly to main once tests pass.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 23:07:36 -05:00
Andrew BeveridgeandClaude Opus 4.5 48acb6c4e1 Add flacfetch as a related project with workflow docs
Documents that flacfetch is a dependency we own, located at
/Users/andrew/Projects/flacfetch, and provides the workflow for
making changes to it and updating karaoke-gen's dependency.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 23:07:05 -05:00
Andrew BeveridgeandClaude Opus 4.5 da60495144 Clarify version bump rule applies only to code changes
Documentation-only changes (CLAUDE.md, README.md, etc.) don't require
version bumps since they don't affect deployed code.

Also reverts the unnecessary version bump from the previous commit.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 23:04:39 -05:00
Andrew BeveridgeandClaude Opus 4.5 e282f40758 Make git worktrees mandatory for all changes
Since all changes must go through a PR, worktrees are now required for
all changes (not just non-trivial ones). This keeps the main directory
clean on main and enables parallel work.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 23:03:54 -05:00
Andrew Beveridge ☄️ 6da6656c15 Merge pull request #76 from nomadkaraoke/fix/remove-deployment-tracking
Remove deployment tracking to fix PR banner
2025-12-27 22:50:44 -05:00
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
6 changed files with 78 additions and 27 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
+32 -11
View File
@@ -18,18 +18,15 @@ Create descriptive branch names like `feature/add-discord-notifications`, `fix/a
### Using Git Worktrees
**For non-trivial changes** (new features, multi-file edits, refactors):
- Create a git worktree in the parent folder before making any file changes:
```bash
git worktree add ../karaoke-gen-feat-xyz feature/xyz
```
**All changes require a git worktree.** Since all changes must go through a PR, always create a worktree in the parent folder before making any file changes:
```bash
git worktree add -b feature/xyz ../karaoke-gen-feat-xyz main
```
- This keeps the main directory clean on `main` and enables parallel work on multiple features
- Name the worktree folder descriptively, e.g., `../karaoke-gen-fix-audio-sync`
**For trivial changes** (typos, single-line fixes):
- Creating a branch in the current directory is acceptable
- Use `git checkout -b fix/typo-xyz` before making changes
**Cleanup:** When done with a worktree, remove it with:
```bash
git worktree remove ../karaoke-gen-feat-xyz
@@ -75,11 +72,13 @@ Do not attempt to work around auth issues or make assumptions about credentials.
## Version Management
When committing and pushing changes, always bump the patch version in `pyproject.toml`.
When committing and pushing **code changes**, bump the patch version in `pyproject.toml`.
The version is located at `tool.poetry.version` in `pyproject.toml`. For example, if the current version is `0.70.3`, bump it to `0.70.4`.
This ensures every commit pushed to the repository has a unique version number for tracking and deployment purposes.
**Skip version bumps** for documentation-only changes (e.g., updating `CLAUDE.md`, `README.md`, or other markdown files) that don't affect deployed code.
This ensures every code release has a unique version number for tracking and deployment purposes.
## Testing Requirements
@@ -129,3 +128,25 @@ Individual test commands:
**Do not commit or push code that fails tests. Fix any test failures before proceeding.**
## Related Projects
### flacfetch
**Location:** `/Users/andrew/Projects/flacfetch`
The `flacfetch` package is a dependency of karaoke-gen that we also own. When working on features that interact with flacfetch, you can read and modify its code directly.
**Workflow for flacfetch changes:**
1. Navigate to `/Users/andrew/Projects/flacfetch`
2. Make changes directly on `main` (no PR required for this repo)
3. Run tests and ensure they pass
4. Bump the version in flacfetch's `pyproject.toml`
5. Commit and push to `main`
6. Wait for CI workflow to complete and auto-release the new version
7. Return to karaoke-gen and update the poetry dependency:
```bash
poetry update flacfetch
```
8. Commit the updated `poetry.lock` in karaoke-gen
+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()