Skip to content

fix: fetch from the configured upstream URL - #76

Merged
rolandjitsu merged 1 commit into
rolandjitsu:mainfrom
profiling:upstream-url-consistency
Nov 14, 2026
Merged

rolandjitsu merged 1 commit into
rolandjitsu:mainfrom
profiling:upstream-url-consistency

Conversation

@profiling

@profiling profiling commented Nov 14, 2026 •

Copy link
Copy Markdown

A reused mirror retains the origin URL recorded at clone time. After changing the configured upstream, incremental fetch and missing-SHA backfill still contact that old origin, while new clones use the configured URL.

Use the configured repo.upstream_url for both fetch paths. Keep mirror refspecs, pruning, local pins, credential injection, retries and existing error handling unchanged. Document cache reuse: old objects and pins remain available, so switching trust domains requires a fresh or separate cache root, including LFS.

Validation:

  • Real Git A/B fixture checks new refs, removal of old refs, a hidden SHA present only on B, pin retention across pruning, unchanged origin config and WantFetch metrics.
  • Independently reverting either fetch URL makes the regression fail.
  • cargo fmt --all --check
  • cargo clippy --all-targets --all-features --locked -- -D warnings
  • cargo test --all-features (162 tests passed)
  • Independent read-only Orca review: no findings. Reviewer could not independently run tests due to its dependency environment; the author ran the checks above.

This change addresses the synchronous main baseline independently of background-refresh work. The new file:// regression does not exercise HTTP credentials during an upstream switch; existing credential, auth failure and retry tests pass.

Related PRs and integration

Related PRs: #72 fixes upload-pack pipe ownership; #77 bounds and cancels upstream operations. Neither is a merge prerequisite for this PR.

When combined with #72, its missing-SHA test fixture must supply the actual upstream URL instead of an empty string, because both fetch paths now use repo.upstream_url. This fixture adaptation is not included in the standalone PR because the fixture belongs to #72.

An adapted downstream combination of #72, #76 and #77, excluding Draft #67, passed 202 Rust tests plus formatting, clippy, Helm and maintenance checks at profiling/git-cache-proxy@45a0635. This does not mean the unmodified PR heads merge without adaptation. Update whichever PR remains open after the other lands and rerun CI.

@codecov

codecov Bot commented Nov 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.57%. Comparing base (6c4ff31) to head (a14cc00).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #76      +/-   ##
==========================================
+ Coverage   97.54%   97.57%   +0.02%     
==========================================
  Files           9        9              
  Lines        3707     3707              
==========================================
+ Hits         3616     3617       +1     
+ Misses         91       90       -1     

☔ 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.

@profiling
profiling marked this pull request as ready for review November 14, 2026 05:53
@profiling

Copy link
Copy Markdown
Author

@rolandjitsu This is ready for review. Could you review it for inclusion in main?

Both fetch paths now use the configured upstream URL, matching clone behavior when an existing mirror is reused. The change also explicitly documents the cache-reuse contract: old cached objects remain, so a trust-domain change requires a fresh or separate cache.

Local formatting, clippy and all-feature tests pass. All applicable GitHub checks pass, including both image architectures and Codecov project/patch checks. The real Git regression distinguishes the old origin from the configured upstream for both full refs and a hidden SHA available only on the new upstream.

profiling pushed a commit to profiling/git-cache-proxy that referenced this pull request Nov 14, 2026
Import upstream PR rolandjitsu#76 and give the internal SHA-pin fixture its real
configured upstream URL.

Assisted-by: Codex
profiling pushed a commit to profiling/git-cache-proxy that referenced this pull request Nov 14, 2026
Keep rolandjitsu#72, rolandjitsu#76 and rolandjitsu#77 with internal maintenance while deferring rolandjitsu#67.
Preserve the previous tree on its archive branch and in normal history.

Assisted-by: OpenAI:Codex
@rolandjitsu
rolandjitsu merged commit b9f2841 into rolandjitsu:main Nov 14, 2026
13 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.

2 participants