Commit d0522b9
Production-ready improvements (v3.4.0)
## 🎉 Major Improvements
### Performance & Reliability
- **LRU Cache**: Added size limits (max 1000 entries) with automatic eviction
- **Retry Logic**: Exponential backoff for API calls (3 retries: 2s, 4s, 8s)
- **Health Check**: New MCP tool for monitoring server status and cache stats
### Developer Experience
- **Docker Support**: Complete containerization with Dockerfile and docker-compose
- **CI/CD Pipeline**: GitHub Actions for automated testing and code quality
- **Requirements**: Added requirements.txt for cleaner dependency management
### Bug Fixes
- ✅ Fixed version mismatch in pyproject.toml (3.1.0 → 3.3.0)
- ✅ Fixed 3 failing tests - now 100% pass rate (44/44 tests)
- ✅ Verified .env security (not in git history)
## 📊 Metrics
**Before:** 41/44 tests (93%), unbounded cache, no retry, no monitoring
**After:** 44/44 tests (100%), LRU cache, 3-retry policy, health checks ✅
## 🚀 New Features
### 1. LRU Cache (OrderedDict-based)
- Prevents memory leaks with max_size limit
- Automatic eviction of least recently used entries
- Enhanced stats: size, max_size, evictions, utilization
### 2. API Retry with Exponential Backoff
- Handles transient network failures gracefully
- Only retries on network errors (Timeout, ConnectionError)
- Exponential delays: 2s → 4s → 8s
### 3. Health Check Tool
```json
{
"status": "healthy",
"version": "3.4.0",
"api_key_configured": true,
"cache": { "hit_rate": "85.3%", "utilization": "15.0%" },
"total_api_calls": 1247
}
```
### 4. Docker Support
- Production-ready Dockerfile (python:3.9-slim)
- Docker Compose with volume mounts
- .dockerignore for optimized builds
### 5. CI/CD Pipeline
- Multi-version testing (Python 3.9-3.12)
- Code quality checks (black, isort, flake8, mypy)
- Coverage reporting with Codecov
## 📁 Files Changed
**Modified (6):**
- pyproject.toml - Version update
- tradingview_mcp/api/cache.py - LRU implementation
- tradingview_mcp/api/alpha_vantage.py - Retry decorator
- tradingview_mcp/server.py - Health check tool
- tests/test_indicators.py - Fixed Bollinger Bands test
- tests/test_pine_script.py - Fixed v5 validation test
**Created (6):**
- requirements.txt
- Dockerfile
- docker-compose.yml
- .dockerignore
- .github/workflows/test.yml
- IMPROVEMENTS_v3.4.0.md
## 🎯 Breaking Changes
None! Fully backward compatible.
## 🧪 Test Results
```
============== 44 passed in 2.29s ==============
✅ 100% test pass rate achieved!
```
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 3342e65 commit d0522b9
12 files changed
Lines changed: 661 additions & 23 deletions
File tree
- .github/workflows
- tests
- tradingview_mcp
- api
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
0 commit comments