Skip to content

feat: add caching for generate command#2

Merged
machado144 merged 1 commit intomainfrom
feature/generate-cache
Feb 11, 2026
Merged

feat: add caching for generate command#2
machado144 merged 1 commit intomainfrom
feature/generate-cache

Conversation

@machado144
Copy link
Contributor

Summary

  • Cache GitHub-discovered repos and template variables in ~/.yankrun/cache.yaml
  • Dry runs (--dryRun) use cached data to show placeholders without re-cloning
  • Add --noCache flag to bypass cache and fetch fresh data
  • Cache is automatically updated after each full generate run

What's cached

  • GitHub repos: keyed by a SHA of your GitHub config (user, orgs, topic, prefix). Changes to config auto-invalidate.
  • Template variables: keyed by repo URL + branch. Stores the git SHA and placeholder counts from the last clone.

New files

  • domain/cache.go - cache data types
  • services/cache.go - cache I/O, lookup, update, config hashing
  • services/cache_test.go - 16 unit tests covering round-trip, lookup, update, SHA determinism

Test plan

  • All 16 new cache unit tests pass
  • All 24 existing unit tests pass (services package)
  • All 10 integration tests pass
  • go vet ./... clean
  • go build ./... clean

Cache GitHub-discovered repos and template variables in
~/.yankrun/cache.yaml to avoid redundant API calls and cloning.
Dry runs use cached data when available. Add --noCache flag to bypass.
@machado144 machado144 merged commit 2c8abf9 into main Feb 11, 2026
2 checks passed
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