637 lines
18 KiB
JSON
637 lines
18 KiB
JSON
{
|
|
"format": 1,
|
|
"seat": "mesh-delivery-checker",
|
|
"scope": "mesh",
|
|
"grain": "whole",
|
|
"domain": "Delivery",
|
|
"decision": "novox/hq ADR 0547",
|
|
"verbs": [
|
|
{
|
|
"name": "try",
|
|
"description": "Try a pushed head before its pull request is opened: the checker judges it as it judges a pull request's head, merged onto its trunk's head, its unit and integration levels through the build modules, and owes the forge nothing. Answers the try's id at once; try-read reads where it stands. A try of the same head that waits or runs is the answer to a second ask; at most 4 wait or run at once, 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",
|
|
"type": "string"
|
|
},
|
|
"level": {
|
|
"description": "unit or integration: only this level; both when absent",
|
|
"type": "string"
|
|
},
|
|
"repository": {
|
|
"description": "<owner>/<name>",
|
|
"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"
|
|
}
|
|
},
|
|
"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"
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"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"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"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
|
|
}
|
|
]
|
|
}
|