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
60 changes: 60 additions & 0 deletions .github/workflows/production_smoke.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Production Smoke (Manual)

on:
workflow_dispatch:

jobs:
smoke:
runs-on: ubuntu-latest
timeout-minutes: 25
environment: production
steps:
- name: Checkout
uses: actions/checkout@v4


- name: Prepare env for Compose (Linux runner)
run: |
echo "USERPROFILE=/home/runner" >> $GITHUB_ENV
echo "EXTERNAL_PROJECTS_PATH=${GITHUB_WORKSPACE}/.." >> $GITHUB_ENV
echo "QDRANT_HOST=qdrant" >> $GITHUB_ENV
echo "QDRANT_PORT=6333" >> $GITHUB_ENV
echo "REDIS_URL=redis://redis:6379/0" >> $GITHUB_ENV
echo "MCP_ENABLED=true" >> $GITHUB_ENV
echo "LOG_LEVEL=INFO" >> $GITHUB_ENV
echo "FAST_STARTUP=true" >> $GITHUB_ENV


- name: Build context-server image (dev Dockerfile)
run: |
docker build -f deployment/docker/Dockerfile.dev -t context-server:ci .

- name: Start minimal stack (qdrant, redis, context-server)
run: |
docker compose -f deployment/docker/docker-compose.yml up -d qdrant redis
sleep 15
docker compose -f deployment/docker/docker-compose.yml up -d --no-build context-server
sleep 10

- name: Wait for context-server
run: |
for i in $(seq 1 30); do
code=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8000/ || true)
if [ "$code" = "405" ] || [ "$code" = "200" ]; then
echo "Server reachable"; break; fi
echo "Waiting for server... ($i)"; sleep 5;
done

- name: Smoke JSON-RPC initialize
run: |
curl -sS -X POST http://localhost:8000/ \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","method":"initialize","id":1,"params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"gha-prod","version":"1.0"}}}' | tee /tmp/init.json
grep -q '"jsonrpc"' /tmp/init.json

- name: Teardown
if: always()
run: |
docker compose -f deployment/docker/docker-compose.yml down -v --remove-orphans

28 changes: 28 additions & 0 deletions .github/workflows/security_scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Security Scan

on:
pull_request:
push:
branches: [ main ]

jobs:
scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install scanners
run: |
python -m pip install --upgrade pip
pip install bandit safety semgrep
- name: Bandit (Python security linter)
run: bandit -q -r src || true
- name: Safety (dependency vulnerabilities)
run: |
pip install -r requirements/base.txt || true
safety check --full-report || true
- name: Semgrep (code scanning)
run: semgrep --config p/ci --error --timeout 120 || true

70 changes: 70 additions & 0 deletions .github/workflows/staging_compose_smoke.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Staging Compose Smoke Test

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

concurrency:
group: staging-compose-smoke-${{ github.ref }}
cancel-in-progress: true

jobs:
smoke:
runs-on: ubuntu-latest
timeout-minutes: 25

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Prepare env for Compose (Linux runner)
run: |
echo "USERPROFILE=/home/runner" >> $GITHUB_ENV
echo "EXTERNAL_PROJECTS_PATH=${GITHUB_WORKSPACE}/.." >> $GITHUB_ENV
echo "QDRANT_HOST=qdrant" >> $GITHUB_ENV
echo "QDRANT_PORT=6333" >> $GITHUB_ENV
echo "REDIS_URL=redis://redis:6379/0" >> $GITHUB_ENV
echo "MCP_ENABLED=true" >> $GITHUB_ENV
echo "LOG_LEVEL=INFO" >> $GITHUB_ENV
echo "FAST_STARTUP=true" >> $GITHUB_ENV


- name: Build context-server image (dev Dockerfile)
run: |
docker build -f deployment/docker/Dockerfile.dev -t context-server:ci .

- name: Start minimal stack (qdrant, redis, context-server)
run: |
docker compose -f deployment/docker/docker-compose.yml up -d qdrant redis
# Give DBs time to get healthy
sleep 15
docker compose -f deployment/docker/docker-compose.yml up -d --no-build context-server

- name: Wait for context-server health endpoint
run: |
for i in $(seq 1 30); do
code=$(curl -s -o /dev/null -w "%{http_code}" -H 'Accept: application/json, text/event-stream' http://localhost:8000/ || true)
if [ "$code" = "405" ] || [ "$code" = "200" ]; then
echo "Server reachable"; break; fi
echo "Waiting for server... ($i)"; sleep 5;
done
curl -sSf -H 'Accept: application/json, text/event-stream' http://localhost:8000/ >/dev/null || (docker compose -f deployment/docker/docker-compose.yml logs context-server && exit 1)

- name: Smoke JSON-RPC initialize
run: |
curl -sS -X POST http://localhost:8000/ \
-H 'Accept: application/json, text/event-stream' \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","method":"initialize","id":1,"params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"gha-smoke","version":"1.0"}}}' | tee /tmp/init.json
grep -q '"jsonrpc"' /tmp/init.json

