Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
e1d569a
chore: production-ready repository hardening
LastCoderPython Jun 11, 2026
4f64045
chore: remove legacy docs/csvs/ and fetch_cutoffs.py from index
LastCoderPython Jun 11, 2026
5728a6f
chore: Phase 3 & 4 Hardening - API v1, remove ML dependencies, Azure …
LastCoderPython Jun 11, 2026
acad130
Updated README
LastCoderPython Jun 12, 2026
c674e75
chore: repository cleanup — remove dead scripts, consolidate docs, ha…
LastCoderPython Jun 12, 2026
8f83dc1
docs: append Phase 17 changes to CHANGELOG_PRODUCTION.md
LastCoderPython Jun 12, 2026
9a66378
fix: resolve invalid commit hash for actions/setup-python
LastCoderPython Jun 12, 2026
6ee0e40
fix: force postcss version via npm overrides to resolve dependabot vu…
LastCoderPython Jun 12, 2026
44ef3c3
fix: set PYO3_USE_ABI3_FORWARD_COMPATIBILITY to allow building tokeni…
LastCoderPython Jun 12, 2026
125397a
fix: downgrade Python to 3.12 to resolve C-API breakages in tokenizer…
LastCoderPython Jun 12, 2026
5bc0f57
style: resolve all ruff linting violations
LastCoderPython Jun 12, 2026
54859d3
fix: unpin github action hashes and use major tags to prevent resolut…
LastCoderPython Jun 12, 2026
d93f395
security: patch 33 backend dependency vulnerabilities including starl…
LastCoderPython Jun 12, 2026
a640569
update: Architecture and Security Hardening
LastCoderPython Jun 12, 2026
288d848
chore: add vercel.json for production deployments
LastCoderPython Jun 12, 2026
1821005
fix: move vercel.json to frontend directory
LastCoderPython Jun 12, 2026
783030f
Update in RankRoute AI
LastCoderPython Jun 12, 2026
3560547
chore: Apply Phase 14 frontend-backend connection fixes and Caddy por…
LastCoderPython Jun 14, 2026
6a073c7
Final Changes
LastCoderPython Jun 14, 2026
63b8e22
Final Changes
LastCoderPython Jun 14, 2026
1feb513
chore: critical pre-launch infrastructure patches
LastCoderPython Jun 14, 2026
de317de
fix: pin azure/login to v1 to support sdk-auth format
LastCoderPython Jun 14, 2026
8f6913c
Caddy fix
LastCoderPython Jun 14, 2026
1aa1c06
Security Hardening
LastCoderPython Jun 14, 2026
24fc79e
Security Hardening
LastCoderPython Jun 14, 2026
a2e9a68
Security Hardening
LastCoderPython Jun 14, 2026
ff82086
Security Hardening
LastCoderPython Jun 14, 2026
fef76f1
Deployment
LastCoderPython Jun 14, 2026
ac348f5
Dependency changes
LastCoderPython Jun 14, 2026
11af9ed
linting issues
LastCoderPython Jun 14, 2026
258e25e
linting issues
LastCoderPython Jun 14, 2026
323b095
workflow issues
LastCoderPython Jun 14, 2026
10c2a07
Fix Azure login config and add debug step
LastCoderPython Jun 14, 2026
17684a7
Allow migrations to skip existing tables
LastCoderPython Jun 15, 2026
ac80800
Fix Caddy Host header for Azure routing
LastCoderPython Jun 15, 2026
f310d7b
Add Vercel Analytics
LastCoderPython Jun 15, 2026
6a25e02
fix: send credentials in chat stream to fix anonymous gate issue
LastCoderPython Jun 16, 2026
b9c90f6
Fixes
LastCoderPython Jun 16, 2026
fc905f4
Context Fix
LastCoderPython Jun 16, 2026
0e72edb
Worker Container Crash Fix
LastCoderPython Jun 16, 2026
b653545
Celery and FastAPI fix
LastCoderPython Jun 16, 2026
459edcc
Profile Enrichment fix
LastCoderPython Jun 16, 2026
0225b00
Context Fix 2
LastCoderPython Jun 16, 2026
67ea95f
Profile Enrichment Working
LastCoderPython Jun 16, 2026
81bad10
chore(deps-dev): bump tar from 7.5.15 to 7.5.16 in /frontend
dependabot[bot] Jun 18, 2026
15e82ea
Frontend Text Source Link Fix
LastCoderPython Jun 20, 2026
cfb04f9
Fix React hook error boundary issue
LastCoderPython Jun 20, 2026
e1629e0
Ruff fixed
LastCoderPython Jun 20, 2026
0195fa3
fix(celery): Force celery_app initialization on backend startup to fi…
LastCoderPython Jun 20, 2026
621f0cb
fix(celery): Ensure ChromaClient connects before use in upsert backgr…
LastCoderPython Jun 20, 2026
46cc403
chore(deps): bump pydantic-settings from 2.14.1 to 2.14.2 in /backend
dependabot[bot] Jun 20, 2026
c2c66ac
chore(deps): bump langsmith from 0.8.15 to 0.8.18 in /backend
dependabot[bot] Jun 20, 2026
d761a91
Improved system context & added constitutional-ai
LastCoderPython Jun 21, 2026
84d4fa3
Merge pull request #12 from LastCoderPython/dependabot/pip/backend/la…
LastCoderPython Jun 21, 2026
472db2f
Merge pull request #11 from LastCoderPython/dependabot/pip/backend/py…
LastCoderPython Jun 21, 2026
5f0379b
Merge pull request #10 from LastCoderPython/dependabot/npm_and_yarn/f…
LastCoderPython Jun 21, 2026
529936a
chore(deps): bump transformers from 4.57.6 to 5.0.0rc3 in /backend
dependabot[bot] Jun 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
108 changes: 108 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: CI

