Watch
0
0
Fork
You've already forked hyperhive
0

swarm-controller: archive a destroyed agent's config repo, unarchive it when the name is created again

This commit is contained in:
damocles 2026-11-14 12:48:54 +01:00 • committed by mara
commit 7beb1193f4

View file

@ -594,7 +594,7 @@ fn seen<T, U>(res: Result<T, ForgejoError>, what: &str, f: impl FnOnce(T) -> U)
/// `EditRepoOption` with every field unset — repo edits only ever change the
/// one field the caller sets on top (Forgejo leaves `None` fields untouched).
fn sparse_edit_repo_option() -> EditRepoOption {
pub(super) fn sparse_edit_repo_option() -> EditRepoOption {
EditRepoOption {
allow_fast_forward_only_merge: None,
allow_manual_merge: None,
@ -728,7 +728,13 @@ impl Client {
return;
}
};
for name in repos.into_iter().filter_map(|r| r.name) {
// An archived repo is a destroyed agent's, and refuses every write, so
// converging its rule would fail on each pass for as long as it stays.
for name in repos
.into_iter()
.filter(|r| !r.archived.unwrap_or(false))
.filter_map(|r| r.name)
{
let rule = seen(
self.api
.call(|api| {