Skip to content

Commit c19e9ba

Browse files
authored
Merge pull request #1 from DimaJoyti:dev
Merge dev to main - Complete Monitoring System Implementation
2 parents 1046758 + b229640 commit c19e9ba

File tree

411 files changed

+23315
-12343
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

411 files changed

+23315
-12343
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,28 @@ jobs:
3636
3737
- name: Check code formatting with Black
3838
run: |
39-
black --check --diff app/ src/ || true
39+
black --check --diff app/ src/ examples/ scripts/ tests/ || echo "Black formatting issues found"
40+
continue-on-error: true
4041

4142
- name: Lint with Ruff
4243
run: |
43-
ruff check app/ src/ || true
44+
ruff check app/ src/ examples/ scripts/ tests/ --output-format=github || echo "Ruff linting issues found"
45+
continue-on-error: true
4446

4547
- name: Check import sorting with isort
4648
run: |
47-
isort --check-only --diff app/ src/ || true
49+
isort --check-only --diff app/ src/ examples/ scripts/ tests/ || echo "Import sorting issues found"
50+
continue-on-error: true
4851

4952
- name: Type checking with MyPy
5053
run: |
51-
mypy app/ src/ || true
54+
mypy app/ src/ --ignore-missing-imports || echo "Type checking issues found"
55+
continue-on-error: true
56+
57+
- name: Check for security issues with Semgrep
58+
run: |
59+
pip install semgrep
60+
semgrep --config=auto app/ src/ || echo "Security scan completed with findings"
5261
continue-on-error: true
5362

5463
# Job 2: Security Scan
@@ -76,7 +85,7 @@ jobs:
7685
continue-on-error: true
7786

7887
- name: Upload Bandit report
79-
uses: actions/upload-artifact@v3
88+
uses: actions/upload-artifact@v4
8089
if: always()
8190
with:
8291
name: bandit-report
@@ -167,7 +176,7 @@ jobs:
167176
continue-on-error: true
168177

169178
- name: Upload build artifacts
170-
uses: actions/upload-artifact@v3
179+
uses: actions/upload-artifact@v4
171180
if: success()
172181
with:
173182
name: dist-packages

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
python -m build
3939
4040
- name: Upload build artifacts
41-
uses: actions/upload-artifact@v3
41+
uses: actions/upload-artifact@v4
4242
with:
4343
name: dist-packages
4444
path: dist/

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
continue-on-error: true
3535

