fix: add relative imports to the dependency list in deploymentUI (#8548)

* prepare sqlx

* Add relative imports to getDependencies of deployUI

* nit

* fix: correct get_imports doc comment, add tracing, use Set for dedup

- Fix copy-pasted doc comment on get_imports (said "get dependents")
- Add tracing::debug to get_imports handler to match get_dependents
- Use Set for O(1) duplicate detection in deploy dependency traversal

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Ruben Fiszel <ruben@windmill.dev>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
wendrul
2026-03-26 18:28:18 +00:00
committed by GitHub
co-authored by Claude Opus 4.6 Ruben Fiszel
parent 8866bd44cf
commit d760ea5eaf
5 changed files with 106 additions and 1 deletions
@@ -79,6 +79,7 @@ pub fn workspaced_service() -> Router {
.route("/rebuild_dependency_map", post(rebuild_dependency_map))
.route("/get_dependency_map", get(get_dependency_map))
.route("/get_dependents/*imported_path", get(get_dependents))
.route("/get_imports/*importer_path", get(get_imports))
.route("/get_dependents_amounts", post(get_dependents_amounts))
.route("/get_settings", get(get_settings))
.route(
@@ -4358,6 +4359,30 @@ async fn get_dependents(
Ok(Json(dependents))
}
async fn get_imports(
Extension(db): Extension<DB>,
Path((w_id, importer_path)): Path<(String, String)>,
_authed: ApiAuthed,
) -> JsonResult<Vec<String>> {
tracing::debug!(
workspace_id = %w_id,
importer_path = %importer_path,
"API: Getting imports for importer path"
);
let imports = ScopedDependencyMap::get_imports(&importer_path, &w_id, &db).await?;
tracing::debug!(
workspace_id = %w_id,
importer_path = %importer_path,
imports_count = imports.len(),
"API: Found imports: {:?}",
imports
);
Ok(Json(imports))
}
#[derive(Serialize, Debug)]
struct DependentsAmount {
imported_path: String,