# DSOL - Epic Breakdown

**Date:** 2025-12-05
**Project Level:** Quick Flow - Single Story

---

## Epic 1: Redis Configuration Simplification

**Slug:** redis-url-migration

### Goal

Simplify Redis configuration by replacing 4 individual environment variables (REDIS_HOST, REDIS_PORT, REDIS_PASSWORD, REDIS_DB) with a single REDIS_URL that accepts the full connection string directly, enabling seamless Azure Redis Cache integration.

### Scope

**In Scope:**
- Remove individual Redis configuration fields from Settings class
- Add single redis_url field with default value
- Update .env.example with new REDIS_URL format
- Update docker-compose.yml to use REDIS_URL
- Update and create unit tests for new configuration
- Update README.md documentation

**Out of Scope:**
- Backward compatibility with old environment variables
- URL format validation (handled by Redis client)
- Connection pooling changes
- Redis client library upgrades
- Migration scripts for existing deployments

### Success Criteria

1. Settings class uses single redis_url field (no property method)
2. Application connects successfully to both local Redis (redis://) and Azure Redis (rediss://)
3. All existing tests pass (no regressions)
4. New unit tests validate direct redis_url field
5. Celery and progress tracking services work unchanged
6. Documentation updated with new configuration format

### Dependencies

**Prerequisites:**
- None (standalone change)

**External Dependencies:**
- Redis server (local or Azure Redis Cache)
- Existing redis 5.0+ and Celery 5.3+ libraries (no upgrades needed)

---

## Story Map - Epic 1

```
Epic 1: Redis Configuration Simplification
│
└── Story 1.1: Replace Redis env vars with single REDIS_URL
    ├── Update Settings class (remove fields, add redis_url)
    ├── Update .env.example (new format with examples)
    ├── Update docker-compose.yml (simplified Redis config)
    ├── Update tests (remove old, add new)
    ├── Update README.md (configuration section)
    └── Verify all integration points work
```

---

## Stories - Epic 1

### Story 1.1: Replace Redis Configuration with Single URL

As a **developer**,
I want **Redis configuration via a single REDIS_URL environment variable**,
So that **I can easily configure the application for both local development and Azure Redis Cache without splitting connection strings into multiple parts**.

**Acceptance Criteria:**

**Given** the Settings class in src/core/config.py
**When** the application loads configuration from environment
**Then** it uses a single redis_url field instead of 4 individual fields

**And** the redis_url supports both redis:// (non-SSL) and rediss:// (SSL) schemes

**And** Celery connects successfully using settings.redis_url

**And** Progress tracker initializes successfully using settings.redis_url

**And** all existing tests pass without modification to Redis consumers

**And** new unit tests validate direct redis_url field behavior

**And** .env.example shows clear examples for local and Azure configurations

**And** docker-compose.yml uses simplified Redis configuration

**Prerequisites:** None (standalone story)

**Technical Notes:**
- Remove redis_host, redis_port, redis_password, redis_db fields
- Remove @property redis_url() method
- Add direct field: redis_url: str = "redis://localhost:6379"
- No changes needed in services using settings.redis_url (field replaces property)
- Both redis and celery libraries natively parse URLs

---

## Implementation Timeline - Epic 1

**Total Story Points:** 2 points

**Implementation Phases:**
1. Configuration refactoring (Settings class)
2. Environment and infrastructure updates
3. Test updates and verification

---