on:
push:
branches: [main, develop]
paths:
- "backend/**"
- "frontend/**"
- ".github/workflows/ci.yml"
pull_request:
branches: [main]
paths:
- "backend/**"
- "frontend/**"

env:
PYTHON_VERSION: "3.12"
WORKING_DIR: backend

jobs:
frontend-ci:
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: frontend/package-lock.json
- run: npm ci
- run: npm run lint
- run: npm run build

lint-and-test:
runs-on: ubuntu-latest

permissions:
contents: read
id-token: none

defaults:
run:
working-directory: ${{ env.WORKING_DIR }}

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-lock.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install dependencies
env:
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: "1"
run: |
python -m pip install --upgrade pip
pip install -r requirements-lock.txt
pip install pytest pytest-asyncio ruff

- name: Lint with ruff
run: ruff check app/

# Compile check — verify all .py files parse
- name: Compile check
run: |
python -c "
import ast, os, sys
errors = []
for root, dirs, files in os.walk('app'):
for f in files:
if f.endswith('.py'):
path = os.path.join(root, f)
try:
ast.parse(open(path, encoding='utf-8').read())
except SyntaxError as e:
errors.append(f'{path}: {e}')
if errors:
for e in errors:
print(f'FAIL: {e}')
sys.exit(1)
print(f'All Python files compiled OK')
"

# Run unit tests (no server needed)
- name: Run unit tests
run: |
python -m pytest tests/ -v --tb=short --disable-warnings

# Check for common issues
- name: Check env template
run: |
if [ -f .env.example ]; then
echo ".env.example exists — good"
else
echo "WARNING: no .env.example found"
fi
139 changes: 139 additions & 0 deletions .github/workflows/deploy-azure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
name: Deploy to Azure Container Apps

on:
push:
branches: [main, staging]
paths:
- "backend/**"
- "infrastructure/azure/**"
- ".github/workflows/deploy-azure.yml"

env:
AZURE_RESOURCE_GROUP: rankroute-prod
AZURE_CONTAINER_APP: rankroute-api
ACR_NAME: rankrouteacrind
WORKING_DIR: backend

jobs:
test-and-deploy:
runs-on: ubuntu-latest

permissions:
contents: read

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}

- name: Install dependencies
env:
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: "1"
run: |
pip install -r requirements.txt
pip install pytest pytest-asyncio
working-directory: ${{ env.WORKING_DIR }}

- name: Run tests
run: python -m pytest tests/ -v --tb=short --disable-warnings
working-directory: ${{ env.WORKING_DIR }}

- name: Debug Secrets
run: |
if [ -n "${{ secrets.AZURE_CREDENTIALS }}" ]; then
echo "AZURE_CREDENTIALS is set."
else
echo "AZURE_CREDENTIALS is EMPTY! GitHub cannot see the secret."
fi

- name: Azure Login
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Build and push to ACR
run: |
az acr build \
--registry ${{ env.ACR_NAME }} \
--image rankroute-api:${{ github.sha }} \
--image rankroute-api:latest \
.
az acr build \
--registry ${{ env.ACR_NAME }} \
--image rankroute-caddy:${{ github.sha }} \
--image rankroute-caddy:latest \
--file Dockerfile.caddy \
.
working-directory: ${{ env.WORKING_DIR }}

- name: Run database migrations
run: |
sudo apt-get update && sudo apt-get install -y postgresql-client
for f in app/db/migrations/V*__*.sql; do
echo "Applying $f..."
PGPASSWORD=${{ secrets.SUPABASE_DB_PASSWORD }} psql \
"${{ secrets.SUPABASE_DB_URL }}" \
-f "$f"
done
working-directory: ${{ env.WORKING_DIR }}

