Add filecache to git plugin FileContent with configurable TTL by Lagoja · Pull Request #2798 · jetify-com/devbox

@Lagoja

The git plugin's FileContent method was cloning the repo on every call.
This adds caching using filecache (matching the github plugin pattern),
with TTL controlled by DEVBOX_X_GITHUB_PLUGIN_CACHE_TTL env var.

Includes tests for cache hit, TTL expiry, and invalid TTL handling.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: John Lago <750845+Lagoja@users.noreply.github.com>
Use ttl.String() instead of raw env var in cache keys to avoid
path-separator injection and trailing slashes. Add t.Skip guard
in setupLocalGitRepo for CI environments without git.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@Lagoja Lagoja deleted the jl/github-cache-backoff-env-variable-not-working-for-githttps branch

March 24, 2026 00:20