Skip to content
drsassafrasPublic

About

One command that runs all of a project’s tests and checks at once on a live board, in the terminal or the browser, and holds pushes, merges and releases to the same rules. Built-in tools include TrueNAS app testing, style review and future tests.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

callboard

One command that checks a project's code — its tests and check tools, all at once on a live board — and, for an app on a TrueNAS, copies the code there and restarts it. The same checks are the project's gates (push, merge, release), run by hand, by a git hook or on GitHub, and a UI in your browser shows each run and what every tool found.

callboard was part of Plex Cache (its dev/ folder, where it was called devtools, and tnsync before that) and is its own project from version 4.0.0, so every project can use one install. It needs Python 3.15 and bash; nothing from PyPI.

The name: a callboard is the notice board by a theatre's stage door, the one place the whole company checks before the show — who has signed in, the day's calls, the stage manager's notes. Nothing goes on until the board says so.

Install (once on a computer)

git clone https://github.com/drsassafras/Callboard ~/Code/Callboard
mkdir -p ~/bin
ln -sf ~/Code/Callboard/bin/callboard ~/bin/callboard   # ~/bin must be on your PATH

A project finds the install by CALLBOARD_HOME (callboard sets it for every check it runs), else by the callboard on your PATH. callboard home prints where it is.

Use it in a project

Nothing sets callboard up by itself: a project has it because someone ran callboard init there, and callboard remove takes it out of a checkout again.

cd ~/Code/my-project
callboard init            # writes callboard.toml from the tests and checks it finds (Python, Node, Go, shell scripts,
                          # workflows, Dockerfiles), to commit, and offers the pre-push hook
callboard init --local    # this computer's alone: callboard.local.toml, never committed, no hook
callboard                 # the checks, on the board
callboard ui              # the same in your browser
callboard gate push       # the checks as a git push is held here: by the gate its branch belongs to (merge: a pull request; release: a tag)
callboard --focus stable  # a run by hand, coloured as the Stable gate holds it (dev, release likewise)
callboard focus           # the focus a run by hand has here, and why; `callboard focus stable` pins one, `focus auto` unpins
callboard config show     # every integration's rules as they stand for this code
callboard tool typecheck  # one of callboard's own tools, in the project you're in (buildcheck, webcheck, coverage…)
callboard setup           # what the Environment block says is missing, put here: .venv with pyproject.toml's
                          # [dependency-groups] dev, and the tools the last test run needed (i on the board);
                          # --dry-run says what it would do, and where, with nothing changed

Two files, either of which may say anything the other may:

  • callboard.toml, at the project's root and committed, travels with the project: what's checked and what each finding is held to (a failure, a warning, a note, or off) at each gate it runs at. The gates — the pre-push hook, callboard gate …, GitHub — read this file alone, so what's pushed is held to what's committed.
  • callboard.local.toml, beside it, is this computer's own: laid over callboard.toml table by table (what it sets wins) for your board and UI, never committed (init --local lists it in .git/info/exclude) and never read by a gate.

Each integration's rules are a table per gate ([coverage.dev], [coverage.release]). A rule is a failure, a warning, a note or off, and a number may be both (changed = {fail = 90, warn = 95}: under 90 a failure, under 95 a warning). The UI's Integrations page sets all of this; its Gates page shows the whole picture, installs the hook and switches GitHub on (.github/workflows/gates.yml, written from callboard/gates.yml).

Dev, Stable, Release. A gate is where the code is in its life. Each lists what belongs to it: branches, by name or pattern, and kinds of tag ([tags]' release, freeze, preview, alpha).

[gate.dev]
branches = ["dev"]            # and every branch no other gate lists
tags = ["alpha"]
github = ["pull_request"]     # the git events GitHub runs at this gate

[gate.stable]
branches = ["main"]
github = ["push", "pull_request"]

[gate.release]
tags = ["release", "freeze", "preview"]
warn_tags = ["preview"]       # a beta: the Release rules, failures shown as warnings
github = ["tag"]

A branch or a tag is matched against Release first, then Stable, then Dev; a gate with nothing listed isn't used. A push, a pull request (the branch it's going into) or a tag is held to the rules of the gate it belongs to, and GitHub runs it only where that gate's github lists the event; a push and a pull request are separate checks. The gates cascade, Dev first: [coverage.dev], [coverage.stable], [coverage.release], each saying only what it changes (stricter, looser, or "off"), and an integration is at every gate from the first it has a table for. A rule is a level and nothing more. A rule may opt out of git: errors = {level = "fail", git = false} holds when you run the checks by hand or on the board, but no push, pull request or tag holds it, and a check whose every rule at a gate opts out isn't run at that gate's git events (Build Validation's rules start opted out: GitHub's own build says whether it builds there). Three starting points cover most projects, and callboard init picks the one that fits the repository's branches: one branch and its tags; a main branch that's stable, released by tag; release lines of their own (release/*). The Gates page sets what belongs to each gate and ticks the git events; the pre-push hook checks a push against its branch's gate before it leaves. A project with no [gate] tables has the Dev gate alone.

