751 lines
23 KiB
JSON
751 lines
23 KiB
JSON
{
|
|
"format": 1,
|
|
"seat": "mesh-delivery-checker",
|
|
"scope": "mesh",
|
|
"grain": "whole",
|
|
"domain": "Delivery",
|
|
"decision": "novox/hq ADR 0547",
|
|
"verbs": [
|
|
{
|
|
"name": "try",
|
|
"description": "Try pushed heads before their pull requests are opened: the checker judges them as it judges a delivery group's pull requests, each member merged onto its trunk, its unit and integration levels through the build modules, then the members' manifests, the module graph and the composition on every placed node, and owes the forge nothing. Name the group's members (each a repository and the exact commit), or one repository and its head for a try of one member. Answers the try's id at once; try-read reads where it stands. The same members at the same commits, in any order, are the answer to a second ask while that try waits or runs; at most 4 run on a build node, and 8 wait for one, mesh-wide.",
|
|
"optional": true,
|
|
"replaces": [
|
|
"sh merge-check.sh",
|
|
"docker run postgres"
|
|
],
|
|
"input": {
|
|
"properties": {
|
|
"head": {
|
|
"description": "the full commit to try, 40 or 64 hex digits, for a try of one member (instead of members)",
|
|
"type": "string"
|
|
},
|
|
"level": {
|
|
"description": "unit or integration: only this level; both when absent",
|
|
"type": "string"
|
|
},
|
|
"repository": {
|
|
"description": "<owner>/<name>, for a try of one member (instead of members)",
|
|
"type": "string"
|
|
},
|
|
"tests": {
|
|
"description": "a go test -run pattern: only those tests run, and nothing is kept",
|
|
"type": "string"
|
|
},
|
|
"trunk": {
|
|
"description": "the trunk commit to merge it onto, or the trunk's branch for its head now; the trunk's head when absent",
|
|
"type": "string"
|
|
},
|
|
"members": {
|
|
"description": "the group: one repository at most once, each at the exact commit asked and the trunk commit it is merged onto; instead of repository and head",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"repository": {
|
|
"description": "<owner>/<name>",
|
|
"type": "string"
|
|
},
|
|
"head": {
|
|
"description": "the full commit to try, 40 or 64 hex digits",
|
|
"type": "string"
|
|
},
|
|
"trunk": {
|
|
"description": "the trunk commit to merge it onto, or the trunk's branch for its head now; the trunk's head when absent",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"repository",
|
|
"head"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"type": "object"
|
|
},
|
|
"answer": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"description": "the try's id"
|
|
},
|
|
"state": {
|
|
"type": "string",
|
|
"description": "its state"
|
|
}
|
|
},
|
|
"required": [
|
|
"id"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "try-read",
|
|
"description": "Where a try stands, as stored: queued, running, or its end (pass, fail, or error when it could not run), with what was said of it, the head and the trunk commit it was merged onto, the time it took and what failed first. Read-only.",
|
|
"optional": true,
|
|
"input": {
|
|
"properties": {
|
|
"id": {
|
|
"description": "the try's id, try-<digits>",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id"
|
|
],
|
|
"type": "object"
|
|
},
|
|
"answer": {
|
|
"type": "object",
|
|
"description": "the try: its state, its steps and its verdict when it has one"
|
|
}
|
|
},
|
|
{
|
|
"name": "try-end",
|
|
"description": "End a try that waits or runs, as error, by hand: say why (kept in what it says). Its place among the tries is free at once and the next try of its head asks anew with a new id. A try that ended already is refused.",
|
|
"optional": true,
|
|
"input": {
|
|
"properties": {
|
|
"id": {
|
|
"description": "the try's id, try-<digits>",
|
|
"type": "string"
|
|
},
|
|
"why": {
|
|
"description": "why it is ended, in words",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"why"
|
|
],
|
|
"type": "object"
|
|
},
|
|
"answer": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"description": "the try"
|
|
},
|
|
"ended": {
|
|
"type": "boolean",
|
|
"description": "it is ended"
|
|
}
|
|
},
|
|
"required": [
|
|
"id",
|
|
"ended"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "input",
|
|
"description": "A checking program's input the checker keeps, by the sha256 of its exact bytes: the facts of a check its verdict is asked of, or the heads its seat list is asked of, as a run ask names it (its input's verb and digest). Answers the digest and the bytes, base64; a digest it keeps no input of is an error. Asked by the build module that runs the program, as its manifest's invokes grants it. Read-only.",
|
|
"optional": true,
|
|
"input": {
|
|
"type": "object",
|
|
"properties": {
|
|
"digest": {
|
|
"type": "string",
|
|
"description": "the input's sha256, 64 lowercase hex digits, as the run ask names it"
|
|
}
|
|
},
|
|
"required": [
|
|
"digest"
|
|
]
|
|
},
|
|
"answer": {
|
|
"type": "object",
|
|
"properties": {
|
|
"digest": {
|
|
"type": "string",
|
|
"description": "the digest asked"
|
|
},
|
|
"input": {
|
|
"type": "string",
|
|
"description": "the input's exact bytes, base64, so no encoding on the way changes a byte the digest covers"
|
|
}
|
|
},
|
|
"required": [
|
|
"digest",
|
|
"input"
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"description": "The merge check's tries: start one, read one, end one. The checker's own events stay under its own subjects (ADR 0620 §2).",
|
|
"holder-events": [
|
|
{
|
|
"name": "verdict",
|
|
"subject": "mesh.stream.<holder>.event.verdict",
|
|
"family": "checker.asks",
|
|
"body": {
|
|
"type": "object",
|
|
"properties": {
|
|
"repository": {
|
|
"type": "string",
|
|
"description": "owner/repo"
|
|
},
|
|
"pull": {
|
|
"type": "integer",
|
|
"description": "the pull request's number, for a pull request's check"
|
|
},
|
|
"head": {
|
|
"type": "string",
|
|
"description": "the commit checked"
|
|
},
|
|
"verdict": {
|
|
"type": "string",
|
|
"description": "pass or fail"
|
|
},
|
|
"out-of-step": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"description": "the generated files out of step with their seat definitions, each path (design 26)"
|
|
},
|
|
"series": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"module": {
|
|
"type": "string",
|
|
"description": "the module whose artifact's series changes"
|
|
},
|
|
"artifact": {
|
|
"type": "string",
|
|
"description": "its artifact, or the package's ecosystem name as the module's packages name it"
|
|
},
|
|
"from": {
|
|
"type": "string",
|
|
"description": "the series on trunk"
|
|
},
|
|
"to": {
|
|
"type": "string",
|
|
"description": "the series the checked head gives it"
|
|
}
|
|
},
|
|
"required": [
|
|
"module",
|
|
"artifact",
|
|
"from",
|
|
"to"
|
|
]
|
|
},
|
|
"description": "each change of an artifact's series the checked head makes against trunk's manifests, once each (design 32); absent when it changes none"
|
|
}
|
|
},
|
|
"required": [
|
|
"repository",
|
|
"head",
|
|
"verdict"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "tag-wanted",
|
|
"subject": "mesh.stream.<holder>.event.tag-wanted",
|
|
"family": "checker.asks",
|
|
"body": {
|
|
"type": "object",
|
|
"properties": {
|
|
"repository": {
|
|
"type": "string",
|
|
"description": "owner/repo"
|
|
},
|
|
"pull": {
|
|
"type": "integer",
|
|
"description": "the pull request"
|
|
},
|
|
"head": {
|
|
"type": "string",
|
|
"description": "its head"
|
|
},
|
|
"branch": {
|
|
"type": "string",
|
|
"description": "the pull request's branch: its tag is removed when the branch ends"
|
|
},
|
|
"module": {
|
|
"type": "string",
|
|
"description": "the group member"
|
|
},
|
|
"package": {
|
|
"type": "string",
|
|
"description": "the package it declares"
|
|
},
|
|
"tag": {
|
|
"type": "string",
|
|
"description": "the tag wanted"
|
|
}
|
|
},
|
|
"required": [
|
|
"repository",
|
|
"head",
|
|
"branch",
|
|
"module",
|
|
"package"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "preview.written",
|
|
"subject": "mesh.stream.<holder>.event.preview.written",
|
|
"family": "checks"
|
|
}
|
|
],
|
|
"states": [
|
|
{
|
|
"name": "verdicts",
|
|
"template": "state",
|
|
"key-forms": [
|
|
{
|
|
"key": "<group>.<heads>",
|
|
"value": {
|
|
"type": "object",
|
|
"properties": {
|
|
"v": {
|
|
"type": "integer",
|
|
"description": "the layout version"
|
|
},
|
|
"group": {
|
|
"type": "string"
|
|
},
|
|
"heads": {
|
|
"type": "string",
|
|
"description": "12 hex digits"
|
|
},
|
|
"trunk": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
},
|
|
"description": "repository to the trunk head merged onto"
|
|
},
|
|
"state": {
|
|
"type": "string",
|
|
"description": "running, pass or fail"
|
|
},
|
|
"failed": {
|
|
"type": "object",
|
|
"properties": {
|
|
"test": {
|
|
"type": "string"
|
|
},
|
|
"machine": {
|
|
"type": "string"
|
|
},
|
|
"words": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"failures": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"test": {
|
|
"type": "string"
|
|
},
|
|
"machine": {
|
|
"type": "string"
|
|
},
|
|
"words": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"levels": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "object",
|
|
"properties": {
|
|
"run": {
|
|
"type": "integer"
|
|
},
|
|
"kept": {
|
|
"type": "integer"
|
|
},
|
|
"skipped": {
|
|
"type": "integer"
|
|
}
|
|
},
|
|
"required": [
|
|
"run",
|
|
"kept"
|
|
]
|
|
},
|
|
"description": "by level, unit or integration"
|
|
},
|
|
"took": {
|
|
"type": "object",
|
|
"properties": {
|
|
"queue": {
|
|
"type": "integer"
|
|
},
|
|
"clone": {
|
|
"type": "integer"
|
|
},
|
|
"unit": {
|
|
"type": "integer"
|
|
},
|
|
"lint": {
|
|
"type": "integer"
|
|
},
|
|
"integration-setup": {
|
|
"type": "integer"
|
|
},
|
|
"integration-run": {
|
|
"type": "integer"
|
|
},
|
|
"composition": {
|
|
"type": "integer"
|
|
}
|
|
},
|
|
"description": "milliseconds"
|
|
},
|
|
"machines": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"sdk": {
|
|
"type": "string"
|
|
},
|
|
"composition": {
|
|
"type": "object",
|
|
"properties": {
|
|
"state": {
|
|
"type": "string",
|
|
"description": "not-run, pass or fail"
|
|
},
|
|
"words": {
|
|
"type": "string"
|
|
},
|
|
"sdk": {
|
|
"type": "string"
|
|
},
|
|
"machines": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"fpset": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"state"
|
|
]
|
|
},
|
|
"over-bound": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"beside": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"carried-from": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"series": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"module": {
|
|
"type": "string"
|
|
},
|
|
"artifact": {
|
|
"type": "string"
|
|
},
|
|
"from": {
|
|
"type": "string"
|
|
},
|
|
"to": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"module",
|
|
"artifact",
|
|
"from",
|
|
"to"
|
|
]
|
|
}
|
|
},
|
|
"judged-by": {
|
|
"type": "object",
|
|
"description": "the checking program that judged the check: where it was built, the key its build is kept under, whether this check's run built it, and the heads it read (ADR 0644, ADR 0656). Absent in a value written before it",
|
|
"properties": {
|
|
"program": {
|
|
"type": "object",
|
|
"properties": {
|
|
"repository": {
|
|
"type": "string"
|
|
},
|
|
"commit": {
|
|
"type": "string"
|
|
},
|
|
"dir": {
|
|
"type": "string"
|
|
},
|
|
"package": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"repository",
|
|
"commit",
|
|
"dir",
|
|
"package"
|
|
]
|
|
},
|
|
"key": {
|
|
"type": "string",
|
|
"description": "program- and 16 hex digits"
|
|
},
|
|
"built": {
|
|
"type": "boolean"
|
|
},
|
|
"heads": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"repository": {
|
|
"type": "string"
|
|
},
|
|
"commit": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"repository",
|
|
"commit"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"program",
|
|
"key",
|
|
"heads"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"group",
|
|
"heads",
|
|
"state"
|
|
],
|
|
"description": "one check of a group at one set of heads"
|
|
},
|
|
"description": "one check of a group; the group is an escaped branch name, heads 12 hex digits"
|
|
}
|
|
],
|
|
"description": "the checker's verdict of each group at each set of heads",
|
|
"history": 5
|
|
},
|
|
{
|
|
"name": "kept",
|
|
"template": "state",
|
|
"key-forms": [
|
|
{
|
|
"key": "<level>.<digest>",
|
|
"value": {
|
|
"type": "object",
|
|
"properties": {
|
|
"v": {
|
|
"type": "integer",
|
|
"description": "the layout version"
|
|
},
|
|
"state": {
|
|
"type": "string",
|
|
"description": "pass: a failure is never kept"
|
|
},
|
|
"repository": {
|
|
"type": "string"
|
|
},
|
|
"package": {
|
|
"type": "string"
|
|
},
|
|
"level": {
|
|
"type": "string"
|
|
},
|
|
"tests": {
|
|
"type": "integer"
|
|
},
|
|
"took": {
|
|
"type": "integer"
|
|
},
|
|
"toolchain": {
|
|
"type": "string"
|
|
},
|
|
"at": {
|
|
"type": "string",
|
|
"description": "when (RFC 3339 time)"
|
|
}
|
|
},
|
|
"required": [
|
|
"state",
|
|
"repository",
|
|
"package",
|
|
"level"
|
|
],
|
|
"description": "one passing level of one package, kept so the next check does not run it again"
|
|
},
|
|
"description": "a passing level of one package by its content digest"
|
|
}
|
|
],
|
|
"description": "the kept passing levels",
|
|
"history": 1
|
|
},
|
|
{
|
|
"name": "owed",
|
|
"template": "state",
|
|
"key-forms": [
|
|
{
|
|
"key": "<repository>.<number>.<head>.<act>",
|
|
"value": {
|
|
"type": "object",
|
|
"properties": {
|
|
"v": {
|
|
"type": "integer",
|
|
"description": "the layout version"
|
|
},
|
|
"act": {
|
|
"type": "string",
|
|
"description": "status=<context>, view, note or comment.<seq>"
|
|
},
|
|
"context": {
|
|
"type": "string"
|
|
},
|
|
"target": {
|
|
"type": "string"
|
|
},
|
|
"state": {
|
|
"type": "string"
|
|
},
|
|
"text": {
|
|
"type": "string"
|
|
},
|
|
"ref": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"act"
|
|
],
|
|
"description": "one act owed to the forge, written by its owner and done by the forge bridge"
|
|
},
|
|
"description": "the status mesh/check the checker owes the forge for a head (its act is status=mesh/check)"
|
|
}
|
|
],
|
|
"description": "the status the checker owes the forge",
|
|
"history": 5
|
|
},
|
|
{
|
|
"name": "previews",
|
|
"template": "state",
|
|
"key-forms": [
|
|
{
|
|
"key": "<repository>.<head>.<trunk>",
|
|
"value": {
|
|
"type": "object",
|
|
"properties": {
|
|
"v": {
|
|
"type": "integer",
|
|
"description": "the layout version"
|
|
},
|
|
"repository": {
|
|
"type": "string"
|
|
},
|
|
"head": {
|
|
"type": "string"
|
|
},
|
|
"trunk": {
|
|
"type": "string"
|
|
},
|
|
"merge": {
|
|
"type": "string",
|
|
"description": "the merge commit"
|
|
},
|
|
"conflicts": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"description": "files in conflict"
|
|
},
|
|
"modules": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "object",
|
|
"properties": {
|
|
"tree": {
|
|
"type": "string"
|
|
},
|
|
"manifest": {
|
|
"type": "string",
|
|
"description": "manifest digest"
|
|
},
|
|
"locks": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"paths": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"packages": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"tree",
|
|
"manifest"
|
|
]
|
|
},
|
|
"description": "by directory"
|
|
}
|
|
},
|
|
"required": [
|
|
"repository",
|
|
"head",
|
|
"trunk"
|
|
],
|
|
"description": "the merge of a head onto a trunk commit, read before a pull request is checked"
|
|
},
|
|
"description": "the merge of a head onto a trunk commit"
|
|
}
|
|
],
|
|
"description": "the previews of a head merged onto a trunk",
|
|
"history": 5
|
|
}
|
|
]
|
|
}
|