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)
| Name | Type | Description |
|---|---|---|
pullRequestURL | string | The pull request to check, as on your Git host. |
commitSHA | string | Or the commit to check. |
requiredWorkflows | string[] | 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". |
blockOnTestFailure | boolean | Failing 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. |
blockOnBuildFailure | boolean | A repository build of the commit or pull request that failed, timed out or was canceled blocks. Default: true. |
minCoveragePct | number | Coverage 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. |
disallowedLicenses | string[] | License ids that must not appear in the project's latest SBOM (exact, case-insensitive). A project with no SBOM fails the check. |
requireDeployedTo | string | An environment the change must already have a succeeded deployment in (for example staging). |
lookbackMs | integer | How far back to look (14 days by default). Default: 1209600000. |
blockOnInFlight | boolean | Deny 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
| Name | Type | Description |
|---|---|---|
pullRequestURL | string | |
commitSHA | string | |
requiredWorkflows | string | Comma-separated. |
disallowedLicenses | string | Comma-separated. |
workspaceID | string | Needed 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.