A rule is never said again the same as it's handed (a save takes it out), and an empty table ([unit.stable]) holds everything it's handed. The local file and your standard follow the project's gates: what they say at one gate holds at the later ones too, and still only ever stricter. callboard.local.toml may give a project's integration a [<id>.dev] of its own; a gate's run never reads it.

The focus. One run says how every gate holds what it found. The blocks are coloured by the run's focus, and each check's title row ends with the gates' letters (D S R) in the colour of their verdict on the same run: nothing is run twice, each tool judges what it measured once more with each gate's rules. A grey letter is a verdict that isn't known (a command of your own that only exits, or a tool that measures differently at that gate); a grey dot, a gate the check isn't at. The focus is, first match: --focus <gate>; the one pinned (callboard focus <gate>, kept in callboard.local.toml's [gates] focus); for a tag's code (callboard release, beta), the gate its kind of tag belongs to; else the gate the branch belongs to; Dev outside a git checkout. The header always says it and why. With Stable or Release as the focus the run is that gate's verdict on the code as it is (callboard.toml alone), and the checks that aren't that gate's still run, shown grey, for their lights. g on the board looks at the same run as the next gate holds it; in the UI, click a dot (the address keeps it: ?as=stable).

Each outside tool an integration runs (Ruff, pyright, Stylelint, pytest …) has a few of its own settings on that page too, opened by the arrow beside its name. They follow the same rule as the gates: the stricter setting holds, and no file loosens what another set.

  • The project's are the tool's own file (ruff.toml, package.json's "stylelint", pytest.ini …), which the Project tab writes, so the project's own runs of the tool hold the same. A tool with no settings file of its own (go vet, go test, axe-core) and a setting a tool only takes as a flag (ShellCheck's and bandit's severity) are kept in callboard.toml instead; callboard.toml says nothing else of a tool.
  • callboard.local.toml and my standard say [<id>] <setting> and are laid over the project's when callboard runs the tool. A switch can be turned on, a ladder moved to a stricter step (drawn looser on the left, stricter on the right), a list of what's checked added to, and a list of what's left out only shortened: a page says what it takes away as <setting>_drop. A fact about the code (its target Python, the shell its scripts are for) is the project's, else the first file's that says one.
  • A value that's looser than what holds isn't used. The page won't save one to callboard.local.toml; my standard may keep one (it's for every project) and the page shows it isn't in use here. A run says each one it leaves out.
  • Where a key of the tool's own file can undo what a stricter page asks (mypy's allow_untyped_defs under Strict mode), the page says "May be overridden" beside the setting. Those keys are tried against each tool at its pin by the suite, and tried again whenever a tool moves to a new major release.
The project… has hook
is set up to ship (callboard init) callboard.toml, committed yes, if you say so
is set up here only (callboard init --local) callboard.local.toml alone: nothing of callboard's in git no: there's no gate
came with callboard (a clone) the callboard.toml it came with callboard init offers it (git never copies a hook)
came with it, and you want more both: callboard init --local adds yours yes; it holds the committed rules only

An integration names the commands it runs (requires = ["go"]): one that isn't installed on this computer is said by name in its block. [config] also names the project's Python package (package, for Coverage), its version file and its cache folder (cache: ~/.cache/<name>).

Tour, the copy to a remote system and its restart, is a project's choice: a [tour] table in either file. What the remote is comes from a formula (callboard/tour.py): one TOML file for a kind of system, saying which settings a project may give, where the files go, and the command for each step after the copy (a check before anything restarts, the restart, and what's asked until the remote is back). [tour] formula = "home-assistant" is a Home Assistant integration's whole Tour where the box answers at homeassistant.local (the domain is read from its manifest.json; host, user, port, config say otherwise). No formula named is truenas-app, as a [tour] always was (host, user, port, app, web_port, dest, paths, exclude).

