## Summary
Adds `POST /api/internal/jobs/{job_id}/auto-approval-eval` (admin-only):
re-runs the auto-approval evaluator on a job parked at AWAITING_REVIEW.
The KaraokeHunt outreach batch runs with `made_for_you: true`
(stale-review exemption), which is also an enforcement blocker at
scoring time — this endpoint lets us lift the flag and re-evaluate so
confident jobs full-auto through review.
## Testing
- `test_internal_api.py::TestAutoApprovalEval` — outcome passthrough +
auth required; file green in full-collection run.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Administrators can manually re-run auto-approval evaluation for jobs
awaiting review.
- Jobs remain in review unless the evaluation is fully confident,
providing a fail-safe review process.
- **Bug Fixes**
- Improved batch job processing so an issue updating an optional job
setting no longer stops the remaining workflow.
- Prevented missing cached results from causing failures during
recanonicalization tasks.
- **Tests**
- Added coverage for authorized evaluation requests and unauthorized
access.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
- Remove mock_auth_service fixture dependency from test_internal_api.py
and test_upload_api.py (now using autouse mock_auth_dependency from conftest)
- Add upload_auth_headers fixture for file upload tests (no Content-Type header
to avoid breaking multipart form data)
- Add service._remote_client = None to audio search tests to prevent hitting
remote flacfetch service
- Add proper skipif decorator for TestRemoteCLIStyleParsing when flacfetch
module is not properly installed
- Add headers=auth_headers to emulator integration test for annotations endpoint
- Fix headers=upload_auth_headers usage in all file upload tests
Fixed authentication in unit tests after adding require_auth to 33+ endpoints:
1. Added missing imports (Depends, Tuple) to route files:
- file_upload.py, audio_search.py, review.py
2. Updated conftest.py with proper auth mocking:
- Use FastAPI's dependency_overrides system
- Mock require_auth and require_admin to return valid admin credentials
- Apply automatically to all non-emulator tests
3. Auto-fixed 6 test files to include auth_headers:
- test_jobs_api.py
- test_upload_api.py
- test_api_routes.py
- test_internal_api.py
- test_emulator_integration.py (both copies)
4. Fixed test client fixtures:
- Removed mock_auth_service parameter (replaced by global fixture)
- Tests now use dependency_overrides instead of patching
Tests verified passing locally for test_jobs_api.py.
Let CI run the full test suite to verify all tests pass.
Related: PR #45
Address CodeRabbit PR review feedback:
- Add admin auth to internal worker endpoints and bulk delete
- Add request timeouts to all HTTP calls (credential_manager, tests)
- Fix async sleep in lyrics worker to not block event loop
- Fix background task garbage collection in review routes
- Fix exception chaining and f-string issues
- Remove duplicate emulators_running() function
- Update tests to include auth headers and test 401 responses
- Update remote CLI to actually use KARAOKE_GEN_AUTH_TOKEN env var
- Document authentication in README
The admin token is read from ADMIN_TOKENS env var (comma-separated).
WorkerService now includes the token when calling internal endpoints.