- name: Deploy API to Container Apps
run: |
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
echo "Deploying to Production (100% Traffic)..."
az containerapp update \
--name ${{ env.AZURE_CONTAINER_APP }} \
--resource-group ${{ env.AZURE_RESOURCE_GROUP }} \
--image ${{ env.ACR_NAME }}.azurecr.io/rankroute-api:${{ github.sha }}
else
echo "Deploying to Staging (0% Public Traffic)..."
az containerapp update \
--name ${{ env.AZURE_CONTAINER_APP }} \
--resource-group ${{ env.AZURE_RESOURCE_GROUP }} \
--image ${{ env.ACR_NAME }}.azurecr.io/rankroute-api:${{ github.sha }} \
--revision-suffix stg-${{ github.sha }}
# Note: For true traffic splitting, the ACA environment must be in multiple revision mode.
fi

- name: Deploy Caddy Gateway
run: |
az containerapp update \
--name rankroute-caddy \
--resource-group ${{ env.AZURE_RESOURCE_GROUP }} \
--image ${{ env.ACR_NAME }}.azurecr.io/rankroute-caddy:${{ github.sha }}

- name: Deploy Worker
if: github.ref == 'refs/heads/main'
run: |
az containerapp update \
--name rankroute-worker \
--resource-group ${{ env.AZURE_RESOURCE_GROUP }} \
--image ${{ env.ACR_NAME }}.azurecr.io/rankroute-api:${{ github.sha }}

- name: Deploy Beat
if: github.ref == 'refs/heads/main'
run: |
az containerapp update \
--name rankroute-beat \
--resource-group ${{ env.AZURE_RESOURCE_GROUP }} \
--image ${{ env.ACR_NAME }}.azurecr.io/rankroute-api:${{ github.sha }}

- name: Verify deployment health
if: github.ref == 'refs/heads/main'
run: |
sleep 30
FQDN=$(az containerapp show \
--name rankroute-caddy \
--resource-group ${{ env.AZURE_RESOURCE_GROUP }} \
--query "properties.configuration.ingress.fqdn" -o tsv)
curl --fail --retry 10 --retry-delay 10 \
"https://$FQDN/api/v1/health"
46 changes: 46 additions & 0 deletions .github/workflows/migration-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Migration Safety Check

on:
pull_request:
paths:
- 'backend/app/db/migrations/**.sql'

jobs:
check-backward-compatibility:
name: Enforce Zero-Downtime Migrations
runs-on: ubuntu-latest
steps:
- name: Checkout PR Code
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Scan for destructive SQL
run: |
echo "Scanning added/modified SQL migration files for destructive operations..."

# Get list of changed SQL files in the migrations directory
CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }} HEAD | grep '^backend/app/db/migrations/.*\.sql$' || true)

if [ -z "$CHANGED_FILES" ]; then
echo "No migrations changed."
exit 0
fi

DESTRUCTIVE_FOUND=false

for file in $CHANGED_FILES; do
echo "Checking $file..."
# Look for DROP or RENAME case-insensitively
if egrep -i 'DROP TABLE|DROP COLUMN|RENAME COLUMN' "$file"; then
echo "::error file=$file::Destructive operation found! You cannot DROP or RENAME columns in a single deployment. See docs/MIGRATION_POLICY.md"
DESTRUCTIVE_FOUND=true
fi
done

if [ "$DESTRUCTIVE_FOUND" = true ]; then
echo "Migration Safety Check FAILED. Destructive operations cause downtime in Azure Container Apps."
exit 1
fi

echo "✅ Migrations look backward-compatible!"
55 changes: 55 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Automated Security Gates

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 2 * * *' # Run nightly at 2 AM UTC

permissions:
contents: read

jobs:
security-scans:
name: Dependency & Secret Scans
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Trufflehog requires deep fetch to scan commit history

# ── Secret Scanning ──────────────────────────────────────────────
- name: TruffleHog Secret Scanner
uses: trufflesecurity/trufflehog@main
with:
path: ./
base: ${{ github.event.repository.default_branch }}
head: HEAD
extra_args: --debug --only-verified
# We allow this to fail without breaking the PR deployment
# so developers can review findings non-blockingly.
continue-on-error: true

# ── Dependency Auditing ──────────────────────────────────────────
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'

- name: Install pip-audit
run: python -m pip install pip-audit

- name: Audit Backend Dependencies (pip-audit)
working-directory: backend
run: |
# We explicitly ignore CVE-2026-45829 (ChromaDB) as our architecture
# uses the embedded client and is immune to the HTTP server RCE.
pip-audit -r requirements-lock.txt --ignore-vuln CVE-2026-45829
# Even with the ignore list, we set this to non-blocking so a
# newly disclosed zero-day doesn't randomly halt production hotfixes.
continue-on-error: true
Loading
Loading