callboard tool tour list         # the formulas here, each supported (and on what), experimental or custom
callboard tool tour show         # this project's Tour as it resolves: every command a push would run, nothing run
callboard tool tour check FILE   # a formula of your own, held to the format

A project that pushes to more than one remote names each, [tour.remotes.<name>]. What [tour] says is every remote's (where its formula has that setting), a remote's own table says otherwise, and each can have its own formula; where each is reached from this computer goes in callboard.local.toml under the same name:

[tour]                       # callboard.toml
formula = "truenas-app"
paths = ["app", "compose.yaml"]
default = "nas"              # where a push goes when none is named (left out: the first one that's on)
[tour.remotes.nas]
app = "myapp"
dest = "/mnt/tank/apps/myapp"
[tour.remotes.nas2]
app = "myapp"
dest = "/mnt/pool/apps/myapp"

[tour.remotes.nas]           # callboard.local.toml
host = "192.168.4.10"
[tour.remotes.nas2]
host = "192.168.4.11"
callboard push local --to nas2   # that remote (restart and status take --to as well)
callboard push local --to all    # each remote that's on, in turn (--to nas,nas2: those); the checks run with the first
callboard tool tour show --to nas2

A check's board has this run's remote in its Sync block (p pushes it) and a grey block for each of the others, saying how it stands and how to push it; one that's out of sync or out of reach fails nothing. enabled = false in a remote's table keeps its settings, off. A [tour] that names no remotes is one remote, as before.

The UI's Integrations page lists the Tour too, last under Release and delivery: tick it to set one up (the formula that fits the project is named), and its panel has the formula, its settings and, as saved, every command a push would run. Where the remote is and who signs in (host, user, port) are saved to callboard.local.toml, this computer's; the rest to callboard.toml. Unticked, the table is kept with enabled = false: no Tour, nothing pushed or asked.

A formula is data in a closed format: a step's command is a list of plain words, never a shell line, and every setting is held to its type, so nothing in one can be read as a second command or reach outside its folder. The ones callboard ships are in callboard/formulas/; your own go in ~/.config/callboard/formulas/ (shown as custom: a cloned repository can't bring one). A project without a Tour runs its checks alone and asks no remote anything.

What's here

