IF Commons GitHub

ci/history

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0002-libraries-ci-findings FR-007

The history of findings (commons 0038-build-policy FR-012): the orphan branch findings-history of the repository, one new file for each run at runs/YYYY/MM/DD/<workflow>-<run id>.json, written by a commit that adds a file and changes none, pushed as a fast-forward and, where the branch moved meanwhile, retried from the new tip and never forced. Real git is the only thing it uses (no package), so that the job that keeps the history needs nothing installed. read gives the files of the branch for the site, oldest first.

import { BRANCH, runPath } from "./history.ts";
runPath({ id: "9", workflow: "ci", commit: "c", at: "2026-11-22T10:00:00Z" }); // "runs/2026/11/22/ci-9.json"

Source: commons/libraries/src/ci/history.ts

4 of 6 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

BRANCHconst
const BRANCH: "findings-history"

The branch that keeps the history.

Imported by 3 tests of the run (3 passed, 0 failed): the library's results

runPathfunction
function runPath(run: RunInfo): string

Where the file of a run is on the branch.

Imported by 3 tests of the run (3 passed, 0 failed): the library's results

Kepttypeno test imports it
type Kept = { readonly kind: "kept"; readonly path: string; readonly attempts: number } | { readonly kind: "exists"; readonly path: string } | { readonly kind: "failed"; readonly error: string };

What keeping a run came to.

keepRunfunction
function keepRun(_repo: string, remote: string, file: FindingsFile, o?: { readonly attempts?: number | undefined; readonly name?: string | undefined; readonly email?: string | undefined; }): Kept

Adds the file of a run to the branch of a repository (remote is the address of the repository, whose branch is read and pushed): the branch is made orphan where it is not there, a file already on it is never replaced, and a push that is not a fast-forward is retried from the new tip, up to attempts times, and never forced.

Imported by 3 tests of the run (3 passed, 0 failed): the library's results

readHistoryfunction
function readHistory(repo: string, ref?: string): readonly { readonly path: string; readonly text: string; }[]

The files of the branch that the repository has, oldest first, as text (what the site reads); none where the branch is not there.

Imported by 3 tests of the run (3 passed, 0 failed): the library's results

readTextconstno test imports it
const readText: (p: string) => string | undefined

The text of a file of a folder, or undefined.

Titles, headings, exports, tables, columns and requirements. Esc closes.