Skip to Content
FeaturesQuality Gate API

Quality Gate API

The quality gate endpoint evaluates whether a PR review passes your configured thresholds. Use it in CI/CD pipelines to automatically block risky merges.

Endpoint

GET /api/reviews/{review_id}/gate

Query Parameters

ParameterTypeDefaultDescription
thresholdintegerOrg settingOverride risk score threshold (0-100)

Response

{ "gate": "passed", "review_id": 42, "risk_score": 35, "threshold": 75, "critical_issues": 0, "high_issues": 2, "total_issues": 8, "vibe_coding_score": 15, "message": "Quality gate passed — safe to merge" }

Gate Logic

The gate passes when:

  • Risk score is below the configured threshold
  • Critical issue count is within the allowed limit

The gate fails when:

  • Risk score exceeds the threshold, OR
  • Critical issues exceed the maximum allowed

Configuration

Thresholds are configurable at three levels (highest priority wins):

  1. Query parameter — override for a specific check
  2. Repository policy — set in Settings → Policies → Repository Overrides
  3. Organization policy — set in Settings → Policies

CI/CD Usage

CLI:

codestax gate <review_id> --threshold 75

Exit code 0 = passed, 1 = failed, 2 = pending.

GitHub Actions / GitLab CI: See the CI/CD Integration guide for complete pipeline templates.