Guardrails
Preview

Ask whether a snapshot could go to a deployment

Runs the check a real promotion runs, with the facts the caller chose to change (a different time, requester or snapshot), and stores nothing. The answer is what the Evaluator draws: the verdict, every rule that applies with the facts it read, what would unblock it and who can, what the requester ma

POST
/policy-evaluations
cookiebetter-auth.session_token<token>

Better Auth session cookie. Production uses the __Secure- prefixed name.

application/json
  1. body
deploymentId*string
Formatuuid
snapshotId?string

The snapshot asked about; the best candidate when omitted (the newest the stage before qualified, or the deployment's newest for a deploy that comes from no earlier stage).

Formatuuid
action?string
Value in"promote""promote_ad_hoc""rollback""hotfix""bypass"
requester?

Who would act; the caller when omitted.

at?string

When it would happen; now when omitted.

Formatdate-time
hypothetical?

Facts to replace the real ones, by fact name. A value is text, a whole number, true or false, or a list of text.

Response Body

The answer.

application/json
  1. response
verdict*
rules*integer

Requirements that apply.

sources*integer

Rules they come from.

stages*integer
guardrails*integer
rows*array<>
ways*array<>
actor*array<>
skipped*array<>
missing*array<string>

Facts that could not be had; the verdict is wait while any a rule reads is missing.

missingText?string

What could not be known, in words. Approvals are left out, since none recorded reads as none given.

snapshot?

A snapshot that could be promoted to the deployment.

candidates*array<>

The snapshots that could be picked instead, best first. The best is judged when none is asked about.

evaluatedAt*string
Formatdate-time
Example Request
curl -X POST 'https://wardn.example.com/api/v1/policy-evaluations' \  -H 'Content-Type: application/json' \  -d '{  "deploymentId": "a73c85a1-d857-491e-a6b2-51dce05de7a2"}'
Example Response
{  "verdict": {    "state": "allowed",    "headline": "string",    "detail": "string"  },  "rules": 0,  "sources": 0,  "stages": 0,  "guardrails": 0,  "rows": [    {      "group": "string",      "label": "string",      "setBy": "string",      "source": "stage",      "ruleId": "string",      "status": "Met",      "verdict": "met",      "reason": "string",      "detail": "string",      "reads": [        {          "name": "string",          "value": "string",          "reason": "string"        }      ]    }  ],  "ways": [    {      "blockedBy": "string",      "way": "string",      "who": "string",      "action": "string",      "thisActor": true    }  ],  "actor": [    {      "action": "string",      "why": "string",      "allowed": true,      "outcome": "string"    }  ],  "skipped": [    {      "name": "string",      "why": "string",      "badge": "string"    }  ],  "missing": [    "string"  ],  "missingText": "string",  "snapshot": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "commit": "string",    "branch": "string",    "fromStage": "string",    "qualified": true,    "createdAt": "2019-08-24T14:15:22Z"  },  "candidates": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "commit": "string",      "branch": "string",      "fromStage": "string",      "qualified": true,      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "evaluatedAt": "2019-08-24T14:15:22Z"}