hive-forge dependency: surface a converged-despite-error case instead of swallowing it
This commit is contained in:
parent
7668454bae
commit
eefd971bd8
1 changed files with 19 additions and 10 deletions
|
|
@ -118,16 +118,25 @@ fn apply_and_verify(
|
|||
.iter()
|
||||
.filter_map(|d| d.get("number").and_then(Value::as_i64))
|
||||
.collect();
|
||||
let real_failures: Vec<String> = call_errors
|
||||
.into_iter()
|
||||
.filter(|(dep, _)| {
|
||||
let still_present = present.contains(&index(*dep).unwrap_or(-1));
|
||||
// Converged iff present after an add, absent after a remove.
|
||||
// A real failure is anything that didn't converge.
|
||||
still_present != adding
|
||||
})
|
||||
.map(|(dep, e)| format!("#{dep}: {e:#}"))
|
||||
.collect();
|
||||
let mut real_failures = Vec::new();
|
||||
for (dep, e) in call_errors {
|
||||
let still_present = present.contains(&index(dep).unwrap_or(-1));
|
||||
// Converged iff present after an add, absent after a remove.
|
||||
if still_present == adding {
|
||||
// The write landed despite the error, but the error itself is
|
||||
// still real signal: it means something *after* the write
|
||||
// failed server-side (a timeline entry, a notification, a
|
||||
// cycle check — we don't know which). Converging proves the
|
||||
// effect is present, not that the operation fully succeeded,
|
||||
// so don't let a clean exit make that anomaly unobservable.
|
||||
eprintln!(
|
||||
"hive-forge: warning: dependency on #{dep} converged despite a reported \
|
||||
error (server-side issue after the write, not a real failure): {e:#}"
|
||||
);
|
||||
} else {
|
||||
real_failures.push(format!("#{dep}: {e:#}"));
|
||||
}
|
||||
}
|
||||
if !real_failures.is_empty() {
|
||||
let verb = if adding { "add" } else { "remove" };
|
||||
bail!(
|
||||
|
|
|
|||
Loading…
Reference in a new issue