mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-09-06 08:18:58 +00:00
Replace mockito with HttpClient trait in fabro-github and detect import self-loops
Introduce an HttpClient trait abstraction over reqwest::Client so tests use a lightweight MockHttpClient instead of spawning a TCP server via mockito. This removes the mockito dev-dependency entirely and makes tests faster and more deterministic. Also add self-loop detection in ImportTransform to poison placeholders that have edges pointing back to themselves. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
2fa91fe6cb
commit
ab39f728c4
4 changed files with 671 additions and 520 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
|
@ -1673,7 +1673,6 @@ dependencies = [
|
|||
"base64",
|
||||
"chrono",
|
||||
"jsonwebtoken",
|
||||
"mockito",
|
||||
"reqwest",
|
||||
"serde",
|
||||
"serde_json",
|
||||
|
|
|
|||
|
|
@ -21,6 +21,5 @@ tracing.workspace = true
|
|||
tokio = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
mockito = "1"
|
||||
tokio = { workspace = true, features = ["test-util", "macros"] }
|
||||
base64.workspace = true
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -88,6 +88,19 @@ impl ImportTransform {
|
|||
return;
|
||||
}
|
||||
|
||||
if graph
|
||||
.edges
|
||||
.iter()
|
||||
.any(|edge| edge.from == placeholder_id && edge.to == placeholder_id)
|
||||
{
|
||||
Self::poison_placeholder(
|
||||
graph,
|
||||
placeholder_id,
|
||||
&format!("import placeholder '{placeholder_id}' cannot have a self-loop"),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
let placeholder = match Self::placeholder_config(graph, placeholder_id) {
|
||||
Ok(placeholder) => placeholder,
|
||||
Err(message) => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue