Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/CHANGELOG-test-fixes.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ This change achieves 100% test success across all test suites (571+ tests) by fi
## Issues Resolved

### 1. Redis Cluster Restart Loop (CRITICAL)

**Problem**: Redis cluster nodes were in a continuous restart loop due to invalid configuration syntax.

**Root Cause**: The `--save "no"` command-line argument is invalid in Redis 7.x. When `REDIS_SAVE_ENABLED=no` was set in the environment, docker-compose passed `--save no` which Redis rejected with:

```
*** FATAL CONFIG FILE ERROR (Redis 7.4.6) ***
Invalid save parameters
Expand All @@ -18,6 +20,7 @@ Invalid save parameters
**Solution**: Disabled RDB snapshots by commenting out the `--save` flag in docker-compose.yml for development performance, as documented in Phase 3 - Task 3.2.

**Files Modified**:

- `docker-compose.yml` - Commented out `--save` flags for redis-1, redis-2, redis-3
- `.env` - Commented out `REDIS_SAVE_ENABLED` variable

Expand All @@ -26,32 +29,38 @@ Invalid save parameters
---

### 2. GitHub Actions Wiki Sync Workflow Failure (CRITICAL)

**Problem**: Wiki sync workflow was failing with exit code 1 after processing only one file.

**Root Cause**: Bash arithmetic post-increment with `bash -e` (errexit mode):

- `((SKIPPED++))` when SKIPPED=0 returns the old value (0)
- In bash arithmetic, 0 is false, which returns exit code 1
- The `-e` flag causes immediate script termination on non-zero exit codes

**Solution**: Added `|| true` to all arithmetic increment operations to prevent early termination:

```bash
((SYNCED++)) || true
((SKIPPED++)) || true
```

**Files Modified**:

- `.github/workflows/wiki-sync.yml` - Lines 74, 77, 81

**Impact**: Wiki sync workflow now completes successfully and properly syncs all documentation files.

---

### 3. FastAPI Unit Test Failure

**Problem**: `test_service_name_validation` was failing when testing invalid service names.

**Root Cause**: When a path parameter contains "/" (e.g., "service/name"), FastAPI's router treats it as a multi-segment path. The URL `/examples/vault/secret/service/name` was being routed to the two-parameter endpoint instead of the single-parameter endpoint, resulting in a 503 error instead of the expected 422 validation error.

**Solution**: Updated test expectations to account for FastAPI's routing behavior:

```python
invalid_names_with_expected_codes = [
("invalid service", [400, 422]), # Validation error for space
Expand All @@ -62,30 +71,37 @@ invalid_names_with_expected_codes = [
```

**Files Modified**:

- `reference-apps/fastapi/tests/test_api_endpoints_integration.py` - Lines 239-257

**Impact**: Python unit tests now pass 206/206 tests (100%).

---

### 4. API Parity Test Failures (9 tests)

**Problem**: All api-first implementation tests were failing with 500 errors.

**Root Cause**: The api-first implementation was unable to authenticate with Vault because:

1. Missing `VAULT_APPROLE_DIR` configuration
2. Cache manager not initialized with Vault credentials
3. Missing AppRole authentication support in startup

**Solutions Implemented**:

#### 4.1 Added VAULT_APPROLE_DIR Configuration

```python
VAULT_APPROLE_DIR: str = os.getenv("VAULT_APPROLE_DIR", "/vault-approles/api-first")
```

**File**: `reference-apps/fastapi-api-first/app/config.py` - Line 24

#### 4.2 Added Cache Manager Initialization

Implemented proper cache initialization in startup event to match code-first implementation:

```python
@app.on_event("startup")
async def startup_event():
Expand All @@ -99,15 +115,18 @@ async def startup_event():
logger.error(f"Failed to initialize cache: {e}")
logger.warning("Application will continue without caching")
```

**File**: `reference-apps/fastapi-api-first/app/main.py` - Lines 157-178

#### 4.3 Added Shutdown Event Handler

```python
@app.on_event("shutdown")
async def shutdown_event():
await cache_manager.close()
logger.info("Shutting down API-First FastAPI application...")
```

**File**: `reference-apps/fastapi-api-first/app/main.py` - Lines 181-186

**Impact**: All 64 API parity tests now pass (100%), ensuring both implementations are functionally equivalent.
Expand All @@ -117,18 +136,21 @@ async def shutdown_event():
## Test Results Summary

### Before Fixes

- Infrastructure Tests: 15/16 passing (FastAPI tests failing)
- Python Unit Tests: 205/206 passing
- API Parity Tests: 55/64 passing
- **Overall**: ~93% success rate

### After Fixes

- Infrastructure Tests: 16/16 passing ✅
- Python Unit Tests: 206/206 passing ✅
- API Parity Tests: 64/64 passing ✅
- **Overall**: **100% success rate**

### Total Test Coverage

- **571+ tests** passing across all test suites
- **0 failures**
- **1 skipped** (Observability Stack - services not running)
Expand All @@ -150,11 +172,13 @@ async def shutdown_event():
## Verification

Run the complete test suite:

```bash
./tests/run-all-tests.sh
```

Expected output:

```
Test Suites Run: 17
Passed: 16
Expand All @@ -164,6 +188,7 @@ Skipped: 1
```

Run specific test suites:

```bash
# Python unit tests
docker exec dev-reference-api pytest tests/ -v
Expand Down
60 changes: 43 additions & 17 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,38 @@
- [Added](#added)
- [Changed](#changed)
- [Fixed](#fixed)
- [Removed](#removed)
- [Security](#security)
- [[1.0.0] - 2025-10-23](#100-2025-10-23)
- [Added](#added)
- [Security](#security)
- [[1.3.0] - 2025-11-05](#130---2025-11-05)
- [Changed](#changed-1)
- [Added](#added-1)
- [Fixed](#fixed-1)
- [[1.2.1] - 2025-10-30](#121---2025-10-30)
- [Added](#added-2)
- [Changed](#changed-2)
- [Fixed](#fixed-2)
- [Security](#security-1)
- [[1.2.0] - 2025-10-29](#120---2025-10-29)
- [Added](#added-3)
- [Changed](#changed-3)
- [Documentation Quality](#documentation-quality)
- [[1.1.1] - 2025-10-29](#111---2025-10-29)
- [Added](#added-4)
- [Changed](#changed-4)
- [Fixed](#fixed-3)
- [Security](#security-2)
- [[1.0.0] - 2025-10-23](#100---2025-10-23)
- [Added](#added-5)
- [Security](#security-3)
- [Version History Guidelines](#version-history-guidelines)
- [Version Format](#version-format)
- [[X.Y.Z] - YYYY-MM-DD](#xyz-yyyy-mm-dd)
- [Change Categories](#change-categories)
- [Example Entry](#example-entry)
- [[1.0.0] - 2025-01-15](#100-2025-01-15)
- [Added](#added)
- [Changed](#changed)
- [Fixed](#fixed)
- [Security](#security)
- [Semantic Versioning](#semantic-versioning)
- [When to Update](#when-to-update)
- [Best Practices](#best-practices)
- [Migration Notes](#migration-notes)
- [Migration from 0.x to 1.0](#migration-from-0x-to-10)
- [Archive](#archive)
- [[X.Y.Z] - YYYY-MM-DD](#xyz-yyyy-mm-dd)
- [Added](#added)
- [Changed](#changed)
- [Deprecated](#deprecated)
- [Removed](#removed)
- [Fixed](#fixed)
- [Security](#security)

---

Expand All @@ -44,6 +49,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Added

- **Redis TLS encryption with dual-port configuration**
- Implemented TLS support for all 3 Redis cluster nodes
- Port 6379: Non-TLS connections (backward compatible)
Expand All @@ -66,6 +72,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Updated test suite documentation to include Rust testing

### Changed

- **Updated network IPs to reflect 4-tier segmentation architecture**
- Redis cluster IPs: 172.20.0.13/16/17 → 172.20.2.13/16/17 (data network)
- Updated across all documentation: `docs/REDIS.md`, `docs/SERVICES.md`, `docs/ENVIRONMENT_VARIABLES.md`
Expand All @@ -82,6 +89,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Updated across all documentation files: CLAUDE.md, README.md, reference-apps/README.md, docs/ARCHITECTURE.md, docs/SERVICES.md, docs/PERFORMANCE_BASELINE.md

### Fixed

- **Observability test suite syntax error**
- Fixed `tests/test-observability.sh:286` grep pattern causing "integer expression expected" error
- Changed `grep -c "pattern" || echo "0"` to `grep -c "pattern" || true`
Expand All @@ -93,13 +101,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Prevents "installation page" issue when forgejo database is missing

### Removed

- Removed redundant historical documentation files from project root
- Deleted `RUST_DOCUMENTATION_UPDATE.md` (297 lines) - historical analysis already captured in changelog
- Deleted `FIXES.md` (174 lines) - test suite fixes already applied to codebase
- Enforces project mandate: all documentation must be in `docs/` subdirectory
- Only `README.md` and `CLAUDE.md` remain in project root (per project standards)

### Security

- **Completed AppRole authentication migration for all services (100% complete)**
- Migrated all 7 services (9 instances) from Vault root token to AppRole authentication
- Services: PostgreSQL, MySQL, MongoDB, Redis (3 nodes), RabbitMQ, Forgejo, Reference API
Expand Down Expand Up @@ -147,10 +157,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [1.2.1] - 2025-10-30

### Added

- Comprehensive Dependabot monitoring for all 7 package ecosystems (Docker, GitHub Actions, Python, Go, Node.js, Rust, TypeScript)
- DEPENDENCY_UPGRADE_REPORT.md documenting **ALL 30 merged PRs (100% success rate)** and Go 1.24 upgrade process

### Changed

- **MAJOR:** Upgraded Golang reference implementation from Go 1.23 to Go 1.24.0
- Updated `reference-apps/golang/go.mod` to require Go 1.24.0
- Updated `reference-apps/golang/Dockerfile` to use golang:1.24rc1-alpine with GOTOOLCHAIN=auto
Expand All @@ -168,12 +180,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- express-rate-limit 7.5.1 → 8.2.0 (nodejs) - Resolved conflicts successfully

### Fixed

- Dependabot configuration file had empty package-ecosystem field causing GitHub validation errors
- Go 1.24.0 dependency requirements resolved using GOTOOLCHAIN=auto approach
- Docker build issues for golang-api container with Go 1.24rc1
- Multiple merge conflicts across go.mod, requirements.txt, Cargo.toml, package.json

### Security

- Multiple security updates across all dependencies via Dependabot PRs
- All SSL/TLS connections verified working with TLSv1.3
- 100% test pass rate (43+ infrastructure tests) after upgrades
Expand All @@ -183,6 +197,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [1.2.0] - 2025-10-29

### Added

- **World-Class Documentation Implementation** (5,600+ lines, 9.7/10 rating, top 0.5% of projects)
- docs/ENVIRONMENT_VARIABLES.md (700 lines) - Complete reference for all 100+ environment variables organized by service
- docs/DISASTER_RECOVERY.md (600 lines) - 30-minute RTO recovery procedures for all failure scenarios
Expand All @@ -204,11 +219,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- All docs/, reference-apps/, tests/, and project files accessible via wiki

### Changed

- Enhanced reference-apps/rust/README.md with "MINIMAL EXAMPLE - INTENTIONALLY INCOMPLETE" disclaimer
- Updated all documentation to world-class standards (98% coverage)
- Improved documentation discoverability through wiki organization

### Documentation Quality

- **Before:** 52,000 lines, 8.5/10 (A-)
- **After:** 62,000+ lines, 9.7/10 (A+)
- **Achievement:** Top 0.5% of open-source projects
Expand All @@ -219,6 +236,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [1.1.1] - 2025-10-29

### Added

- Created `.github/` directory for project metadata files
- Created `assets/` directory for project assets
- Complete architecture documentation (docs/ARCHITECTURE.md) with Mermaid diagrams
Expand Down Expand Up @@ -246,6 +264,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Comprehensive security remediation plan (SECURITY_REMEDIATION.md) documenting all 63 CodeQL alerts

### Changed

- **Repository Structure**: Reorganized root directory for improved clarity
- Moved project metadata to `.github/`: CHANGELOG.md, CODE_OF_CONDUCT.md, CONTRIBUTING.md, SECURITY.md
- Moved validate-cicd.sh to `scripts/` directory
Expand All @@ -265,13 +284,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Improved documentation structure with proper H1 headers in all extracted docs

### Fixed

- GitHub Actions security workflow now scans both Python and Go code
- Documented critical Vault bootstrap requirement in troubleshooting guide
- Go module version in reference-apps/golang/go.mod (1.24.0 → 1.23)
- golang-api health check now uses GET request instead of HEAD for proper Gin framework compatibility
- Gitleaks security scanning false positives on documentation example secrets (Vault keys and passwords)

### Security

- **CRITICAL**: Fixed 2 Server-Side Request Forgery (SSRF) vulnerabilities in Vault service
- Added path validation and sanitization to prevent SSRF attacks
- Implemented safe URL construction with urljoin
Expand All @@ -292,6 +313,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [1.0.0] - 2025-10-23

### Added

- Complete Docker Compose infrastructure for local development on Apple Silicon
- PostgreSQL 18 with connection pooling via PgBouncer
- MySQL 8.0 for legacy application support
Expand Down Expand Up @@ -325,6 +347,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Troubleshooting guides for common issues

### Security

- Vault-managed credentials for all services
- Network isolation via Docker bridge network
- Optional TLS encryption for all database services
Expand All @@ -339,11 +362,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
When releasing a new version, move changes from [Unreleased] to a new version section:

### Version Format

```markdown
## [X.Y.Z] - YYYY-MM-DD
```

### Change Categories

- **Added** - New features
- **Changed** - Changes in existing functionality
- **Deprecated** - Soon-to-be removed features
Expand All @@ -352,6 +377,7 @@ When releasing a new version, move changes from [Unreleased] to a new version se
- **Security** - Security improvements or vulnerability fixes

### Example Entry

```markdown
## [1.0.0] - 2025-01-15

Expand Down
Loading
Loading