CodeRifts for GitLab — a decision on every merge request
Only a granted change can proceed.
The enforcing boundary is a required external status check on the merge-request head.
The adapter reads that check back and does not apply it.
A live GitLab project is not measured.
What this gate does. Advisory unless the merge request is gated by a protected branch plus a required external status check. GitLab carries no issuer identity on that check.
Add a CodeRifts contract check to your .gitlab-ci.yml and catch breaking API changes before they reach production. Three steps, five minutes.
Setup in 3 Steps
No native app to install. Just add the check to your pipeline.
Get a free API key
Sign up at app.coderifts.com/api/signup to get your API key.
Add CODERIFTS_API_KEY as a CI/CD variable
Go to Settings → CI/CD → Variables in your GitLab project and add the key as a masked variable.
Add the contract check to .gitlab-ci.yml
# .gitlab-ci.yml
# Request only. Branch on execution_action. Verify the receipt before CONTINUE is permission.
# This example no longer teaches POST /api/v1/diff as the gate.
stages:
- test
api-contract-check:
stage: test
image: alpine:latest
before_script:
- apk add --no-cache curl jq git nodejs
script:
- |
git fetch origin "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"
OLD=$(git show "origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME:api/openapi.yaml")
NEW=$(cat api/openapi.yaml)
RESULT=$(jq -n --arg o "$OLD" --arg n "$NEW" \
'{preflight_mode:"authorize",context:{operation:"merge"},artifacts:[{id:"api",type:"openapi",before:$o,after:$n}]}' \
| curl -sf -X POST https://app.coderifts.com/api/v1/preflight \
-H "Authorization: Bearer $CODERIFTS_API_KEY" \
-H "Content-Type: application/json" -d @-)
echo "$RESULT" | jq '{execution_action,decision,chain_receipt}'
ACTION=$(echo "$RESULT" | jq -r '.execution_action // empty')
if [ "$ACTION" != "CONTINUE" ]; then
echo "halt: execution_action=$ACTION"
exit 1
fi
RECEIPT=$(echo "$RESULT" | jq -r '.chain_receipt // empty')
test -n "$RECEIPT"
git clone -q --depth 1 https://github.com/coderifts/receipt-verifier
node receipt-verifier/cli.js "$RECEIPT"
rules:
- if: $CI_MERGE_REQUEST_IID
changes:
- "api/**/*.yaml"
- "api/**/*.json"
The job asks for an authorization and checks the receipt. In GitLab, turn on Settings, Merge requests, Pipelines must succeed, or the job does not block the merge.
What It Does
On every Merge Request, CodeRifts analyzes your OpenAPI specs and reports:
Breaking Changes
The decision names the breaking changes. The branch is execution_action. This page does not publish a count of change types.
Risk Scoring
Returns a 0–100 risk score. The score is a heuristic, not a calibrated probability — read the decision and the named patterns, not the number.
Policy Checks
Checks policy violations from your .coderifts.yml — breaking budgets, freeze windows, no-delete rules.
Security Analysis
Catches auth regressions, sensitive field exposure, and security-critical schema changes.
Deprecated: the CI/CD component
The gitlab.com/coderifts/gitlab-ci-component component is not currently published to the GitLab CI/CD Catalog. Use the API call above (advisory — it trusts the API response and fails the job), or coderifts/contract-gate for a verified, required-check gate. See the REST API documentation for full details.
Start protecting your APIs in GitLab today.
Add the contract check, get your free API key, and catch breaking changes on every Merge Request.