feat(ci): add workflow_dispatch to force backward-compat execution
- workflow_dispatch input: force_backward_compat (boolean, default false) - Path detection now diffs against origin/main (catches multi-commit pushes) - Set force_backward_compat=true in workflow_dispatch to force the full M-AI-01 compatibility test regardless of changed paths Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
7d4a774d4f
commit
e6456ac9a8
@ -3,6 +3,12 @@ name: Deploy API Server
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
force_backward_compat:
|
||||||
|
description: 'Force M-AI-01 backward compatibility test'
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
|
||||||
env:
|
env:
|
||||||
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
||||||
@ -114,14 +120,22 @@ jobs:
|
|||||||
id: paths
|
id: paths
|
||||||
run: |
|
run: |
|
||||||
cd $WORKDIR
|
cd $WORKDIR
|
||||||
CHANGED=$(git diff --name-only HEAD~1..HEAD 2>/dev/null || git diff --name-only HEAD~1 2>/dev/null || echo "")
|
FORCE="${{ inputs.force_backward_compat || 'false' }}"
|
||||||
|
if [ "$FORCE" = "true" ]; then
|
||||||
|
echo "[backward-compat] Forced by workflow_dispatch input"
|
||||||
|
echo "run_compat=true" > /tmp/compat-decision
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
# Diff against origin/main to catch all changes in this push
|
||||||
|
git fetch origin main 2>/dev/null || true
|
||||||
|
CHANGED=$(git diff --name-only origin/main...HEAD 2>/dev/null || git diff --name-only HEAD~1..HEAD 2>/dev/null || echo "")
|
||||||
echo "Changed files: $CHANGED"
|
echo "Changed files: $CHANGED"
|
||||||
if echo "$CHANGED" | grep -qE "prisma/schema.prisma|prisma/migrations/|src/modules/ai-analysis/|src/workers/ai-analysis.worker.ts|src/infrastructure/queue/|src/infrastructure/outbox/|src/modules/ai-runtime/ai-job"; then
|
if echo "$CHANGED" | grep -qE "prisma/schema.prisma|prisma/migrations/|src/modules/ai-analysis/|src/workers/ai-analysis.worker.ts|src/infrastructure/queue/|src/infrastructure/outbox/|src/modules/ai-runtime/ai-job"; then
|
||||||
echo "DB-related changes detected — running backward compatibility"
|
echo "DB-related changes detected — running backward compatibility"
|
||||||
echo "run_compat=true" >> /tmp/compat-decision
|
echo "run_compat=true" > /tmp/compat-decision
|
||||||
else
|
else
|
||||||
echo "No DB-related changes — skipping backward compatibility"
|
echo "No DB-related changes — skipping backward compatibility"
|
||||||
echo "run_compat=false" >> /tmp/compat-decision
|
echo "run_compat=false" > /tmp/compat-decision
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Ensure infrastructure
|
- name: Ensure infrastructure
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user