fetch: Log on old sigrefs

In hopes of nudging users to upgrade, print a warning if older feature
levels are encountered. However, only do this for delegates, as these
are more critical for the repository, to not log too many warnings.
This commit is contained in:
Lorenz Leutgeb 2026-03-22 17:59:20 +01:00 committed by Fintan Halpenny
parent 7fb032da9b
commit 8b166b2327
1 changed files with 6 additions and 1 deletions

View File

@ -8,7 +8,7 @@ use radicle::identity::{Did, Doc, DocError};
use radicle::storage;
use radicle::storage::git::Repository;
use radicle::storage::refs::RefsAt;
use radicle::storage::refs::{FeatureLevel, RefsAt};
use radicle::storage::{
git::Validation, Remote, RemoteId, RemoteRepository, Remotes, ValidateRepository, Validations,
};
@ -548,6 +548,7 @@ impl FetchState {
}
}
let level = refs.feature_level();
let cache = self.as_cached(handle);
let mut fails =
sigrefs::validate(&cache, refs)?.unwrap_or(Validations::default());
@ -561,6 +562,10 @@ impl FetchState {
valid_delegates.insert(remote);
remotes.insert(remote);
}
if level < FeatureLevel::LATEST {
log::warn!("Delegate {remote} is on feature level '{level}' which is lower than '{}', they should consider upgrading Radicle.", FeatureLevel::LATEST)
}
}
}
}