Skip to content

fix(action): key the action's cache by the binary's cache schema - #325

Merged
sweepies merged 1 commit into
mainfrom
fix/action-cache-schema
Nov 14, 2026
Merged

sweepies merged 1 commit into
mainfrom
fix/action-cache-schema

Conversation

@sweepies

@sweepies sweepies commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Bug

The composite action cached $RUNNER_TEMP/patchula under patchula-v2-<os>-<arch>-<run>-<attempt> and restored any patchula-v2-<os>-<arch>- entry, so every Count version shared one cache lineage. The binary rejects a cache database from a newer schema (Error::FutureSchema, on purpose, and that stays). So an older binary that restored a newer binary's cache failed hard:

× cannot open the cache in /home/runner/work/_temp/patchula: cache schema 15 is newer than supported schema 8

This showed up in #318's "Action" dry run (release 0.8.1) after main's source-built self-run saved a schema-15 cache. Anyone rolling back to an older version would hit the same error.

Fix

  • New patchula cache schema prints the newest cache schema the binary supports (patchula_cache::SCHEMA, which is MIGRATIONS.len(), currently 15).
  • action.yml now resolves the binary in its own Install Count Patchula step, before the cache step. That step uses the same binary: / version / action-ref logic as before and outputs the binary path plus a cache lineage:
    • s<schema> when the binary has cache schema
    • v<version> (from --version) for older releases that don't have it
  • The cache key is now patchula-v3-<os>-<arch>-<lineage>-<run>-<attempt>, and it only restores within its own lineage. The run step uses the resolved binary. The pre-0.4.0 --cache file/dir handling is unchanged.
  • When the schema changes, the next run starts with a cold cache, which is always a correct state. The old v2 entries are abandoned.
  • Docs: the GitHub Actions guide (caching paragraph), internals/cache.md (schema section), and the regenerated CLI reference and help snapshot.

The "Action" workflow dry run uses the latest release (0.8.1), so it covers the version fallback path.

View guided diff Turn on auto-fix

Every Count version shared one actions/cache lineage, so an older binary
could restore a newer binary's database and refuse it as a future schema.
The action now installs the binary first, asks it for its schema with the
new `patchula cache schema`, and keys the cache by that schema; releases
without the command key by their version.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
count-patchula fe741f6 Commit Preview URL

Branch Preview URL
Nov 14 2026, 07:21 PM

@sweepies
sweepies merged commit 01d5a4e into main Nov 14, 2026
14 checks passed
@sweepies
sweepies deleted the fix/action-cache-schema branch November 14, 2026 19:26
@sweepies-ops sweepies-ops Bot mentioned this pull request Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant