ariadne/contracts/iop-execution/v1/request.schema.json
2026-07-24 05:45:04 +09:00

212 lines
4.2 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://git.toki-labs.com/toki/ariadne/contracts/iop-execution/v1/request.schema.json",
"title": "Ariadne IOP execution request",
"type": "object",
"additionalProperties": false,
"required": [
"schema_version",
"execution_id",
"organization_id",
"project_id",
"ingestion_source_id",
"error_group_id",
"intent",
"mode",
"error_event",
"repository",
"runtime_targets",
"policy",
"deadline"
],
"properties": {
"schema_version": {
"const": "ariadne.iop-execution-request.v1"
},
"execution_id": {
"type": "string",
"format": "uuid"
},
"organization_id": {
"type": "string",
"format": "uuid"
},
"project_id": {
"type": "string",
"format": "uuid"
},
"ingestion_source_id": {
"type": "string",
"format": "uuid"
},
"error_group_id": {
"type": "string",
"format": "uuid"
},
"intent": {
"type": "string",
"enum": [
"analyze",
"apply_change"
]
},
"mode": {
"type": "string",
"enum": [
"report_before_change",
"auto_change_then_report"
]
},
"proposal_digest": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"error_event": {
"$ref": "../../error-event/v1/schema.json"
},
"repository": {
"$ref": "#/$defs/repository"
},
"runtime_targets": {
"type": "array",
"maxItems": 32,
"items": {
"$ref": "#/$defs/runtime_target"
}
},
"policy": {
"$ref": "#/$defs/policy"
},
"deadline": {
"type": "string",
"format": "date-time"
}
},
"$defs": {
"repository": {
"type": "object",
"additionalProperties": false,
"required": [
"repository_id",
"workspace_reference",
"base_revision"
],
"properties": {
"repository_id": {
"type": "string",
"format": "uuid"
},
"workspace_reference": {
"type": "string",
"minLength": 1,
"maxLength": 1000
},
"base_revision": {
"type": "string",
"minLength": 1,
"maxLength": 200
}
}
},
"runtime_target": {
"type": "object",
"additionalProperties": false,
"required": [
"environment_id",
"connection_reference"
],
"properties": {
"environment_id": {
"type": "string",
"format": "uuid"
},
"connection_reference": {
"type": "string",
"minLength": 1,
"maxLength": 1000
}
}
},
"policy": {
"type": "object",
"additionalProperties": false,
"required": [
"repository_access",
"runtime_access",
"allow_merge"
],
"properties": {
"repository_access": {
"type": "string",
"enum": [
"read_only",
"isolated_branch"
]
},
"runtime_access": {
"const": "read_only"
},
"allow_merge": {
"const": false
}
}
}
},
"allOf": [
{
"if": {
"properties": {
"intent": {
"const": "analyze"
}
},
"required": [
"intent"
]
},
"then": {
"not": {
"required": [
"proposal_digest"
]
},
"properties": {
"policy": {
"properties": {
"repository_access": {
"const": "read_only"
}
}
}
}
}
},
{
"if": {
"properties": {
"intent": {
"const": "apply_change"
}
},
"required": [
"intent"
]
},
"then": {
"required": [
"proposal_digest"
],
"properties": {
"policy": {
"properties": {
"repository_access": {
"const": "isolated_branch"
}
}
}
}
}
}
]
}