Skip to content

feat(auth): ignore type checking for is_pro in token verification #87

feat(auth): ignore type checking for is_pro in token verification

feat(auth): ignore type checking for is_pro in token verification #87

Workflow file for this run

name: CI
on:
pull_request:
paths-ignore:
- '**/*.md'
- 'docs/**'
push:
paths-ignore:
- '**/*.md'
- 'docs/**'
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Node dependencies
run: npm ci
- name: Create virtualenv
run: python -m venv .venv
- name: Install backend dependencies
run: |
source .venv/bin/activate
npm run api:install
- name: Install backend test dependencies
run: |
source .venv/bin/activate
.venv/bin/python -m pip install -r api/requirements-dev.txt
- name: Lint
run: npm run lint
- name: Install ripgrep
run: sudo apt-get update && sudo apt-get install -y ripgrep
- name: Backend Log Hygiene Guards
run: |
rc=0
rg -n --glob '*.py' --glob '!api/tests/**' '\bprint\s*\(' api || rc=$?
if [ "$rc" -eq 0 ]; then
echo "Backend print() usage is not allowed."
exit 1
elif [ "$rc" -gt 1 ]; then
echo "rg failed during print() policy check (exit code: $rc)."
exit "$rc"
fi
rc=0
rg -n --pcre2 --glob '*.py' --glob '!api/tests/**' 'logger\.(?:debug|info|warning|error|critical|exception)\([^\n]*\buser_id\s*=' api || rc=$?
if [ "$rc" -eq 0 ]; then
echo "Raw user_id structured logger fields are not allowed. Use user_id_hash."
exit 1
elif [ "$rc" -gt 1 ]; then
echo "rg failed during single-line logger user_id policy check (exit code: $rc)."
exit "$rc"
fi
rc=0
rg -n -U --pcre2 --glob '*.py' --glob '!api/tests/**' 'logger\.(?:debug|info|warning|error|critical|exception)\((?:[^)]*\n)*[^)]*\buser_id\s*=' api || rc=$?
if [ "$rc" -eq 0 ]; then
echo "Raw user_id structured logger fields are not allowed. Use user_id_hash."
exit 1
elif [ "$rc" -gt 1 ]; then
echo "rg failed during multi-line logger user_id policy check (exit code: $rc)."
exit "$rc"
fi
- name: Backend tests
run: |
source .venv/bin/activate
npm run api:test
- name: Frontend tests
run: npm run test -- --run
- name: Install Playwright browsers
run: npx playwright install --with-deps
- name: Smoke tests
run: npm run test:smoke