Commit Graph

20 Commits

Author SHA1 Message Date
rishikanthc
913063eb49 refactor: Switch yt-dlp to standalone binary & cleanup UV config
- Dockerfiles: Install yt-dlp binary from GitHub releases to /usr/local/bin
- Go: Execute yt-dlp binary directly, removing uv python wrapper
- Config: Remove unused UVPath configuration and findUVPath function
- Entrypoint: Remove yt-dlp init logic (still initializes whisperx env if needed)
2025-12-16 19:07:29 -08:00
rishikanthc
c44de7858b refactor: Complete repository pattern migration for all remaining files (Phases 5-7)
Phase 5: Refactor queue.go (10 DB calls removed)
- Added JobRepository to TaskQueue struct and constructor
- Added UpdateStatus, UpdateError, FindByStatus, CountByStatus methods to JobRepository
- Replaced all database.DB calls with repository methods

Phase 6: Refactor chat_handlers.go and summarize_handlers.go (6 DB calls removed)
- Added GetMessageCountsBySessionIDs and GetLastMessagesBySessionIDs to ChatRepository
- Added UpdateSummary to JobRepository
- Replaced batch queries and update calls with repository methods
- Removed database import from both files

Phase 7: Refactor quick_transcription.go (3 DB calls removed)
- Added JobRepository injection to QuickTranscriptionService
- Updated constructor and all callers

Summary: 46+ database.DB calls replaced with repository methods across 7 phases.
All tests pass, build succeeds.
2025-12-16 18:21:36 -08:00
rishikanthc
86add0037d refactor: Replace direct database.DB calls with repository pattern in handlers, dropzone, and multitrack_processor
Phase 1: Define interfaces
- Created internal/interfaces/ package with AuthServiceInterface, TaskQueueInterface, JobProcessorInterface

Phase 2: Refactor handlers.go (21 DB calls removed)
- Replaced all database.DB calls with repository methods
- Added RefreshTokenRepository for token management
- Added new repository methods: Count, FindActiveTrackJobs, FindLatestCompletedExecution, FindByName

Phase 3: Refactor dropzone.go (3 DB calls removed)
- Added CountWithAutoTranscription to UserRepository
- Injected JobRepository and UserRepository into Service

Phase 4: Refactor multitrack_processor.go
- Changed constructor to accept *gorm.DB and JobRepository
- Updated Handler to inject MultiTrackProcessor

Updated all test files with new dependencies and mock implementations.
2025-12-16 18:21:36 -08:00
rishikanthc
7fc7619ee6 fix: tests for upstream changes
fix: new tests for chat and user management flows

fix: resolve lint errors

fix: configured lefthook to check entire project
2025-12-16 18:21:36 -08:00
rishikanthc
658a1a5c49 fix: lint errors in go code 2025-12-16 18:21:36 -08:00
rishikanthc
cc92c02b39 fix: resolve rebase regressions in tests and update docs 2025-12-07 15:25:59 -08:00
rishikanthc
d752012a76 feat: implement server-side delta sync with soft deletes and updated_after param 2025-12-07 15:22:16 -08:00
rishikanthc
009836dd03 feat(cli): add auto-install script, settings tab, and fix macos crash 2025-11-29 10:21:47 -08:00
rishikanthc
99031c5054 major refactor 2025-11-26 19:45:31 -08:00
rishikanthc
377ac4fd12 fixes #232 2025-11-25 09:12:28 -08:00
Geoff Tognetti
cdf95d2b45 Fix unit tests - achieve 7/7 passing test suites
Hi there, I wanted to pull this in to my CI/CD platform and saw your unit tests were due for a refactor, so I did it for you. Enjoy!

## Summary

This PR refactors and fixes all unit tests to achieve 7/7 passing test suites (up from 3/7). The changes validate PR #260's dependency injection pattern and update tests to match the current adapter-based architecture.

## Changes Made

### 1. New Adapter Registration Tests
- Created comprehensive test suite for PR #260's dependency injection pattern
- Tests verify all adapters accept custom envPath parameters
- Validates model storage location fix works correctly
- Tests registry clearing and adapter registration

### 2. Registry Test Helpers
- Added ClearRegistry() - clears all registered adapters for test isolation
- Added GetTranscriptionAdapters() - retrieves all transcription adapters
- Added GetDiarizationAdapters() - retrieves all diarization adapters
- These helpers enable proper testing of adapter registration

### 3. Migrated Tests to New Architecture
Updated three test files to use UnifiedJobProcessor instead of removed WhisperXService:
- tests/security_test.go
- tests/api_handlers_test.go
- Retired tests/transcription_service_test.go (renamed to .old)

### 4. Fixed Queue Test Failures
Fixed 5 failing tests in tests/queue_test.go:
- Updated stats field: "workers" changed to "current_workers" (2 tests)
- Updated mock method: "ProcessJob" changed to "ProcessJobWithProcess" with third parameter (3 tests)

### 5. Test Script Improvements
Enhanced run_tests.sh:
- Added frontend build check and automatic build if needed
- Fixed database cleanup bug using find instead of glob patterns
- Properly captures test exit codes
- Added adapter registration test suite

### 6. API Handler Fixes
Fixed tests/api_handlers_test.go:
- Updated queue stats expectations
- Fixed supported models response (array to map)
- Migrated to UnifiedJobProcessor

## Test Results

Before: 3/7 passing (Security, Auth, LLM)
After: 7/7 passing (all suites)

Test Suites:
1. Security Tests
2. Authentication Service Tests
3. LLM Integration Tests
4. Database Tests
5. Queue Management Tests
6. API Handler Tests
7. Adapter Registration Tests (NEW)
2025-11-18 11:13:53 -08:00
rishikanthc
e24a075f94 fixes persistence of API keys 2025-09-09 20:22:31 -07:00
rishikanthc
ce0b85fa23 adds support for video transcription - formatter run touched all files 2025-09-07 18:24:00 -07:00
rishikanthc
c2de028627 fixes job termination 2025-09-01 19:52:43 -07:00
rishikanthc
4c2cda76e4 adds more tests 2025-08-29 10:08:41 -07:00
rishikanthc
055be15f28 adds tests and modifies backend to enable testing 2025-08-29 10:04:10 -07:00
rishikanthc
ed9f50abe1 adds security tests 2025-08-29 09:17:34 -07:00
rishikanthc
513914a6da test ci/cd 2025-08-28 15:19:03 -07:00
rishikanthc
207512e6fa remove output related psrsmeters snd organize diarization parameters 2025-08-25 11:52:39 -07:00
rishikanthc
96aeaf1454 basic UI 2025-08-21 15:48:55 -07:00