Logo: Flaker Storage Cache On Ci

Flaker Storage Cache On Ci

Communautéit
mizchi
flaker-storage-cache-on-ci

Persist flaker's DuckDB storage across GitHub Actions runs and feed it from multiple sources (vitest reports, custom adapter reports, etc.). Use when wiring `@mizchi/flaker` into a new repo's CI, adding a new ingest source to an existing flaker setup, or debugging why `flaker apply` / `flaker run --gate ...` "lost its history" between runs. Encodes the cache key shape, fetch-depth requirements, `--changed` derivation, and the import-step placement that internal flaker users converged on.

Iwwersiicht

Editeurmizchi
Repositoryskills
Skill-Nummflaker-storage-cache-on-ci
Stären
333
Forks
4
Matgeliwwert Dateien
Nëmmen Instruktiounen
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    mizchi huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Flaker Storage Cache On Ci an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/mizchi/skills/tree/main/flaker-storage-cache-on-ci
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/mizchi/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/flaker-storage-cache-on-ci .claude/skills/flaker-storage-cache-on-ci
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Flaker Storage Cache On Ci an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Flaker Storage Cache On Ci automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Flaker Storage Cache On Ci net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

flaker storage cache on GitHub Actions

flaker keeps its data in a DuckDB file at the path declared by flaker.toml [storage] path (default .flaker/data). For flaky detection / KPI / quarantine to work, that file must persist between CI runs. GitHub Actions has no first-class runtime storage, so the convention is actions/cache@v6 with a sliding key.

When this skill applies

  • "新しい repo に flaker を CI で動かす"
  • "flaker の履歴が CI で消えてる / 毎回ゼロからになる"
  • "flaker に を import するワークフロー追加して"
  • "VRT / playwright / custom-adapter report を flaker に流したい"

Cache key shape

yaml
- name: Cache flaker data
  if: always()
  uses: actions/cache@v6
  with:
    path: .flaker/data
    key: flaker-data-${{ github.run_id }}
    restore-keys: |
      flaker-data-
  • key uses github.run_id so each run writes a new cache entry on save (GH Actions saves at end of job).
  • restore-keys: flaker-data- matches anything written previously, falling back to the most recent — so the next run sees the latest accumulated state regardless of which earlier run produced it.
  • if: always() so a failed earlier step still triggers the save (history-on-failure is fine and often more useful than history-only-on-success).

The path MUST equal flaker.toml's [storage] path. Default is .flaker/data (a file, not a directory — pre-creating it as a dir breaks the DuckDB open).

In a pnpm workspace monorepo: prefix the cache path with the package directory, e.g. packages/<pkg>/.flaker/data. flaker does NOT walk up to find flaker.toml — it must live next to where flaker is invoked. Mismatched cache path vs flaker.toml location surfaces as Config file not found (when running from repo root) or "history vanished every run" (when cache and flaker disagree on where storage is).

Triggering writes

actions/cache@v6 saves automatically in its post-step. Callers don't cache save explicitly. The save key is the run-id, so duplicate writes never collide.

fetch-depth for --changed derivation

Any flaker invocation that uses the hybrid / affected strategy (flaker run --gate merge in CI profile, by default) needs --changed <files,...>. Without it: Error: hybrid mode requires resolver and changedFiles.

yaml
- uses: actions/checkout@v7
  with:
    fetch-depth: 0  # need history for `git diff` against the PR base
yaml
- name: flaker run --gate merge
  env:
    BASE_REF: ${{ github.event.pull_request.base.ref }}
  run: |
    changed=$(git diff --name-only "origin/${BASE_REF}...HEAD" | tr '\n' ',' | sed 's/,$//')
    pnpm exec flaker run --gate merge --changed "$changed"

Empty diff (config-only PR, etc.) is fine — hybrid falls back to the configured fallback strategy.

Workflows: which one persists, which one reads

Reference layout for splitting workflows by trigger:

WorkflowTriggerReads cacheWrites cacheNotes
flaker-nightly.ymlcron + workflow_dispatchyesyesRuns flaker apply. The canonical writer of vitest history.
<source>-baseline.ymlpush to main + cronyesyesImports a custom-adapter report via flaker import --adapter <name>. Same cache key.
flaker-pr.ymlpull_requestyes(yes implicitly, harmless)Advisory only, continue-on-error: true.
<source>-pr-gate.ymlpull_requestNONOPR-scoped runs would distort the population — keep them ephemeral.

Rule of thumb: anything that touches main / scheduled writes; PR-scoped checks read-only or no cache.

Adding a new ingest source

Common pattern (custom adapter, see flaker#79 for the adapter contract):

  1. Produce the report file (e.g. <source>-report.json, vitest-report.json).
  2. Restore the cache (or rely on the same job's earlier restore step).
  3. Import:
    yaml
    - name: Import <source> into flaker
      if: always()
      run: |
        pnpm exec flaker import <report-file> \
          --adapter <name> \
          --commit "${{ github.sha }}" \
          --branch "${{ github.ref_name }}" \
          --source ci
  4. The cache save at end-of-job picks up the new rows automatically.

if: always() ensures partial-failure runs still record what they saw before the failure.

Don't do this

  • Don't pre-create .flaker/data as a directory before flaker runs. DuckDB expects to open it as a file; IO Error: Could not read from file ... Is a directory is the symptom. The cache path: .flaker/data referencing a not-yet-existing file is fine — actions/cache restores it if present, and flaker creates it if not.
  • Don't add flaker import to PR-only workflows without thinking. PR runs happen on every commit-to-PR and would dominate the population. Keep PR jobs read-only against the cache.
  • Don't use NODE_OPTIONS=--preserve-symlinks-main with flaker ≥ 0.10.7. It was a workaround for a pnpm symlink bug fixed in 0.10.7; under 0.11.x the env var silently turns the CLI into a no-op, exit 0 (no output, no work done). Surfaced via downstream usage, removed in flaker upstream.
  • Don't try to write the cache from a PR fork. GH Actions disallows writes from forks for security reasons; the restore still works, the save silently no-ops.

Diagnostics

If history "vanishes":

  1. Check the cache hit log line in the workflow run — if it says Cache not found for input keys, the restore-keys prefix doesn't match what was saved.
  2. Check flaker.toml [storage] path matches the cached path: exactly.
  3. Run flaker doctor in the same job — confirms the file is open-able.
  4. flaker status --markdown exposes row counts so you can see what was actually loaded.

Reference

  • flaker itself (docs/contributing.md) for the storage path convention.
  • The --adapter system docs for writing a custom report importer.

Heefeg gestallte Froen

Wat mécht de KI-Skill Flaker Storage Cache On Ci?

Persist flaker's DuckDB storage across GitHub Actions runs and feed it from multiple sources (vitest reports, custom adapter reports, etc.). Use when wiring `@mizchi/flaker` into a new repo's CI, adding a new ingest source to an existing flaker setup, or debugging why `flaker apply` / `flaker run --gate ...` "lost its history" between runs. Encodes the cache key shape, fetch-depth requirements, `--changed` derivation, and the import-step placement that internal flaker users converged on.

Firwat Flaker Storage Cache On Ci op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Flaker Storage Cache On Ci besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Flaker Storage Cache On Ci an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/mizchi/skills/tree/main/flaker-storage-cache-on-ci an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Flaker Storage Cache On Ci benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Flaker Storage Cache On Ci benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Flaker Storage Cache On Ci domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Flaker Storage Cache On Ci gratis?

mizchi huet de Skill op GitHub publizéiert. Kuckt am Repository no de Lizenzbedéngungen. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