Checks
GET /v1/projects/{projectId}/integrity runs the integrity check.
GET /v1/projects/{projectId}/integrity runs the same check as the app’s Log panel, over every reference in the project’s models, metamodels and views. Each finding has a severity:
error: a problem in the model itself, such as an element whose package was deleted.warning: a problem in how it’s shown or kept, such as a shape on a diagram whose element is gone.
ok is true when there are no errors; warnings don’t count. checked says how many of each kind of thing were looked at. It’s a heavy call: an organisation may make a few a minute, one at a time (Rate limits).
A step that fails the build when the model has errors (GitHub Actions, with the key in a repository secret):
- name: Farkitect model integrity env: FARKITECT_API_KEY: ${{ secrets.FARKITECT_API_KEY }} run: | report=$(curl -sf https://api.farkitect.com/v1/projects/PROJECT_ID/integrity \ -H "Authorization: Bearer $FARKITECT_API_KEY") echo "$report" | jq -r '.violations[] | "\(.severity): \(.message) (\(.name // .location // .documentId))"' echo "$report" | jq -e '.ok' > /dev/null