AI CodeOps

Check whether a pull request or commit may ship

Check whether a pull request or commit may ship. Applies the release gate across every session that touched the change: tests, findings, approvals, and the…

POST /api/release/check

Check whether a pull request or commit may ship

Applies the release gate across every session that touched the change: tests, findings, approvals, and the optional coverage, license and promotion checks.

Authentication: a workspace API key as Authorization: Bearer <key>, or a signed-in console session. A key needs nothing else. With a session, name the workspace: add ?workspaceID=<id> to the URL, or put workspaceID in the JSON body of a POST.

Request body (JSON)

NameTypeDescription
pullRequestURLstringThe pull request to check, as on your Git host.
commitSHAstringOr the commit to check.
requiredWorkflowsstring[]Workflow ids that must have run and completed for a pass.
blockingSeverity"critical" | "high" | "medium" | "low" | "info"Open findings at or above this severity block. Default: "high".
blockOnTestFailurebooleanFailing tests block. So does a session that changed code and has no test result with counts: no test ran, or the test command reported no counts. A project with tests turned off is not asked for one. Default: true.
blockOnBuildFailurebooleanA repository build of the commit or pull request that failed, timed out or was canceled blocks. Default: true.
minCoveragePctnumberCoverage floor: the latest test run that reported coverage must meet it. If no test run reported coverage, the check denies, because the floor can't be checked. Omitted, coverage isn't gated.
disallowedLicensesstring[]License ids that must not appear in the project's latest SBOM (exact, case-insensitive). A project with no SBOM fails the check.
requireDeployedTostringAn environment the change must already have a succeeded deployment in (for example staging).
lookbackMsintegerHow far back to look (14 days by default). Default: 1209600000.
blockOnInFlightbooleanDeny while a considered session is still pending or running. Default: false.

Responses

  • 200: The verdict. allowed is true or false; a denial is still a 200.
  • 400: The payload didn't validate, or the call used a console session and didn't name the workspace (add ?workspaceID=<id>).
  • 401: No key or session, or the key isn't valid.
  • 403: The key belongs to another workspace, or lacks workspace:read. With a session: you aren't a member of the workspace named.
  • 429: Too many checks for this workspace; retryAfterMs says when to try again.

GET /api/release/check

The same check, with query parameters

Accepts the same names as query parameters; lists are comma-separated.

Authentication: a workspace API key as Authorization: Bearer <key>, or a signed-in console session. A key needs nothing else. With a session, name the workspace: add ?workspaceID=<id> to the URL, or put workspaceID in the JSON body of a POST.

Query parameters

NameTypeDescription
pullRequestURLstring
commitSHAstring
requiredWorkflowsstringComma-separated.
disallowedLicensesstringComma-separated.
workspaceIDstringNeeded only when you call with a signed-in console session instead of an API key: the workspace to check in. With a key, leave it out; the workspace comes from the key.

Responses

  • 200: The verdict.
  • 400: The payload didn't validate, or the call used a console session and didn't name the workspace (add ?workspaceID=<id>).

Example

curl -sf -X POST "https://console.aicodeops.dev/api/release/check" \
  -H "Authorization: Bearer $AICODEOPS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"pullRequestURL": "https://github.com/acme/api/pull/42", "minCoveragePct": 80}'

The full spec: /docs/api/openapi.json (OpenAPI 3.1). More in the API guide.