fix: add missing field handlers in proxy host Update endpoint

Add handlers for enable_standard_headers, forward_auth_enabled, and waf_disabled fields
in the proxy host Update function. These fields were defined in the model but were not
being processed during updates, causing:

- 500 errors when saving proxy host configurations
- Auth pass-through failures for apps like Seerr/Overseerr due to missing X-Forwarded-* headers

Changes:
- backend: Add field handlers for 3 missing fields in proxy_host_handler.go
- backend: Add 5 comprehensive unit tests for field handling
- frontend: Update TypeScript ProxyHost interface with missing fields
- docs: Document fixes in CHANGELOG.md

Tests: All 1147 tests pass (backend 85.6%, frontend 87.7% coverage)
Security: No vulnerabilities (Trivy + govulncheck clean)

Fixes #16 (auth pass-through)
Fixes #17 (500 error on save)
This commit is contained in:
GitHub Actions
2025-12-20 01:55:52 +00:00
parent 6712ee9e43
commit f936c93896
62 changed files with 4301 additions and 1685 deletions

View File

@@ -11,6 +11,7 @@
The pre-commit performance fix implementation (as specified in `docs/plans/precommit_performance_fix_spec.md`) has been **successfully verified**. All 8 target files were updated correctly, manual hooks function as expected, coverage tests pass with required thresholds, and all linting tasks complete successfully.
**Key Achievements**:
- ✅ Pre-commit execution time: **8.15 seconds** (target: <10 seconds)
- ✅ Backend coverage: **85.4%** (minimum: 85%)
- ✅ Frontend coverage: **89.44%** (minimum: 85%)
@@ -29,6 +30,7 @@ The pre-commit performance fix implementation (as specified in `docs/plans/preco
**Status**: ✅ **VERIFIED**
**Changes Implemented**:
- `go-test-coverage` hook moved to manual stage
- Line 23: `stages: [manual]` added
- Line 20: Name updated to "Go Test Coverage (Manual)"
@@ -47,6 +49,7 @@ The pre-commit performance fix implementation (as specified in `docs/plans/preco
**Status**: ✅ **VERIFIED**
**Changes Implemented**:
- Definition of Done section expanded from 3 steps to 5 steps
- Step 2 (Coverage Testing) added with:
- Backend coverage requirements (85% threshold)
@@ -69,6 +72,7 @@ The pre-commit performance fix implementation (as specified in `docs/plans/preco
**Status**: ✅ **VERIFIED**
**Changes Implemented**:
- Verification section (Step 3) updated with:
- Coverage marked as MANDATORY
- VS Code task reference added: "Test: Backend with Coverage"
@@ -88,6 +92,7 @@ The pre-commit performance fix implementation (as specified in `docs/plans/preco
**Status**: ✅ **VERIFIED**
**Changes Implemented**:
- Verification section (Step 3) reorganized into 4 gates:
- **Gate 1: Static Analysis** - TypeScript type-check marked as MANDATORY
- **Gate 2: Logic** - Test execution
@@ -110,6 +115,7 @@ The pre-commit performance fix implementation (as specified in `docs/plans/preco
**Status**: ✅ **VERIFIED**
**Changes Implemented**:
- Definition of Done section expanded from 1 paragraph to 5 numbered steps:
- **Step 1: Coverage Tests** - MANDATORY with both backend and frontend
- **Step 2: Type Safety** - Frontend TypeScript check
@@ -130,6 +136,7 @@ The pre-commit performance fix implementation (as specified in `docs/plans/preco
**Status**: ✅ **VERIFIED**
**Changes Implemented**:
- Definition of Done section expanded from 1 paragraph to 5 numbered steps:
- **Step 1: Coverage Tests** - Emphasizes VERIFICATION of subagent execution
- **Step 2: Type Safety** - Ensures Frontend_Dev ran checks
@@ -152,6 +159,7 @@ The pre-commit performance fix implementation (as specified in `docs/plans/preco
**Status**: ✅ **VERIFIED**
**Changes Implemented**:
- New section added: `<coverage_and_ci>` (after line 35)
- Section content includes:
- Documentation of CI workflows that run coverage tests
@@ -170,6 +178,7 @@ The pre-commit performance fix implementation (as specified in `docs/plans/preco
**Status**: ✅ **VERIFIED**
**Changes Implemented**:
- Output format section updated (Phase 3: QA & Security)
- Coverage Tests section added as Step 2:
- Backend and frontend coverage requirements
@@ -192,11 +201,13 @@ The pre-commit performance fix implementation (as specified in `docs/plans/preco
**Result**: ✅ **PASSED**
**Metrics**:
- **Real time**: 8.153 seconds
- **Target**: <10 seconds
- **Performance gain**: ~70% faster than pre-fix (estimated 30+ seconds)
**Hooks Executed** (Fast hooks only):
1. fix end of files - Passed
2. trim trailing whitespace - Passed
3. check yaml - Passed
@@ -210,6 +221,7 @@ The pre-commit performance fix implementation (as specified in `docs/plans/preco
11. Frontend Lint (Fix) - Passed
**Hooks NOT Executed** (Manual stage - as expected):
- `go-test-coverage`
- `frontend-type-check`
- `go-test-race`
@@ -230,6 +242,7 @@ The pre-commit performance fix implementation (as specified in `docs/plans/preco
**Result**: ✅ **PASSED**
**Output Summary**:
- Total backend tests: 289 tests
- Test status: All passed (0 failures, 3 skips)
- Coverage: **85.4%** (statements)
@@ -237,6 +250,7 @@ The pre-commit performance fix implementation (as specified in `docs/plans/preco
- Test duration: ~34 seconds
**Coverage Breakdown by Package**:
- `internal/api`: 84.2%
- `internal/caddy`: 83.7%
- `internal/database`: 79.8%
@@ -278,12 +292,14 @@ The pre-commit performance fix implementation (as specified in `docs/plans/preco
**Result**: ✅ **PASSED**
**Output Summary**:
- Total frontend tests: All passed
- Coverage: **89.44%** (statements)
- Minimum required: 85%
- Test duration: ~12 seconds
**Coverage Breakdown by Directory**:
- `api/`: 96.48%
- `components/`: 88.38%
- `context/`: 85.71%
@@ -301,6 +317,7 @@ The pre-commit performance fix implementation (as specified in `docs/plans/preco
#### Task 2.4.1: Test: Backend with Coverage
**Task Definition**:
```json
{
"label": "Test: Backend with Coverage",
@@ -319,6 +336,7 @@ The pre-commit performance fix implementation (as specified in `docs/plans/preco
#### Task 2.4.2: Test: Frontend with Coverage
**Task Definition**:
```json
{
"label": "Test: Frontend with Coverage",
@@ -337,6 +355,7 @@ The pre-commit performance fix implementation (as specified in `docs/plans/preco
#### Task 2.4.3: Lint: TypeScript Check
**Task Definition**:
```json
{
"label": "Lint: TypeScript Check",
@@ -522,6 +541,7 @@ As specified in `.github/copilot-instructions.md`, the following checks were per
**Status**: ✅ **NO CHANGES REQUIRED**
**Reasoning**:
- CI workflows call coverage scripts directly (not via pre-commit)
- `.github/workflows/codecov-upload.yml` executes:
- `bash scripts/go-test-coverage.sh`
@@ -585,6 +605,7 @@ As defined in the specification:
### 10.2 Documentation Updates
**Recommendation**: Update `CONTRIBUTING.md` (if it exists) to mention:
- Manual hooks for coverage testing
- VS Code tasks for running coverage locally
- New Definition of Done workflow