Skip to content

fix(ci): record a passing run even when the cache was not consulted - #389

Merged
dan-petty merged 1 commit into
release/v0.2.22from
fix/ci-cache-always-saves
Sep 22, 2026
Merged

dan-petty merged 1 commit into
release/v0.2.22from
fix/ci-cache-always-saves

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

--no-cache suppressed both halves of the cache: it skipped reading an existing entry, which is what the flag is for, and then discarded the result of the run it had just completed. A single --no-cache therefore cost two full runs, because the next ordinary invocation had nothing to hit and repeated all the work over an unchanged tree.

The flag decides whether an existing verdict may be trusted, not whether a fresh one is worth keeping. A --no-cache run has done the work and proved the tree, so it now records that. Measured here: --no-cache at 2m49s writes the entry, and the following ordinary run returns in 3.6s instead of repeating it.

A failing run still clears the cache, and a dry run still records nothing, since it has not run the checks. --force already behaved this way, which is why the two flags previously disagreed about what should happen after the work was done.

The investigation behind this found the cache itself correct: an unchanged tree returns in 5ms, and appending one line to a source file produces a full re-run. --no-cache was never necessary to pick up changes -- content addressing landed in #375 -- so the flag is for distrusting a recorded verdict, not for invalidating a stale one.

`--no-cache` suppressed both halves of the cache: it skipped reading an existing entry, which is what the flag is for, and then discarded the result of the run it had just completed. A single `--no-cache` therefore cost two full runs, because the next ordinary invocation had nothing to hit and repeated all the work over an unchanged tree.

The flag decides whether an existing verdict may be trusted, not whether a fresh one is worth keeping. A `--no-cache` run has done the work and proved the tree, so it now records that. Measured here: `--no-cache` at 2m49s writes the entry, and the following ordinary run returns in 3.6s instead of repeating it.

A failing run still clears the cache, and a dry run still records nothing, since it has not run the checks. `--force` already behaved this way, which is why the two flags previously disagreed about what should happen after the work was done.

The investigation behind this found the cache itself correct: an unchanged tree returns in 5ms, and appending one line to a source file produces a full re-run. `--no-cache` was never necessary to pick up changes -- content addressing landed in #375 -- so the flag is for distrusting a recorded verdict, not for invalidating a stale one.
@dan-petty
dan-petty merged commit d541ac5 into release/v0.2.22 Sep 22, 2026
8 checks passed
@dan-petty
dan-petty deleted the fix/ci-cache-always-saves branch September 22, 2026 16:12
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