feat(server): add tracing spans and caching to archive and blame services

- Add tracing spans with repo labels for archive and blame operations
- Implement caching for archive list entries when using OID selectors
- Implement caching for blame operations when using OID selectors
- Add detailed
This commit is contained in:
zhenyi
2026-06-04 15:33:16 +08:00
parent 729604f13b
commit cc202d6d1f
41 changed files with 2400 additions and 1067 deletions
+4 -5
View File
@@ -4,7 +4,6 @@ use crate::bare::GitBare;
use crate::error::{GitError, GitResult};
use crate::paginate;
use crate::pb::{ListTreeRequest, ListTreeResponse, TreeEntry, object_selector, tree_entry};
use crate::tree;
impl GitBare {
pub fn list_tree(&self, request: ListTreeRequest) -> GitResult<ListTreeResponse> {
@@ -41,23 +40,23 @@ impl GitBare {
};
let kind = entry.kind();
let hex = entry.id().to_string();
let entry_path = path.clone();
entries.push(TreeEntry {
name,
path: entry_path.clone(),
path,
oid: Some(self.oid_to_pb(hex)),
r#type: entry_type(kind) as i32,
mode: u32::from_str_radix(&format!("{:o}", entry.mode()), 8).unwrap_or(0),
size: entry_size(&repo, entry.id().to_string().as_str()).unwrap_or(0),
is_lfs: false,
recent_commit: tree::recent_commit(self, &revision, &entry_path),
recent_commit: None, // populated on demand, not per-entry subprocess
});
if request.recursive && matches!(kind, EntryKind::Tree) {
let child_path = entries.last().unwrap().path.clone();
let child = self.list_tree(ListTreeRequest {
repository: request.repository.clone(),
revision: request.revision.clone(),
path,
path: child_path,
recursive: true,
pagination: None,
})?;