Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
940 changes: 0 additions & 940 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ chrono = { version = "0.4.41", features = ["serde"] }
clap = { version = "4.5.38", features = ["derive", "env"] }
flate2 = "1.1"
futures = "0.3"
gix = { version = "0.84", default-features = false, features = ["revision", "sha1"] }
http = "1.3.1"
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls", "stream"] }
serde = { version = "1.0.219", features = ["derive"] }
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ from the file.
| `GIT_CACHE_MAX_GIT_OUTPUT_BYTES` | 16 MiB | Upper bound on captured Git subprocess output. |
| `GIT_CACHE_MAX_CONCURRENT_GIT_PROCESSES` | `64` | Semaphore limiting concurrent Git subprocesses (the main CPU/memory knob). |
| `GIT_CACHE_ASYNC_MATERIALIZE_CONCURRENCY` | `2` | Concurrency for background materialization work. |
| `GIT_CACHE_USE_GITOXIDE` | `true` | Use in-process gitoxide for local read-only Git operations; disable as a kill switch to fall back to the `git` binary. |
| `GIT_CACHE_UPSTREAM_AUTH_TOKEN_ENV` | unset | Name of another env var holding a deployment-wide upstream token, injected via Git config env (never argv or manifests). |

### Disk
Expand Down
4 changes: 0 additions & 4 deletions crates/git-cache-api/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ async fn proxy_warm_task_queues_async_generation_materialize() {
max_concurrent_git_processes: git_cache_core::default_max_concurrent_git_processes(),
async_materialize_concurrency: 1,
public_path_prefix: String::new(),
use_gitoxide: true,
};
let state = Arc::new(ApiState::try_new(config).unwrap());
let materializer = Materializer::new(Arc::clone(&state.domain));
Expand Down Expand Up @@ -393,7 +392,6 @@ async fn proxy_warm_task_publishes_served_commit_when_branch_moves() {
max_concurrent_git_processes: git_cache_core::default_max_concurrent_git_processes(),
async_materialize_concurrency: 1,
public_path_prefix: String::new(),
use_gitoxide: true,
};
let state = Arc::new(ApiState::try_new(config).unwrap());
let materializer = Materializer::new(Arc::clone(&state.domain));
Expand Down Expand Up @@ -485,7 +483,6 @@ async fn authenticated_resolve_is_rate_limited_before_upstream_work() {
max_concurrent_git_processes: git_cache_core::default_max_concurrent_git_processes(),
async_materialize_concurrency: git_cache_core::default_async_materialize_concurrency(),
public_path_prefix: String::new(),
use_gitoxide: true,
};
let state = Arc::new(ApiState::try_new(config).unwrap());
assert!(state.rate_limiter.check(), "first request consumes quota");
Expand Down Expand Up @@ -535,7 +532,6 @@ async fn healthz_fails_after_shutdown_begins() {
max_concurrent_git_processes: git_cache_core::default_max_concurrent_git_processes(),
async_materialize_concurrency: git_cache_core::default_async_materialize_concurrency(),
public_path_prefix: String::new(),
use_gitoxide: true,
};
let state = Arc::new(ApiState::try_new(config).unwrap());
let gate = ReadinessGate(Arc::clone(&state.shutting_down));
Expand Down
37 changes: 13 additions & 24 deletions crates/git-cache-api/tests/git_client_advanced.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,18 @@ mod tests {

impl TestServer {
async fn start() -> Self {
Self::start_inner(false, true).await
Self::start_inner(false).await
}

/// Like `start`, but the server reaches the upstream via a `file://`
/// URL instead of a bare path. Git only registers promisor/partial
/// clone state for URL-shaped remotes ("promisor remote name cannot
/// begin with '/'"), so filtered-fetch tests need this variant.
/// `use_gitoxide` selects the local backend (gix vs git subprocess).
async fn start_with_file_url_upstream(use_gitoxide: bool) -> Self {
Self::start_inner(true, use_gitoxide).await
async fn start_with_file_url_upstream() -> Self {
Self::start_inner(true).await
}

async fn start_inner(file_url_upstream: bool, use_gitoxide: bool) -> Self {
async fn start_inner(file_url_upstream: bool) -> Self {
let tmp = TempDir::new().unwrap();
let upstream_bare = tmp.path().join("upstreams/github.com/org/repo.git");
let upstream_work = tmp.path().join("work");
Expand Down Expand Up @@ -70,7 +69,7 @@ mod tests {
let listener = TcpListener::bind("127.0.0.1:0").await.unwrap();
let addr = listener.local_addr().unwrap();

let mut config = if file_url_upstream {
let config = if file_url_upstream {
support::test_config_with_upstream(
addr,
tmp.path(),
Expand All @@ -79,7 +78,6 @@ mod tests {
} else {
support::test_config(addr, tmp.path())
};
config.use_gitoxide = use_gitoxide;

let router = app(config);

Expand Down Expand Up @@ -419,17 +417,8 @@ mod tests {
/// to support filters (`uploadpack.allowFilter`), like real upstreams do;
/// without it the filter is silently ignored and the bug cannot trigger.
#[tokio::test(flavor = "multi_thread")]
async fn full_clone_succeeds_after_blobless_shallow_hydration_gix_backend() {
full_clone_after_blobless_shallow_hydration(true).await;
}

#[tokio::test(flavor = "multi_thread")]
async fn full_clone_succeeds_after_blobless_shallow_hydration_git_backend() {
full_clone_after_blobless_shallow_hydration(false).await;
}

async fn full_clone_after_blobless_shallow_hydration(use_gitoxide: bool) {
let server = TestServer::start_with_file_url_upstream(use_gitoxide).await;
async fn full_clone_succeeds_after_blobless_shallow_hydration() {
let server = TestServer::start_with_file_url_upstream().await;
run_git(
&server.upstream_bare,
&["config", "uploadpack.allowFilter", "true"],
Expand Down Expand Up @@ -497,7 +486,7 @@ mod tests {

#[tokio::test(flavor = "multi_thread")]
async fn materialize_branch_succeeds_after_blobless_shallow_hydration() {
let server = TestServer::start_with_file_url_upstream(true).await;
let server = TestServer::start_with_file_url_upstream().await;
run_git(
&server.upstream_bare,
&["config", "uploadpack.allowFilter", "true"],
Expand Down Expand Up @@ -619,7 +608,7 @@ mod tests {

#[tokio::test(flavor = "multi_thread")]
async fn deepen_after_cold_blobless_shallow_hydration_extends_history() {
let server = TestServer::start_with_file_url_upstream(true).await;
let server = TestServer::start_with_file_url_upstream().await;
run_git(
&server.upstream_bare,
&["config", "uploadpack.allowFilter", "true"],
Expand Down Expand Up @@ -670,7 +659,7 @@ mod tests {

#[tokio::test(flavor = "multi_thread")]
async fn fresh_blobless_depth_clone_expands_after_depth1_cache_warm() {
let server = TestServer::start_with_file_url_upstream(true).await;
let server = TestServer::start_with_file_url_upstream().await;
run_git(
&server.upstream_bare,
&["config", "uploadpack.allowFilter", "true"],
Expand Down Expand Up @@ -744,7 +733,7 @@ mod tests {

#[tokio::test(flavor = "multi_thread")]
async fn blobless_depth_clone_succeeds_after_partial_non_shallow_hot_cache() {
let server = TestServer::start_with_file_url_upstream(true).await;
let server = TestServer::start_with_file_url_upstream().await;
run_git(
&server.upstream_bare,
&["config", "uploadpack.allowFilter", "true"],
Expand Down Expand Up @@ -835,7 +824,7 @@ mod tests {

#[tokio::test(flavor = "multi_thread")]
async fn deepen_after_shallow_clone_does_not_unshallow_cache() {
let server = TestServer::start_with_file_url_upstream(true).await;
let server = TestServer::start_with_file_url_upstream().await;

// Six commits upstream (initial + five). A depth-1 seed then a
// client --deepen=2 must extend the cache by exactly two commits and
Expand Down Expand Up @@ -917,7 +906,7 @@ mod tests {

#[tokio::test(flavor = "multi_thread")]
async fn full_clone_succeeds_after_shallow_generation_hydrates_cold_cache() {
let server = TestServer::start_with_file_url_upstream(true).await;
let server = TestServer::start_with_file_url_upstream().await;

for message in [
"second shallow generation",
Expand Down
1 change: 0 additions & 1 deletion crates/git-cache-api/tests/support/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,5 @@ pub fn test_config_with_upstream(
max_concurrent_git_processes: git_cache_core::default_max_concurrent_git_processes(),
async_materialize_concurrency: git_cache_core::default_async_materialize_concurrency(),
public_path_prefix: String::new(),
use_gitoxide: true,
}
}
9 changes: 0 additions & 9 deletions crates/git-cache-core/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ pub struct AppConfig {
pub async_materialize_concurrency: usize,
#[serde(default)]
pub public_path_prefix: String,
/// Use in-process gitoxide for local read-only Git operations instead of
/// spawning the `git` binary. Acts as a kill switch when disabled.
#[serde(default = "default_use_gitoxide")]
pub use_gitoxide: bool,
}

impl AppConfig {
Expand Down Expand Up @@ -151,7 +147,6 @@ impl AppConfig {
"GIT_CACHE_ASYNC_MATERIALIZE_CONCURRENCY",
default_async_materialize_concurrency(),
)?,
use_gitoxide: parse_bool_env("GIT_CACHE_USE_GITOXIDE", default_use_gitoxide())?,
})
}
}
Expand Down Expand Up @@ -354,10 +349,6 @@ pub fn default_async_materialize_concurrency() -> usize {
8
}

pub fn default_use_gitoxide() -> bool {
true
}

fn default_shutdown_readiness_delay_seconds() -> u64 {
5
}
Expand Down
1 change: 0 additions & 1 deletion crates/git-cache-core/src/config/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const ENV_KEYS: &[&str] = &[
"GIT_CACHE_SHUTDOWN_DRAIN_TIMEOUT_SECONDS",
"GIT_CACHE_MAX_CONCURRENT_GIT_PROCESSES",
"GIT_CACHE_ASYNC_MATERIALIZE_CONCURRENCY",
"GIT_CACHE_USE_GITOXIDE",
"GIT_CACHE_LFS_MAX_OBJECT_BYTES",
"GIT_CACHE_PUBLIC_PATH_PREFIX",
];
Expand Down
1 change: 0 additions & 1 deletion crates/git-cache-domain/src/materializer/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ impl GitFixture {
max_concurrent_git_processes: git_cache_core::default_max_concurrent_git_processes(),
async_materialize_concurrency: 2,
public_path_prefix: String::new(),
use_gitoxide: true,
}
}

Expand Down
3 changes: 1 addition & 2 deletions crates/git-cache-domain/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ impl AppState {
Duration::from_secs(config.git_timeout_seconds),
config.max_concurrent_git_processes,
)
.with_output_limit(config.max_git_output_bytes)
.with_gitoxide(config.use_gitoxide);
.with_output_limit(config.max_git_output_bytes);
let git = with_optional_upstream_credentials(git, &config);
let disk = DiskManager::new(
&config.cache_root,
Expand Down
1 change: 0 additions & 1 deletion crates/git-cache-domain/src/state/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,5 @@ fn test_config(cache_root: PathBuf, object_root: PathBuf) -> AppConfig {
max_concurrent_git_processes: 1,
async_materialize_concurrency: 2,
public_path_prefix: String::new(),
use_gitoxide: true,
}
}
1 change: 0 additions & 1 deletion crates/git-cache-fuzz/tests/materializer_fuzz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ impl Fixture {
max_concurrent_git_processes: 4,
async_materialize_concurrency: 2,
public_path_prefix: String::new(),
use_gitoxide: true,
}
}

Expand Down
2 changes: 0 additions & 2 deletions crates/git-cache-git/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ repository.workspace = true
rust-version.workspace = true

[dependencies]
async-trait.workspace = true
bytes.workspace = true
git-cache-core = { path = "../git-cache-core" }
gix.workspace = true
tokio = { workspace = true, features = ["rt", "sync"] }
tracing.workspace = true
Loading
Loading