Skip to content

feat: add support for caching LFS - #25

Merged
rolandjitsu merged 3 commits into
mainfrom
feat/lfs-cache
Aug 24, 2026
Merged

feat: add support for caching LFS#25
rolandjitsu merged 3 commits into
mainfrom
feat/lfs-cache

Conversation

@rolandjitsu

Copy link
Copy Markdown
Owner

What kind of change does this PR introduce?

  • fix
  • feat
  • refactor
  • perf
  • docs
  • test
  • build / ci
  • chore

Summary

  1. Add support for caching LFS requests/objects.
  2. Refactor the metrics methods to take enums instead of brittle str.

Tests

  • Added / updated tests (unit, plus integration where it fits)
  • Not relevant, because: ...

Checklist

  • CI is green locally: cargo fmt --all --check, cargo clippy --all-targets --all-features --locked -- -D warnings, cargo test --all-features
  • Commits follow Conventional Commits; AI-assisted commits carry an Assisted-by: trailer (see CONTRIBUTING.md / AGENTS.md)
  • Preserves the read-only, pull-only invariant (no push or proactive replication to upstream)
  • Docs / README updated if behavior or flags changed

Breaking change?

No.

@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.65807% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.12%. Comparing base (4e6883e) to head (623f253).

Files with missing lines Patch % Lines
src/server.rs 87.75% 18 Missing ⚠️
src/lfs.rs 98.01% 7 Missing ⚠️
src/evict.rs 94.25% 5 Missing ⚠️
src/git.rs 91.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #25      +/-   ##
==========================================
+ Coverage   95.92%   96.12%   +0.19%     
==========================================
  Files           5        6       +1     
  Lines         957     1650     +693     
==========================================
+ Hits          918     1586     +668     
- Misses         39       64      +25     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rolandjitsu rolandjitsu changed the title Feat/lfs cache feat: add support for caching LFS Aug 24, 2026
A client's git-lfs derives its LFS endpoint from the proxy URL, so the
proxy must answer the batch API and object transfers or LFS-tracked files
fail to check out.

Proxy the batch API upstream, rewrite each download URL back to the proxy,
and serve objects from a content-addressed cache: a miss fetches once
(verifying sha256 == oid), a hit is served locally, and objects share the
mirrors' cache cap and LRU eviction. Uploads are refused (read-only). The
LFS transfer is in-process over rustls (no OpenSSL), keeping the binary
static.

Assisted-by: Claude:claude-opus-4-8
The record_*/observe_* helpers took plain &str for the kind/op/result labels,
so a typo compiled and only surfaced as a wrong metric series. Type those
arguments with enums (RequestKind, Status, UpstreamOp, ServeKind, LfsResult)
that render to the label string, keeping the free-form repo path a &str.

Assisted-by: Claude:claude-opus-4-8
Pin the Codecov patch bar at 90% and require project coverage to never drop
(0% tolerance), so a change can only hold or raise the line - matching the
floor ci.yml enforces via --fail-under-lines.

Assisted-by: Claude:claude-opus-4-8
@rolandjitsu
rolandjitsu merged commit 1670925 into main Aug 24, 2026
12 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