Skip to content
Merged
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
39 changes: 39 additions & 0 deletions .github/workflows/quality-gate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,45 @@ jobs:
if-no-files-found: error
retention-days: 3

# Prueba de contrato (QAS-23, SCRUM-1724): Rules contra
# docs/openapi/rules.yaml del Gateway.
# Solo hacia develop: en release y main el contrato de develop puede ir
# delante del código que se promueve, que ya pasó por aquí.
- name: Contrato y verificador (MANI-APIGateway)
if: github.event_name == 'push' || github.base_ref == 'develop'
uses: actions/checkout@v4
with:
repository: Trama-AS/MANI-APIGateway
ref: develop
path: .mani-contrato

- name: Configurar Node.js (verificador de contrato)
if: github.event_name == 'push' || github.base_ref == 'develop'
uses: actions/setup-node@v4
with:
node-version: '22'

# El secreto de prueba se genera en cada corrida: firma los JWT de las sondas.
- name: Preparar el verificador de contrato
if: github.event_name == 'push' || github.base_ref == 'develop'
run: |
npm ci --prefix .mani-contrato --ignore-scripts
echo "SUPABASE_JWT_SECRET=$(openssl rand -hex 32)" >> "$GITHUB_ENV"

- name: Contrato de Rules
if: github.event_name == 'push' || github.base_ref == 'develop'
run: |
esperar() {
curl -sf --retry 60 --retry-delay 1 --retry-all-errors "$1" > /dev/null
}
java -jar target/mani-rules-java-*.jar > rules.log 2>&1 &
esperar http://localhost:8080/api/v1/rules/health
node .mani-contrato/scripts/verificar_contrato.js --contrato rules --url http://localhost:8080/api/v1/rules

- name: Logs de los servicios (si algo falló)
if: failure()
run: tail -n 50 rules.log || true

sonar_quality_gate:
name: Sonar Quality Gate
needs: pruebas_cobertura
Expand Down
Loading