3636
- name: Upload documentation artifacts
37-
uses: actions/upload-artifact@v3
37+
uses: actions/upload-artifact@v4
3838
if: success()
3939
with:
4040
name: documentation
Lines changed: 247 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,247 @@
1+
name: Enhanced Testing
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
# Job 1: Unit Tests with Coverage
11+
unit-tests:
12+
name: Unit Tests with Coverage
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
python-version: ["3.9", "3.10", "3.11", "3.12"]
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
28+
- name: Cache pip dependencies
29+
uses: actions/cache@v3
30+
with:
31+
path: ~/.cache/pip
32+
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements*.txt') }}
33+
restore-keys: |
34+
${{ runner.os }}-pip-${{ matrix.python-version }}-
35+
36+
- name: Install uv
37+
run: |
38+
curl -LsSf https://astral.sh/uv/install.sh | sh
39+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
40+
41+
- name: Install dependencies with uv
42+
run: |
43+
uv pip install --system pytest pytest-cov pytest-xdist pytest-mock
44+
uv pip install --system pydantic fastapi uvicorn
45+
uv pip install --system rich typer structlog
46+
uv pip install --system python-dotenv aiofiles httpx
47+
uv pip install --system "passlib[bcrypt]" "python-jose[cryptography]"
48+
49+
- name: Create test environment
50+
run: |
51+
echo "ANTHROPIC_API_KEY=test_key" > .env
52+
echo "OPENAI_API_KEY=test_key" >> .env
53+
echo "BRIGHT_DATA_API_KEY=test_key" >> .env
54+
echo "ENVIRONMENT=test" >> .env
55+
echo "REDIS_URL=redis://localhost:6379/0" >> .env
56+
57+
- name: Start Redis for testing
58+
run: |
59+
sudo apt-get update
60+
sudo apt-get install -y redis-server
61+
sudo systemctl start redis-server
62+
63+
- name: Run simple tests first
64+
run: |
65+
python tests/test_simple.py
66+
env:
67+
PYTHONPATH: ${{ github.workspace }}
68+
continue-on-error: false
69+
70+
- name: Run unit tests with coverage
71+
run: |
72+
python -m pytest tests/test_minimal.py tests/test_simple.py -v --cov=app --cov-report=xml --cov-report=html --cov-report=term-missing --tb=short
73+
env:
74+
PYTHONPATH: ${{ github.workspace }}
75+
continue-on-error: true
76+
77+
- name: Upload coverage reports
78+
uses: actions/upload-artifact@v4
79+
if: always()
80+
with:
81+
name: coverage-reports-${{ matrix.python-version }}
82+
path: |
83+
coverage.xml
84+
htmlcov/
85+
86+
# Job 2: Integration Tests
87+
integration-tests:
88+
name: Integration Tests
89+
runs-on: ubuntu-latest
90+
needs: unit-tests
91+
92+
services:
93+
redis:
94+
image: redis:7-alpine
95+
ports:
96+
- 6379:6379
97+
options: >-
98+
--health-cmd "redis-cli ping"
99+
--health-interval 10s
100+
--health-timeout 5s
101+
--health-retries 5
102+
103+
mongodb:
104+
image: mongo:6
105+
ports:
106+
- 27017:27017
107+
env:
108+
MONGO_INITDB_ROOT_USERNAME: test
109+
MONGO_INITDB_ROOT_PASSWORD: test
110+
111+
steps:
112+
- name: Checkout code
113+
uses: actions/checkout@v4
114+
115+
- name: Set up Python 3.11
116+
uses: actions/setup-python@v4
117+
with:
118+
python-version: "3.11"
119+
120+
- name: Install uv
121+
run: |
122+
curl -LsSf https://astral.sh/uv/install.sh | sh
123+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
124+
125+
- name: Install dependencies with uv
126+
run: |
127+
uv pip install --system pytest pytest-cov
128+
uv pip install --system pydantic fastapi uvicorn
129+
uv pip install --system rich typer structlog
130+
uv pip install --system python-dotenv aiofiles httpx
131+
132+
- name: Create integration test environment
133+
run: |
134+
echo "ANTHROPIC_API_KEY=test_key" > .env
135+
echo "OPENAI_API_KEY=test_key" >> .env
136+
echo "BRIGHT_DATA_API_KEY=test_key" >> .env
137+
echo "ENVIRONMENT=test" >> .env
138+
echo "REDIS_URL=redis://localhost:6379/0" >> .env
139+
echo "MONGODB_URL=mongodb://test:test@localhost:27017/test" >> .env
140+
141+
- name: Run integration tests
142+
run: |
143+
python -m pytest tests/test_simple.py -v --tb=short
144+
env:
145+
PYTHONPATH: ${{ github.workspace }}
146+
continue-on-error: true
147+
148+
# Job 3: Performance Tests
149+
performance-tests:
150+
name: Performance Tests
151+
runs-on: ubuntu-latest
152+
needs: unit-tests
153+
154+
steps:
155+
- name: Checkout code
156+
uses: actions/checkout@v4
157+
158+
- name: Set up Python 3.11
159+
uses: actions/setup-python@v4
160+
with:
161+
python-version: "3.11"
162+
163+
- name: Install uv
164+
run: |
165+
curl -LsSf https://astral.sh/uv/install.sh | sh
166+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
167+
168+
- name: Install dependencies with uv
169+
run: |
170+
uv pip install --system pytest pytest-benchmark
171+
uv pip install --system pydantic fastapi
172+
173+
- name: Run performance tests
174+
run: |
175+
python tests/test_simple.py
176+
env:
177+
PYTHONPATH: ${{ github.workspace }}
178+
continue-on-error: true
179+
180+
- name: Upload benchmark results
181+
uses: actions/upload-artifact@v4
182+
if: always()
183+
with:
184+
name: benchmark-results
185+
path: benchmark-results.json
186+
187+
# Job 4: End-to-End Tests
188+
e2e-tests:
189+
name: End-to-End Tests
190+
runs-on: ubuntu-latest
191+
needs: [unit-tests, integration-tests]
192+
193+
steps:
194+
- name: Checkout code
195+
uses: actions/checkout@v4
196+
197+
- name: Set up Python 3.11
198+
uses: actions/setup-python@v4
199+
with:
200+
python-version: "3.11"
201+
202+
- name: Install uv
203+
run: |
204+
curl -LsSf https://astral.sh/uv/install.sh | sh
205+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
206+
207+
- name: Install dependencies with uv
208+
run: |
209+
uv pip install --system pytest pydantic
210+
211+
- name: Run E2E tests
212+
run: |
213+
python tests/test_simple.py
214+
env:
215+
PYTHONPATH: ${{ github.workspace }}
216+
ANTHROPIC_API_KEY: test_key
217+
BRIGHT_DATA_API_KEY: test_key
218+
continue-on-error: true
219+
220+
# Job 5: Test Summary
221+
test-summary:
222+
name: Test Summary
223+
runs-on: ubuntu-latest
224+
needs: [unit-tests, integration-tests, performance-tests, e2e-tests]
225+
if: always()
226+
227+
steps:
228+
- name: Download all artifacts
229+
uses: actions/download-artifact@v4
230+
231+
- name: Generate test summary
232+
run: |
233+
echo "# Test Summary" > test-summary.md
234+
echo "" >> test-summary.md
235+
echo "## Test Results" >> test-summary.md
236+
echo "- Unit Tests: ${{ needs.unit-tests.result }}" >> test-summary.md
237+
echo "- Integration Tests: ${{ needs.integration-tests.result }}" >> test-summary.md
238+
echo "- Performance Tests: ${{ needs.performance-tests.result }}" >> test-summary.md
239+
echo "- E2E Tests: ${{ needs.e2e-tests.result }}" >> test-summary.md
240+
echo "" >> test-summary.md
241+
echo "Generated at: $(date)" >> test-summary.md
242+
243+
- name: Upload test summary
244+
uses: actions/upload-artifact@v4
245+
with:
246+
name: test-summary
247+
path: test-summary.md