Path What it is
bin/callboard The command: the sync to a TrueNAS app, and the run of the checks.
callboard/policy.py, starter.toml callboard.toml, read: the integrations, each one's gates and the rules it's held to there. The starter file callboard init writes.
callboard/plan.py, board.py, progress.py The plan of a run, the board that draws it, the progress bar and result line every tool shares.
callboard/catalog.toml, catalog.py The catalogue: every integration callboard knows, what it is and why one would want it. The UI's Integrations page lists them with the project's own, each ticked on the board or not, opened for its tools, its rules and its place on the board; a new tool belongs here.
callboard/pins.py The check tools' pins kept current: callboard tool pins says each one's newest release (npm, PyPI, GitHub), --move moves the patch and minor steps (a major by name), and the Integrations page has an Update button on each tool.
callboard/install.py callboard init and callboard remove: what a project has, found; the two files written; the hook.
callboard/gate.py The gates, and what GitHub runs of them.
callboard/checks.py, tools.toml What every check tool shares: each tool at one pinned version (a project's own dev/tools.toml wins), fetched once, its findings said one way.
callboard/typecheck.py, buildcheck.py, coverage.py Code Validation (pyright and Ruff, each on unless set false: [types] ruff = false; mypy an option a project ticks: [types] mypy = true; go vet on where there's a go.mod, at the project's own Go: [types] govet), Build Validation (ShellCheck, actionlint, hadolint), Coverage.
callboard/webcheck.py, webcheck.js DHTML: the web's CSS, scripts and pages — Stylelint (as written, and as the oldest target browsers get it), ESLint, TypeScript where there's a jsconfig, html-validate, and axe-core's accessibility check where it's ticked ([dhtml] axe = true: it needs a browser). The targets and each tool's settings are the project's package.json's (browserslist, graceful, stylelint, eslint, htmlvalidate); a tool that package.json names is the project's own install, else each is fetched at its pin. [dhtml] folders says where the web's files are, [dhtml] plan a command of the project's that names what else to check (pages as the app draws them, the pages axe-core draws).
callboard/previews.py Previews: the project's tests on what comes next — the next Python, and the pre-releases of the packages it names ([future] interpreter, prereleases), every deprecation an error — in an environment of its own, run by the Unit Tests' runner. A project with a route of its own runs that instead: callboard tool previews -- <its command>.
callboard/audit.py Security Audit: Ghostlight's report (ghostlight check --json) said as every check is, each finding held at the level [audit] gives its rule. Ghostlight is a program of its own, not on every computer: where it isn't, the Integrations page doesn't list the Security Audit, and a run says so (it couldn't run, where a rule is held as a failure).
callboard/release.py Release checks: the version a new X.Y.0 above what's released ([config] version_file), what the project's Translations, Coverage, Security Audit and Wardrobe hold at the release gate (each only where the project has it), the project's own checks ([release] own_checks: each "Name: command", met where it exits 0), the change notes and the manual items. Its commands too: callboard tool release start, candidate, hotfix, tick, notes, bump.
callboard/i18n.py, iso639.py Translations: every translatable text found in the project's scripts, pages and Python, and each language's catalog (<code>.json) held to its target, CLDR's plural forms, BCP 47's codes and the quality checks. [i18n] says what the project is where the defaults don't fit: catalogs, sources, the calls a text goes through (text_calls, marker_calls, plural_calls, python_calls), base, variants, languages. callboard tool i18n status, sync, missing <code>, merge <code> <file>, quality, leftovers.
callboard/upkeep.py, cves.py Dependencies: each version the project pins against the newest release upstream, and the known vulnerabilities in them. It finds the npm packages (each package.json), the Python packages pinned with ==, the project's own check tools (dev/tools.toml) and the Dockerfile's base images by itself; anything else is a line in callboard.toml ([upkeep] also = ["ffmpeg: ARG FFMPEG from page:https://ffmpeg.org/releases/ /ffmpeg-(\\d+(?:\\.\\d+)+)\\.tar\\.xz/"]: where its pin is, and where its releases are). A minor or patch release is moved where the branch's move says so; a major is yours. The CVEs come from OSV, NVD and Trivy, are judged against what's moving, and are only ever a warning; [upkeep] hold, decisions and images are the project's own choices. callboard tool upkeep --help
callboard/style.py, style-sample.js, still.js Wardrobe, the style guide: every look the app wears (each CSS rule, inline style, drawing, theme colour, font and shipped image) against the guide the maintainer approved; sample photographs what's new Before and After in each theme, review is the page with the Approve buttons. What the app is, callboard.toml's [style] says: its web folder (web, found by itself), the themes it can wear (themes = ["classic/dark: Classic dark", …], theme_file, theme_store), the demo the pictures are taken of (demo = "python3 tests/demo.py {port}"), and the rest (callboard tool style --help lists each).
callboard/tour.py, formulas/ The Tour's formulas: what a kind of remote system is to the push (a TrueNAS app, a Home Assistant box), as data. bin/callboard runs the steps a formula says.
callboard/unittests.py, testfeed.py Unit Tests for a project with no test runner of its own: its pytest suite, or unittest's, with the bar every run of tests has. A whole run saves its coverage where callboard.toml has a Coverage block (the Python programs its tests start counted too: callboard/children/sitecustomize.py).
callboard/needs.py, envcheck.py, setup.py What a test needs from this computer (@needs(package="pytest"), tool=, command=): where it isn't here the test is held to [unit] missing, never a quiet skip. The Environment block (callboard tool envcheck) checks the project's Python against the version it supports, its development packages (pyproject.toml's [dependency-groups] dev) in its .venv, each integration's commands, and what the last test run was missing; callboard setup (i on the board) makes the .venv and installs or fetches it. Each project keeps its own record of what its tests were missing, so two projects sharing a cache never read each other's. After a run on a terminal, the board asks before installing, with setup's own plan (what it would install, and where; what it can't; what y and N do), and asks nothing when setup has nothing to do.
callboard/devui.py, devui.html, devui.css, devpage.py The UI, and what the dev tools' pages share (this computer only, the browser that opened it only).
callboard/notes.py Change notes and manual release items: what the Gates page shows and ticks.
callboard/schemas.py The rules of the kinds of check a project brings itself (its tests, its release checks…), for when its tool isn't there to say them.
callboard/themekit.py The theme kit: Dionysus's themes (Classic and Dionysus, light and dark) as the dev apps wear them, made from its committed code. callboard tool themekit sync <folder> writes a project's copy (Classic and Auto its defaults), check [<folder>] says whether it was edited by hand or is behind Dionysus (every kit in the project when no folder is named): one of Shared Code's sources. Callboard's UI and Ghostlight's page wear it.
callboard/shared.py, templates.py, copies.py Shared Code: the code copied into a project from one source and kept in step, as one integration (callboard tool shared, its rules test_missing, test_edited, test_behind, no_reason): MyStandards' shared tests and libraries (else callboard's), and the theme kits. callboard tool shared sync writes every copy as its source has it.
callboard/everywhere.py In every project: for a MyStandards checkout, each project beside it that keeps a copy of a template runs its own Code Validation (its ruff.toml, pyrightconfig.json, [types] and pins) on the templates as MyStandards has them, in a scratch project that links the project's code and writes the templates where it keeps them (the copy's folder, and the app's own copy its settings file's "runtime" names). MyStandards says no lint rules of its own: it's held to exactly what every project holds it to. A project is run again only when a template it keeps, a file that says its rules, my standard or callboard's Code Validation has changed since the last run (a fingerprint, kept in the cache); else its last verdict is said. Its rules are opted out of git: a push's checkout hasn't the other projects.
callboard/websecurity.py, websecurity.toml Web Security: what the project's pages are held to against other sites and injected code, as one integration (callboard tool websecurity, its rules not_held, no_reason, spare, not_run). Each check is a shared test's (the secure headers', the safe writes' and the routes', read from the code; the page checks' that are about security, read from the record their tests keep of their last run), one thing a page is held to, on unless callboard.toml says why it's left out ([templates.<name>.checks]). The checks are in seven settings (where the headers come from, the instructions to the browser, what a page may load and run, the exceptions allowed, text from outside the page, cookies and requests, what can be asked), each setting's in groups by what they guard: its panel on Integrations sets each check, or a whole group, on or off, with one reason for what a setting leaves out, and every check has an info button saying why it matters and the reasons to leave it out (the words are websecurity.toml's). A check with nothing to check without another goes with it (the shared tests' template.toml's [needs]: the checks about the Content-Security-Policy need there to be one). With no run of the page checks kept it draws the pages once itself. Its page says how each check stands, how many pages conform, what the project lets in and which pages used it, what may build HTML (each Trusted Types policy the code makes, what it lets through and what it's handed), what can be asked (the level the project is at: Found, its routes the ones found by reading its code, or Declared, each route of its table with what it takes and changes, held at one door; callboard's own two pages are Declared: callboard/routes_devui.json, routes_review.json, routes.py), what can change data (each declared writer and what it changes, each write a read is let make and why: the safe writes, MyStandards/templates/safewrites/README.md), and the pages in groups.
callboard/standard.py My standard: your minimum config (standard.toml, in your home folder), laid over each project's rules, the stricter of each; its check (callboard tool standard, rules short and missing) says where a project of yours hasn't got an integration it asks for. An integration like any other: on the board only where a file puts it.
callboard/ui/ The UI's copies from Dionysus: the theme kit (theme/) and the identicon. refresh.py <Plex Cache checkout> takes them again.
tests/test_callboard.py callboard's own tests: the board, the rules, the gates, the check tools' shared code, Coverage and the UI, each in a project of its own in a temp folder (python3 -m unittest discover -s tests, or callboard tool unittests: callboard.toml's Unit Tests).
callboard.toml, pyrightconfig.json, ruff.toml callboard checked by callboard: callboard gate push in this checkout.

What a project still brings

Its tests (any command), and the tools that are about the project itself. Plex Cache's are in its dev/: the dependency check, the future tests, the translations, the style guide, the release checks and the security audits, each built on callboard/checks.py and policy.py, and its tests of those tools on callboard.

On GitHub

A workflow fetches callboard beside the code, then runs the same commands:

- run: |
    git clone --quiet --depth 1 --branch main https://github.com/drsassafras/Callboard "$RUNNER_TEMP/callboard"
    echo "CALLBOARD_HOME=$RUNNER_TEMP/callboard" >> "$GITHUB_ENV"
    echo "$RUNNER_TEMP/callboard/bin" >> "$GITHUB_PATH"
- run: callboard gate push --ci

Licence

See LICENSE.

About

One command that runs all of a project’s tests and checks at once on a live board, in the terminal or the browser, and holds pushes, merges and releases to the same rules. Built-in tools include TrueNAS app testing, style review and future tests.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages