Skip to content

fix(examples): bypass cache when running a single example directly#55

Merged
richardsolomou merged 1 commit intomainfrom
posthog-code/run-examples-bypass-cache-single
Apr 24, 2026
Merged

fix(examples): bypass cache when running a single example directly#55
richardsolomou merged 1 commit intomainfrom
posthog-code/run-examples-bypass-cache-single

Conversation

@richardsolomou
Copy link
Copy Markdown
Member

Problem

When invoking run-examples.sh with a name filter that resolves to exactly one example (e.g. ./run-examples.sh openai/embeddings), the runner would silently skip execution if the example was already cached from a previous passing run. If you're running a specific example by name, you almost certainly want it to actually run.

Changes

  • Set RERUN=1 in the single-match branch of the name-based matcher so the cache check is bypassed.
  • Updated the usage comment to note that a specific example bypasses the cache.

Batch runs (--all, --parallel, or fuzzy filters matching multiple examples) still respect the cache.

How did you test this code?

Manual: ran ./run-examples.sh <name> for a cached example and confirmed it re-executed rather than reporting "cached".


Created with PostHog Code

When the user invokes run-examples.sh with a name filter that resolves
to exactly one match, they're running that example on purpose — caching
the previous pass and skipping it is surprising. Batch runs and fuzzy
filters matching multiple examples still use the cache.

Generated-By: PostHog Code
Task-Id: 8eea9ca1-1939-4c59-b12a-92784f5b7238
@richardsolomou richardsolomou merged commit be1da53 into main Apr 24, 2026
11 checks passed
@richardsolomou richardsolomou deleted the posthog-code/run-examples-bypass-cache-single branch April 24, 2026 06:34
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