Files
mesh-delivery/contracts/ts/seats/nodebuildnode/src/parts/build-step.ts
T

429 lines
14 KiB
TypeScript

// Code generated by seatgen from the seat definitions; DO NOT EDIT.
// The part "build-step" several seats include whole: What the three build seats share: the verbs that read and steer a node's builds, and the layouts of the asks they accept and the steps they keep. A seat lists its states against these (a part carries no states).
export const verbs = {
current: "current",
pause: "pause",
resume: "resume",
drop: "drop",
} as const;
/** one artifact of a build ask: built from the fetched tree, or copied from an upstream pin */
export interface AskArtifact {
"artifact": string;
"from"?: string;
"seat"?: string;
"version"?: string;
}
export interface BuildAnswer {
"artifacts": BuiltArtifact[];
"imports"?: string[];
"out-of-step"?: string[];
"toolchain"?: ToolchainUsed;
}
/** one artifact a build made: its digest and the reference it was published under */
export interface BuiltArtifact {
"artifact": string;
"digest": string;
"reference"?: string;
}
/** how many steps the node runs at once */
export interface Capacity {
/** when (RFC 3339 time) */
"at"?: string;
"build-hours"?: string;
"build-hours-fault"?: string;
"by-cpu"?: number;
"configured": number;
"configured-from"?: string;
"cores-per-step"?: number;
"effective": number;
"ineligible"?: string;
"outside-hours"?: boolean;
"quota-cores"?: number;
"quota-from"?: string;
/** the layout version */
"v"?: number;
"why": string;
}
export interface CheckAnswer {
"fetch": FetchAnswer;
"levels"?: LevelAnswer[];
}
export interface ComposeAnswer {
"built": boolean;
"key"?: string;
/** the compose-candidate verdict */
"verdict"?: unknown;
}
/** an ask a caller no longer waits for */
export interface Drop {
/** when (RFC 3339 time) */
"at"?: string;
"by"?: string;
/** the layout version */
"v"?: number;
"why": string;
}
export interface FetchBesideItem {
"commit": string;
"repository": string;
}
/** the TypeScript module's group package: the group's tagged version of the SDK ({name, version}), placed from the registry in each member whatever its lock names, or the group's package member ({repository, commit, ref}), packed by the fetch and served to the members in place of the registry's */
export interface FetchPackage {
"commit"?: string;
"name"?: string;
"ref"?: string;
"repository"?: string;
"version"?: string;
}
/** what a build module's fetch tool is asked: the repository and the full commit, the pull request's ref when only its head carries the commit, the trunk commit to merge onto for a merge preview, the module's directory and named paths, the mesh packages to build against, and the sibling repositories placed beside */
export interface Fetch {
/** the trunk commit a merge preview merges onto */
"base"?: string;
/** the sibling repositories placed beside the fetched tree */
"beside"?: FetchBesideItem[];
/** the full commit */
"commit": string;
/** the module's directory in the repository ("." for its root), with paths */
"dir"?: string;
/** the TypeScript module's group package: the group's tagged version of the SDK ({name, version}), placed from the registry in each member whatever its lock names, or the group's package member ({repository, commit, ref}), packed by the fetch and served to the members in place of the registry's */
"package"?: FetchPackage;
/** the version (a full commit) of each mesh package to build against, by its module path */
"packages"?: Record<string, string>;
/** the paths the module names, relative to dir */
"paths"?: string[];
/** the pull request's ref, when only its head carries the commit */
"ref"?: string;
/** <owner>/<name> */
"repository": string;
}
/** what a build module's fetch tool answers, whole: the workspace it made, the commit in it, the module directories found; and, when the call gave a base, the merge preview (the trunk commit, the merge commit, the files that conflict, the paths the merge changes, the compiled programs among them, the tree of each module directory). A head that does not merge cleanly is an answer, not an error: merge is empty and conflicts names the files. The Go module adds the sibling repositories placed and the package versions taken; the TypeScript module the directories installed and refused and the group's package */
export interface FetchAnswer {
"base"?: string;
"beside"?: PlacedBeside[];
"changed"?: string[];
"commit": string;
"conflicts"?: string[];
"group"?: string;
"installed"?: string[];
"merge"?: string;
"modules": string[];
"packages"?: TakenVersion[];
"programs"?: Program[];
"refused"?: FetchRefusal[];
"trees"?: Record<string, ModuleTree>;
"workspace": string;
}
/** a TypeScript module whose packages the fetch did not install, with why */
export interface FetchRefusal {
"module": string;
"reason": string;
}
export interface LevelAnswerDigestNeedsItem {
"needs"?: string[];
"package"?: string;
}
export interface LevelAnswerDigestPackagesItem {
"digest": string;
"package": string;
}
export interface LevelAnswerDigest {
"beside"?: string[];
"judged_by"?: string;
"level"?: string;
"needs"?: LevelAnswerDigestNeedsItem[];
"packages"?: LevelAnswerDigestPackagesItem[];
"without_tests"?: string[];
}
export interface LevelAnswerKeptItem {
"digest"?: string;
"package"?: string;
"tests"?: number;
}
export interface LevelAnswerUnmetItem {
"needs"?: string[];
"package"?: string;
}
/** one level of a check ask: the digest's answer, the kept verdicts taken, one test result per test step run, and the packages the node could not test */
export interface LevelAnswer {
"digest"?: LevelAnswerDigest;
"judged"?: string;
"kept"?: LevelAnswerKeptItem[];
"level": string;
"tests"?: unknown[];
"unmet"?: LevelAnswerUnmetItem[];
}
/** the tree of one module directory in a merge preview: its git tree, the digest of its manifest, the lock files' digests and the digests of the named paths */
export interface ModuleTree {
"locks"?: Record<string, string>;
"manifest": string;
/** no longer filled (ADR 0593 section 2); kept so a preview written before still reads */
"packages"?: string[];
"paths"?: Record<string, string>;
"tree": string;
}
/** whether the node takes no new ask */
export interface Pause {
/** when (RFC 3339 time) */
"at"?: string;
"by"?: string;
"paused": boolean;
/** the layout version */
"v"?: number;
}
/** a sibling repository placed as a plain directory under the workspace's beside directory */
export interface PlacedBeside {
"commit": string;
"dir": string;
"repository": string;
}
/** a changed file that is a compiled program (issue 1577): its path, its executable format, and the commit of the branch that added it when the merge's tree no longer holds it */
export interface Program {
"commit"?: string;
/** ELF, Mach-O or PE */
"kind": string;
"path": string;
}
/** what a run ask's step answers: whether this run built the program or took the one kept under its key, the key, the program's exit, the last line of its standard output and the first of its standard error */
export interface RunAnswer {
"built": boolean;
"exit": number;
"key": string;
/** raw when it is JSON, else a JSON string */
"output"?: unknown;
"said"?: string;
}
/** one commit a run's program reads */
export interface RunHead {
"commit": string;
"repository": string;
}
/** a run's input by reference: the seat verb the asker serves it on (seat:<seat>.<verb>), the sha256 of its bytes and its size, at most 256 KiB */
export interface RunInput {
/** 64 lowercase hex digits */
"digest": string;
/** bytes */
"size": number;
"verb": string;
}
/** a run ask's job: where its program is built, the heads it reads (each laid read-only at its repository's path), its input by reference, its arguments and what it is for */
export interface RunJob {
/** the program's arguments, each a word or a flag */
"args"?: string[];
/** the commits the program reads, a repository at most once */
"heads": RunHead[];
"input": RunInput;
"program": RunProgram;
/** what the run is for, for a reader of the ask */
"reader"?: string;
}
/** where a run's program is built: the repository and full commit fetched, the Go module's directory in it and the program's import path */
export interface RunProgram {
"commit": string;
"dir": string;
"package": string;
"repository": string;
}
/** one step a build module runs on a node */
export interface Step {
/** when the bus gives the ask again, for the state again (RFC 3339 time) */
"again-at"?: string;
/** when (RFC 3339 time) */
"ended"?: string;
"id": string;
"node": string;
"owner"?: string;
/** true when the step ended on a fault that passes (a transport fault), so a failed end after the last run says so */
"passing"?: boolean;
"phase"?: string;
/** when (RFC 3339 time) */
"phase-at"?: string;
"reason"?: string;
"result"?: StepResult;
/** which run of the ask this is, counted by the bus's delivery count (1 for the first) */
"run"?: number;
/** when (RFC 3339 time) */
"started": string;
/** running, again (ended on a transport fault, to be given again by the bus after again-at), passed, failed, refused or dropped (ended by the verb drop, its cause the reason) */
"state": string;
"tool": string;
/** the layout version */
"v"?: number;
"what"?: string;
}
export interface StepAskBuild {
"artifacts": AskArtifact[];
"fetch"?: Fetch;
"fp"?: string;
"module": string;
"path"?: string;
"publish"?: boolean;
"toolchain"?: ToolchainUsed;
}
export interface StepAskCheck {
"fetch": Fetch;
"kept"?: boolean;
"levels": string[];
/** the node names the check's tests run against */
"node-names"?: string[];
"packages"?: string[];
"run"?: string;
"runner"?: string;
"runner_when"?: string;
/** the toolchain the checker agreed for the language (ADR 0584 clause 2): a node on another declines the check */
"toolchain"?: ToolchainUsed;
}
export interface StepAskCompose {
"dir": string;
"fetch": Fetch;
"package": string;
"reader"?: string;
/** the compose-candidate request, in one of two forms: the request as a JSON object, or, for one near the bus's message limit, a JSON string "gzip+base64:" followed by the base64 of the request object gzip-compressed; a holder that does not know the packed form refuses it, naming that it holds no request object */
"request": unknown;
}
/** one ask of a build module */
export interface StepAsk {
"asker": string;
/** when (RFC 3339 time) */
"at"?: string;
"build"?: StepAskBuild;
"check"?: StepAskCheck;
"compose"?: StepAskCompose;
"id": string;
/** build, check or compose */
"kind": string;
/** go, typescript or image */
"language": string;
"needs"?: string[];
/** package to the tagged version a build pins */
"packages"?: Record<string, string>;
/** a run: a program built from a change and run in the build seat's sandbox over the heads, its input asked of a verb of the asker's seat; the Go seat's check stream alone carries it, as a compose */
"run"?: RunJob;
/** the layout version */
"v"?: number;
}
/** what a step answered, by the kind of ask: a build's artifacts, toolchain, imports and out-of-step modules; a check's fetch and levels; a compose's built, key and verdict; a run's built, key, exit, output and said; a declined ask's declined, needs and lacks. The fields of the kinds do not meet, so one layout holds the five */
export interface StepResult {
"artifacts"?: BuiltArtifact[];
"built"?: boolean;
/** the holder declined the ask: its node lacks what the ask needs */
"declined"?: boolean;
/** a run's program's exit status */
"exit"?: number;
"fetch"?: FetchAnswer;
"imports"?: string[];
"key"?: string;
/** what the holder's node lacks of it */
"lacks"?: string[];
"levels"?: LevelAnswer[];
/** what the declined ask needs */
"needs"?: string[];
"out-of-step"?: string[];
/** a run's program's last line of standard output: raw when it is JSON, else a JSON string */
"output"?: unknown;
/** a run's program's first line of standard error, or why the step could not run it */
"said"?: string;
"toolchain"?: ToolchainUsed;
/** the compose-candidate verdict (the composer's own layout) */
"verdict"?: unknown;
}
/** of a directory whose go.mod requires an asked mesh package, the version it is built against: the asked one, or go.mod's when it names a newer one, said */
export interface TakenVersion {
"asked": string;
"built": string;
"dir": string;
"named": string;
"package": string;
"said"?: string;
"sum"?: string;
}
/** the toolchain a node reports */
export interface Toolchain {
/** when (RFC 3339 time) */
"at"?: string;
/** go or typescript */
"language": string;
"recipe": string;
/** the layout version */
"v"?: number;
"version": string;
}
/** the toolchain a build was made with: the language, the installed version and the build module's recipe */
export interface ToolchainUsed {
"language": string;
"recipe": string;
"version": string;
}
/** is what current takes. */
export interface CurrentInput {
}
/** is what current answers. */
export type CurrentAnswer = Record<string, unknown>;
/** is what pause takes. */
export interface PauseInput {
}
/** is what pause answers. */
export type PauseAnswer = Record<string, unknown>;
/** is what resume takes. */
export interface ResumeInput {
}
/** is what resume answers. */
export type ResumeAnswer = Record<string, unknown>;
/** is what drop takes. */
export interface DropInput {
/** who drops it */
"by"?: string;
/** the ask's id */
"id": string;
/** why the caller no longer waits */
"why": string;
}
/** is what drop answers. */
export type DropAnswer = Record<string, unknown>;