- name: Teardown
if: always()
run: |
docker compose -f deployment/docker/docker-compose.yml down -v --remove-orphans

81 changes: 81 additions & 0 deletions .github/workflows/staging_flags_rollout.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Staging Feature Flags Rollout Smoke

on:
workflow_dispatch:
push:
branches: [ main ]

jobs:
rollout:
runs-on: ubuntu-latest
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
flag:
- ENABLE_DEPLOYMENT_INTEGRATIONS
- ENABLE_CONVERSATION_TRACKING
- ENABLE_PERFORMANCE_PROFILING
- ENABLE_SECURITY_SCANNING
- ENABLE_REALTIME_MONITORING
- ENABLE_CODE_GENERATION
- ENABLE_PREDICTIVE_CACHING
- ENABLE_CACHE_WARMING
steps:
- name: Checkout
uses: actions/checkout@v4


- name: Prepare env for Compose (Linux runner)
run: |
echo "USERPROFILE=/home/runner" >> $GITHUB_ENV
echo "EXTERNAL_PROJECTS_PATH=${GITHUB_WORKSPACE}/.." >> $GITHUB_ENV
echo "QDRANT_HOST=qdrant" >> $GITHUB_ENV
echo "QDRANT_PORT=6333" >> $GITHUB_ENV
echo "REDIS_URL=redis://redis:6379/0" >> $GITHUB_ENV
echo "MCP_ENABLED=true" >> $GITHUB_ENV
echo "LOG_LEVEL=INFO" >> $GITHUB_ENV
echo "FAST_STARTUP=true" >> $GITHUB_ENV


- name: Build context-server image (dev)
run: |
docker build -f deployment/docker/Dockerfile.dev -t context-server:ci .

- name: Start dependencies
run: |
docker compose -f deployment/docker/docker-compose.yml up -d qdrant redis
sleep 15

- name: Start context-server with one flag enabled
env:
${{ matrix.flag }}: "true"
QDRANT_HOST: localhost
REDIS_HOST: localhost
PYTHONUNBUFFERED: "1"
run: |
docker compose -f deployment/docker/docker-compose.yml up -d --no-build context-server
sleep 10

- name: Check health
run: |
for i in $(seq 1 30); do
code=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8000/ || true)
if [ "$code" = "405" ] || [ "$code" = "200" ]; then
echo "Server reachable"; break; fi
echo "Waiting for server... ($i)"; sleep 5;
done

- name: Smoke JSON-RPC initialize
run: |
curl -sS -X POST http://localhost:8000/ \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","method":"initialize","id":1,"params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"gha-flags","version":"1.0"}}}' | tee /tmp/init.json
grep -q '"jsonrpc"' /tmp/init.json

- name: Teardown
if: always()
run: |
docker compose -f deployment/docker/docker-compose.yml down -v --remove-orphans

14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1102,6 +1102,20 @@ def register_my_tools(mcp: FastMCP):
- **[Architecture Documentation](docs/architecture-Context-2025-10-31.md)** - System architecture
- **[Technical Specifications](docs/tech-spec-Context-2025-10-31.md)** - Technical details


### Feature Guides
- [Phase 1 Features and Usage](docs/features/phase1.md)
- [Phase 2 Features and Usage](docs/features/phase2.md)
- [Phase 3 Features and Usage](docs/features/phase3.md)

### Performance Docs
- [Phase 1 Performance Benchmarks](docs/performance/phase1.md)

### CI Workflows (Smoke/Flags)
- Staging Compose Smoke: .github/workflows/staging_compose_smoke.yml (runs on push/PR)
- Feature Flags Rollout Smoke: .github/workflows/staging_flags_rollout.yml (workflow_dispatch)
- Production Smoke: .github/workflows/production_smoke.yml (workflow_dispatch, protected env)

### Troubleshooting Guides
- **[PostgreSQL Analysis](POSTGRESQL_ANALYSIS_AND_RECOMMENDATION.md)** - PostgreSQL setup and analysis
- **[MCP Startup Optimization](MCP_STARTUP_OPTIMIZATION_SUMMARY.md)** - Startup performance guide
Expand Down
Loading
Loading