|
| 1 | +{ |
| 2 | + "$schema": "https://json-schema.org/draft/2020-12/schema", |
| 3 | + "$id": "https://comparevi.dev/schemas/github-intake-metadata-apply-report-v1.schema.json", |
| 4 | + "title": "GitHub Intake Metadata Apply Report v1", |
| 5 | + "type": "object", |
| 6 | + "additionalProperties": false, |
| 7 | + "required": [ |
| 8 | + "schema", |
| 9 | + "schemaVersion", |
| 10 | + "generatedAt", |
| 11 | + "dryRun", |
| 12 | + "target", |
| 13 | + "requested", |
| 14 | + "resolved", |
| 15 | + "observed", |
| 16 | + "operations", |
| 17 | + "verification", |
| 18 | + "summary", |
| 19 | + "execution" |
| 20 | + ], |
| 21 | + "properties": { |
| 22 | + "schema": { |
| 23 | + "const": "github-intake/metadata-apply-report@v1" |
| 24 | + }, |
| 25 | + "schemaVersion": { |
| 26 | + "type": "string" |
| 27 | + }, |
| 28 | + "generatedAt": { |
| 29 | + "type": "string", |
| 30 | + "format": "date-time" |
| 31 | + }, |
| 32 | + "dryRun": { |
| 33 | + "type": "boolean" |
| 34 | + }, |
| 35 | + "target": { |
| 36 | + "type": "object", |
| 37 | + "additionalProperties": false, |
| 38 | + "required": ["url", "number", "title", "contentType", "repository", "id"], |
| 39 | + "properties": { |
| 40 | + "url": { "type": "string", "format": "uri" }, |
| 41 | + "number": { "type": "integer", "minimum": 1 }, |
| 42 | + "title": { "type": ["string", "null"] }, |
| 43 | + "contentType": { "enum": ["Issue", "PullRequest"] }, |
| 44 | + "repository": { "type": "string", "pattern": "^[^/]+/[^/]+$" }, |
| 45 | + "id": { "type": "string" } |
| 46 | + } |
| 47 | + }, |
| 48 | + "requested": { "$ref": "#/$defs/surfaceGroup" }, |
| 49 | + "resolved": { "$ref": "#/$defs/surfaceGroup" }, |
| 50 | + "observed": { |
| 51 | + "type": "object", |
| 52 | + "additionalProperties": false, |
| 53 | + "required": ["before", "projectedAfter", "after"], |
| 54 | + "properties": { |
| 55 | + "before": { "$ref": "#/$defs/observedSnapshot" }, |
| 56 | + "projectedAfter": { "$ref": "#/$defs/observedSnapshot" }, |
| 57 | + "after": { |
| 58 | + "anyOf": [ |
| 59 | + { "$ref": "#/$defs/observedSnapshot" }, |
| 60 | + { "type": "null" } |
| 61 | + ] |
| 62 | + } |
| 63 | + } |
| 64 | + }, |
| 65 | + "operations": { |
| 66 | + "type": "array", |
| 67 | + "items": { "$ref": "#/$defs/operation" } |
| 68 | + }, |
| 69 | + "verification": { |
| 70 | + "type": "object", |
| 71 | + "additionalProperties": false, |
| 72 | + "required": ["ok", "attempts", "delayMs", "maxAttempts", "fields", "skipped"], |
| 73 | + "properties": { |
| 74 | + "ok": { "type": "boolean" }, |
| 75 | + "attempts": { "type": "integer", "minimum": 0 }, |
| 76 | + "delayMs": { "type": "integer", "minimum": 0 }, |
| 77 | + "maxAttempts": { "type": "integer", "minimum": 0 }, |
| 78 | + "skipped": { "type": "boolean" }, |
| 79 | + "fields": { |
| 80 | + "type": "array", |
| 81 | + "items": { |
| 82 | + "type": "object", |
| 83 | + "additionalProperties": false, |
| 84 | + "required": ["surface", "ok", "expected", "actual"], |
| 85 | + "properties": { |
| 86 | + "surface": { "$ref": "#/$defs/surfaceName" }, |
| 87 | + "ok": { "type": "boolean" }, |
| 88 | + "expected": {}, |
| 89 | + "actual": {} |
| 90 | + } |
| 91 | + } |
| 92 | + } |
| 93 | + } |
| 94 | + }, |
| 95 | + "summary": { |
| 96 | + "type": "object", |
| 97 | + "additionalProperties": false, |
| 98 | + "required": [ |
| 99 | + "requestedCount", |
| 100 | + "appliedCount", |
| 101 | + "plannedCount", |
| 102 | + "unchangedCount", |
| 103 | + "unsupportedCount", |
| 104 | + "failedCount", |
| 105 | + "skippedCount" |
| 106 | + ], |
| 107 | + "properties": { |
| 108 | + "requestedCount": { "type": "integer", "minimum": 0 }, |
| 109 | + "appliedCount": { "type": "integer", "minimum": 0 }, |
| 110 | + "plannedCount": { "type": "integer", "minimum": 0 }, |
| 111 | + "unchangedCount": { "type": "integer", "minimum": 0 }, |
| 112 | + "unsupportedCount": { "type": "integer", "minimum": 0 }, |
| 113 | + "failedCount": { "type": "integer", "minimum": 0 }, |
| 114 | + "skippedCount": { "type": "integer", "minimum": 0 } |
| 115 | + } |
| 116 | + }, |
| 117 | + "execution": { |
| 118 | + "type": "object", |
| 119 | + "additionalProperties": false, |
| 120 | + "required": ["status", "errors"], |
| 121 | + "properties": { |
| 122 | + "status": { |
| 123 | + "enum": ["planned", "pass", "fail", "error"] |
| 124 | + }, |
| 125 | + "errors": { |
| 126 | + "type": "array", |
| 127 | + "items": { "type": "string" } |
| 128 | + } |
| 129 | + } |
| 130 | + } |
| 131 | + }, |
| 132 | + "$defs": { |
| 133 | + "surfaceName": { |
| 134 | + "enum": ["issueType", "milestone", "assignees", "reviewers", "parentIssue", "subIssues"] |
| 135 | + }, |
| 136 | + "surfaceState": { |
| 137 | + "type": "object", |
| 138 | + "additionalProperties": false, |
| 139 | + "required": ["active", "clear", "value"], |
| 140 | + "properties": { |
| 141 | + "active": { "type": "boolean" }, |
| 142 | + "clear": { "type": "boolean" }, |
| 143 | + "value": {} |
| 144 | + } |
| 145 | + }, |
| 146 | + "surfaceGroup": { |
| 147 | + "type": "object", |
| 148 | + "additionalProperties": false, |
| 149 | + "required": ["issueType", "milestone", "assignees", "reviewers", "parentIssue", "subIssues"], |
| 150 | + "properties": { |
| 151 | + "issueType": { "$ref": "#/$defs/surfaceState" }, |
| 152 | + "milestone": { "$ref": "#/$defs/surfaceState" }, |
| 153 | + "assignees": { "$ref": "#/$defs/surfaceState" }, |
| 154 | + "reviewers": { "$ref": "#/$defs/surfaceState" }, |
| 155 | + "parentIssue": { "$ref": "#/$defs/surfaceState" }, |
| 156 | + "subIssues": { "$ref": "#/$defs/surfaceState" } |
| 157 | + } |
| 158 | + }, |
| 159 | + "observedSnapshot": { |
| 160 | + "type": "object", |
| 161 | + "additionalProperties": false, |
| 162 | + "required": [ |
| 163 | + "id", |
| 164 | + "url", |
| 165 | + "number", |
| 166 | + "title", |
| 167 | + "contentType", |
| 168 | + "repository", |
| 169 | + "assignees", |
| 170 | + "reviewers", |
| 171 | + "milestone", |
| 172 | + "issueType", |
| 173 | + "parentIssue", |
| 174 | + "subIssues" |
| 175 | + ], |
| 176 | + "properties": { |
| 177 | + "id": { "type": "string" }, |
| 178 | + "url": { "type": "string", "format": "uri" }, |
| 179 | + "number": { "type": "integer", "minimum": 1 }, |
| 180 | + "title": { "type": ["string", "null"] }, |
| 181 | + "contentType": { "enum": ["Issue", "PullRequest"] }, |
| 182 | + "repository": { "type": "string", "pattern": "^[^/]+/[^/]+$" }, |
| 183 | + "assignees": { |
| 184 | + "type": "array", |
| 185 | + "items": { "type": "string" } |
| 186 | + }, |
| 187 | + "reviewers": { |
| 188 | + "type": "array", |
| 189 | + "items": { "type": "string" } |
| 190 | + }, |
| 191 | + "milestone": { |
| 192 | + "type": ["object", "null"], |
| 193 | + "additionalProperties": true |
| 194 | + }, |
| 195 | + "issueType": { |
| 196 | + "type": ["object", "null"], |
| 197 | + "additionalProperties": true |
| 198 | + }, |
| 199 | + "parentIssue": { |
| 200 | + "type": ["object", "null"], |
| 201 | + "additionalProperties": true |
| 202 | + }, |
| 203 | + "subIssues": { |
| 204 | + "type": "array", |
| 205 | + "items": { |
| 206 | + "type": ["object", "null"], |
| 207 | + "additionalProperties": true |
| 208 | + } |
| 209 | + } |
| 210 | + } |
| 211 | + }, |
| 212 | + "mutationAction": { |
| 213 | + "type": "object", |
| 214 | + "additionalProperties": false, |
| 215 | + "required": ["kind", "status", "summary", "details", "error"], |
| 216 | + "properties": { |
| 217 | + "kind": { |
| 218 | + "enum": [ |
| 219 | + "update-issue", |
| 220 | + "update-pull-request", |
| 221 | + "replace-assignees", |
| 222 | + "add-reviewers", |
| 223 | + "remove-reviewers", |
| 224 | + "add-sub-issue", |
| 225 | + "remove-sub-issue" |
| 226 | + ] |
| 227 | + }, |
| 228 | + "status": { |
| 229 | + "enum": ["planned", "applied", "failed", "skipped"] |
| 230 | + }, |
| 231 | + "summary": { "type": "string" }, |
| 232 | + "details": { |
| 233 | + "type": "object", |
| 234 | + "additionalProperties": true |
| 235 | + }, |
| 236 | + "error": { "type": ["string", "null"] } |
| 237 | + } |
| 238 | + }, |
| 239 | + "operation": { |
| 240 | + "type": "object", |
| 241 | + "additionalProperties": false, |
| 242 | + "required": ["surface", "status", "applicable", "requested", "reason", "before", "desired", "after", "actions"], |
| 243 | + "properties": { |
| 244 | + "surface": { "$ref": "#/$defs/surfaceName" }, |
| 245 | + "status": { |
| 246 | + "enum": ["not-requested", "planned", "unchanged", "applied", "skipped", "unsupported", "failed"] |
| 247 | + }, |
| 248 | + "applicable": { "type": "boolean" }, |
| 249 | + "requested": { "type": "boolean" }, |
| 250 | + "reason": { "type": ["string", "null"] }, |
| 251 | + "before": {}, |
| 252 | + "desired": {}, |
| 253 | + "after": {}, |
| 254 | + "actions": { |
| 255 | + "type": "array", |
| 256 | + "items": { "$ref": "#/$defs/mutationAction" } |
| 257 | + } |
| 258 | + } |
| 259 | + } |
| 260 | + } |
| 261 | +} |
0 commit comments