{ "format_version": 1, "id": "code_runner", "list_route": "/code/runners", "scope": "personal", "setup": true, "name": "Runner", "plural": "Runners", "picture": null, "builtin": true, "engine": "code", "columns": [ { "key": "name", "name": "Name", "type": "text", "required": true }, { "key": "line", "name": "Labels and last word", "type": "text", "readonly": true }, { "key": "quiet", "name": "Quiet", "type": "text", "readonly": true }, { "key": "health", "name": "Health", "type": "choice", "choices": [ "working", "quiet" ], "readonly": true }, { "key": "labels", "name": "Labels", "type": "text", "readonly": true }, { "key": "last_seen_at", "name": "Last asked for work", "type": "date", "readonly": true }, { "key": "created_at", "name": "Registered", "type": "date", "readonly": true }, { "key": "version", "name": "Version", "type": "text", "readonly": true } ], "title": "name", "date": null, "project": null, "order": null, "slip": { "title": "name", "subtitle": "line", "trailing": null, "photo": null, "toggle": null, "caption": { "columns": [ "quiet" ] } }, "group": { "column": "health", "sections": [ { "heading": null, "values": [ "working" ] }, { "heading": "Not heard from in a week", "values": [ "quiet" ] } ] }, "tile": { "face": "slip-list" }, "page": [ { "heading": null, "columns": [ "name", "line", "quiet", "labels", "last_seen_at", "created_at", "version" ] } ], "empty": { "title": "No runners registered yet.", "message": "Make one with New runner token above, and register it with that." }, "instructions": "The runners that take the CI jobs your repositories ask for, most recently heard from first. A runner not heard from in a week is quiet; removing one stops it being handed jobs and revokes its registration token. A runner is a machine that takes the CI jobs your repositories ask for, and it registers against the Mac serving you with a token made by New runner token on this list. The token is shown once and revoked on first use; an unused one lasts 24 hours. Cotton never puts it on a row and cannot show it again.", "delete": false, "add": false, "readonly_when": "created_at", "create": { "label": "New runner token", "path": "/code/runners/token" }, "parts": { "shape": "sheet", "head": { "facts": [ "created_at" ] }, "links": [], "lists": [], "acts": { "main": "mint_token", "more": [], "away": "remove" }, "cards": [ { "column": "labels" }, { "column": "last_seen_at" }, { "column": "version" } ] }, "commands": [ { "id": "mint_token", "label": "Make token", "object": "link", "kind": "create", "method": "code.mintRunnerToken", "form": true, "bindings": { "name": "name" }, "receipt": "Token made", "reveals": { "answer": "secret", "title": "Your runner token", "note": "Copy it now. Cotton shows it only once. It expires after 24 hours or its first use." } }, { "id": "remove", "object": "bin", "label": "Remove", "kind": "delete", "method": "code.revokeRunner", "bindings": { "uuid": "$id" }, "destructive": true, "confirm": "It stops being handed jobs and its registration token stops working. Registering it again is a new token.", "receipt": "Removed the runner {name}", "does": "destroys" }, { "id": "remove_quiet", "label": "Remove the {count} quiet runners", "kind": "delete", "method": "code.removeQuietRunners", "list": { "at_least": 2 }, "when": { "health": "quiet" }, "bindings": { "expectedCount": "$count" }, "destructive": true, "confirm": "Remove {count} runners not heard from in over a week? Each stops being handed jobs and its registration token stops working. A machine that is still in use registers again with a new token.", "receipt": "Removed {count} quiet runners", "does": "destroys", "object": "bin" } ], "tables": [ { "name": "cotton_machine_runners", "columns": [ { "name": "id", "type": "TEXT", "default": null, "nullable": true, "primary_key": true, "declaration": "\n id TEXT PRIMARY KEY", "position": 0 }, { "name": "workspace_id", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n workspace_id TEXT NOT NULL", "position": 1 }, { "name": "device_id", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n device_id TEXT NOT NULL CHECK (length(trim(device_id)) > 0)", "position": 2 }, { "name": "enabled", "type": "INTEGER", "default": "1", "nullable": false, "primary_key": false, "declaration": "\n enabled INTEGER NOT NULL DEFAULT 1 CHECK (enabled IN (0, 1))", "position": 3 }, { "name": "labels_json", "type": "TEXT", "default": "'[\"cotton-checks-mac:host\"]'", "nullable": false, "primary_key": false, "declaration": "\n labels_json TEXT NOT NULL DEFAULT '[\"cotton-checks-mac:host\"]'", "position": 4 }, { "name": "capacity", "type": "INTEGER", "default": "1", "nullable": false, "primary_key": false, "declaration": "\n capacity INTEGER NOT NULL DEFAULT 1 CHECK (capacity BETWEEN 1 AND 4)", "position": 5 }, { "name": "created_at", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n created_at TEXT NOT NULL", "position": 6 }, { "name": "updated_at", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n updated_at TEXT NOT NULL", "position": 7 }, { "name": "_hlc", "type": "TEXT", "default": "''", "nullable": false, "primary_key": false, "declaration": "\n _hlc TEXT NOT NULL DEFAULT ''", "position": 8 }, { "name": "_born", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n _born TEXT", "position": 9 } ], "constraints": [ { "declaration": "\n UNIQUE (workspace_id, device_id)", "position": 10 }, { "declaration": "\n CHECK (json_type(labels_json) = 'array')", "position": 11 }, { "declaration": "\n CHECK (json_array_length(labels_json) BETWEEN 1 AND 3)", "position": 12 }, { "declaration": "\n FOREIGN KEY (workspace_id) REFERENCES cotton_workspaces(id) ON DELETE CASCADE\n ", "position": 13 } ], "prefix": "CREATE TABLE IF NOT EXISTS cotton_machine_runners (", "suffix": ")", "indexes": [ "CREATE INDEX IF NOT EXISTS idx_cotton_machine_runners_device ON cotton_machine_runners (workspace_id, device_id)", "CREATE INDEX IF NOT EXISTS idx_cotton_machine_runners_author ON cotton_machine_runners (substr(_hlc, 20), _hlc)" ], "full_text": [], "triggers": [] } ] }