feat(scans): show sub-steps of "Projekt erkennen" and clone once per scan (#421)
This commit was merged in pull request #421.
This commit is contained in:
1 parent
d4bfb4dc2a
commit
fce9edfbeb
11 files changed
+193
-16
No files matched your search
@@ -213,7 +213,7 @@ pub async fn build_embeddings(
|
||||
creds,
|
||||
agent_clone.net_guard,
|
||||
);
|
||||
let repo_path = match git_ops.clone_or_fetch(&view.git_url, &view.name) {
|
||||
let repo_path = match git_ops.clone_or_fetch(&view.git_url, &view.checkout) {
|
||||
Ok(p) => p,
|
||||
Err(e) => {
|
||||
tracing::error!("Failed to clone repo for embedding build: {e}");
|
||||
|
||||
@@ -325,7 +325,7 @@ pub async fn get_file_content(
|
||||
let db = tenant_db(&agent, &tenant).await?;
|
||||
let db = &db;
|
||||
|
||||
// Look up the repository to get repo name
|
||||
// Look up the repository to find its checkout
|
||||
let repo = db
|
||||
.onboarded_targets()
|
||||
.find_one(doc! { "_id": mongodb::bson::oid::ObjectId::parse_str(&repo_id).ok() })
|
||||
@@ -333,11 +333,16 @@ pub async fn get_file_content(
|
||||
.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?
|
||||
.ok_or(StatusCode::NOT_FOUND)?;
|
||||
|
||||
// The checkout is per tenant — read only from the caller's own.
|
||||
// The checkout is per tenant — read only from the caller's own. It is
|
||||
// named after the code artifact, as ingest clones it.
|
||||
let checkout = repo
|
||||
.code_artifact()
|
||||
.map(|code| code.id.as_str())
|
||||
.ok_or(StatusCode::NOT_FOUND)?;
|
||||
let repo_dir = crate::pipeline::git::clone_dir(
|
||||
std::path::Path::new(&agent.config.git_clone_base_path),
|
||||
&tenant.0.tenant_id,
|
||||
&repo.name,
|
||||
checkout,
|
||||
);
|
||||
let file_path = repo_dir.join(¶ms.path);
|
||||
|
||||
@@ -421,7 +426,7 @@ pub async fn trigger_build(
|
||||
creds,
|
||||
agent_clone.net_guard,
|
||||
);
|
||||
let repo_path = match git_ops.clone_or_fetch(&view.git_url, &view.name) {
|
||||
let repo_path = match git_ops.clone_or_fetch(&view.git_url, &view.checkout) {
|
||||
Ok(p) => p,
|
||||
Err(e) => {
|
||||
tracing::error!("Failed to clone repo for graph build: {e}");
|
||||
|
||||
Reference in new issue
Block a user