.github/workflows/security.yml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,39 @@ jobs:
3030
3131
- name: Run Safety check
3232
run: |
33-
safety check || echo "Safety check completed with issues"
33+
safety check --json --output safety-report.json || echo "Safety check completed with issues"
3434
continue-on-error: true
3535

3636
- name: Run Bandit security scan
3737
run: |
38-
bandit -r app/ src/ || echo "Bandit scan completed with issues"
38+
bandit -r app/ src/ examples/ scripts/ -f json -o bandit-report.json || echo "Bandit scan completed with issues"
3939
continue-on-error: true
4040

41+
- name: Upload Safety report
42+
uses: actions/upload-artifact@v4
43+
if: always()
44+
with:
45+
name: safety-report
46+
path: safety-report.json
47+
48+
- name: Upload Bandit report
49+
uses: actions/upload-artifact@v4
50+
if: always()
51+
with:
52+
name: bandit-security-report
53+
path: bandit-report.json
54+
55+
- name: Run Semgrep security scan
56+
run: |
57+
pip install semgrep
58+
semgrep --config=auto --json --output=semgrep-report.json app/ src/ || echo "Semgrep scan completed with findings"
59+
continue-on-error: true
60+
61+
- name: Upload Semgrep report
62+
uses: actions/upload-artifact@v4
63+
if: always()
64+
with:
65+
name: semgrep-report
66+
path: semgrep-report.json
67+
4168

agent-ui/.github/workflows/validate.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

agent-ui/.vscode/settings.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)