@flakytests/state-git
v0.1.0
Published
Git-backed flaky test state with optimistic concurrency and per-test records
Readme
@flakytests/state-git
Git-backed persistence for flaky test management. Requires Node.js 22+, Git,
and an authenticated writable remote. MIT licensed. Included by @flakytests/cli.
import { GitStateStore } from "@flakytests/state-git";
const store = new GitStateStore({
cwd: "/path/to/repository",
remote: "origin",
branch: "flaky-state",
});The store creates an orphan state branch on its first write. Each test has a SHA-256-addressed JSON record. Transactions use isolated Git indexes and refs; the source checkout and index are unchanged. Conflicts reload state and replay the policy callback before retrying the push.
Restrict state-branch writes to automation and exclude it from ordinary CI. No external database, PRs, or raw CI history are needed. Git history preserves auditing. Re-evaluating the same report in separate invocations counts as separate observations; V1 does not deduplicate run IDs.
See the project documentation.
